title: RowNum means in SQL and convert to SAS
body: <p>I Have a SQL code which has rownum in it. as below:</p>
  
  <pre><code> proc sql;
    create table dt as
   select d1.frst + (rownum - 1) as dt
                             from stg.stvcipc, work.d1                                        
                            where rownum  &lt;=  d1.lst - (d1.frst - 1);quit;
  </code></pre>
  
  <p>d1.frst and d1.lst are date values. I don't know what is rownum means, what is trying to do. I need to change this code to SAS. Anything same with SAS? </p>
  
  <pre><code>        from sfrstcr r
                       , ssrmeet m
                       , ( select d1.frst + (rownum - 1)  dt
                             from saturn.stvcipc         -- about 1200
                                , ( select min(stvterm_start_date)  frst
                                         , max(stvterm_end_date)    lst
                                      from saturn.stvterm v
                                     where v.stvterm_fa_proc_yr                = '&amp;v_aidy'                                          -- PARM '0910'
                                  ) d1
                            where rownum  &lt;=  d1.lst - (d1.frst - 1)
                         ) dt
  </code></pre>
  
  <p>This is the part of the original code. It is in select in select statements</p>