Tuesday, September 22, 2009

Using %SYSFUNC Functions

%let dsid=%sysfunc(open(datamart.customer)) ;
%let nobs=%sysfunc(attrn(&dsid,nobs)) ;
%let dsid=%sysfunc(close(&dsid)) ;

%put The number of obs in datamart.customer is &nobs ;

81 %let dsid=%sysfunc(open(datamart.customer)) ;
82 %let nobs=%sysfunc(attrn(&dsid,nobs)) ;
83 %let dsid=%sysfunc(close(&dsid)) ;
84 %put The number of obs in datamart.customer is &nobs ;
The number of obs in datamart.customer is 6299497


Using %SYSFUNC For Report Date

proc print data=sashelp.class;
      title "We can put a todays (%sysfunc(today(),date9.)) date in a report title";
run;

No comments: