Here is another way to find the rows in a SAS dataset without SQL:
%macro row_count (tablename =);
%* OBS method uses SCL to open a table, get the row count, close it and return the row count
so it works like a function.;
%local dsid obs;
%let dsid = %sysfunc(open(&tablename));
%if &dsid %then %let obs = %sysfunc(attrn(&dsid, nlobs));
%let tmp_varlist = &obs;
%let dsid = %sysfunc(close(&dsid));
&obs
%mend row_count;
%let rows = %row_count(tablename = sashelp.class);
%put rows = &rows;
... View more