In PROC SQL, we can use MONOTONIC() function to generate row numbers. It is an alternative to _N_ in data step.
SAS Code : To select row numbers between 10 and 20
proc sql noprint;SAS Code : To generate row numbers
create table temp as
select *
from sashelp.class
where monotonic() between 10 and 20;
quit;
proc sql noprint;
create table class2 as
select monotonic() as Number, *
from sashelp.class;
quit;
Very helpful explanation n easily understandable....thnx fr d teaching
ReplyDeleteVery helpful explanation n easily understandable....thnx fr d teaching
ReplyDeleteWas really helpful!
ReplyDelete