%MACRO nobs(sasset); %*--macro returns the number of observations in the SAS data set; %LOCAL dsid rc numobs; %LET numobs=%STR(.); %LET dsid=%SYSFUNC(OPEN(&sasset)); %LET numobs=%SYSFUNC(ATTRN(&dsid,NOBS)); %LET rc=%SYSFUNC(CLOSE(&dsid)); %STR(&numobs) %MEND nobs;