[code:2jbs68g8]以数据集test举例。
方法一:
data _null_;
dsid=open('test');
n=attrn(dsid,'nobs');
call symput('n',n);
run;
方法二:
data _null_;
set test end=last;
if last then do;
n=_n_;
output;
end;
call symput('n',n);
run;
方法三:
proc sql noprint;
select count(*) into:n from test;
quit;[/code:2jbs68g8]