Hi
Please note, that the NOBS= option of the SET statement can only be used with SAS data sets. If your data is coming from a DBMS like Oracle, DB2 etc, then this approach can not be used. Instead you have to count the number of rows.
To run code contionally, one usually uses the SAS Macro Language.
Find below an example that shows how to count the rows, and then run some DATA Step.
%macro createData(dsn=);
%local rowCount;
proc sql noprint;
select
count(*)
into
:rowCount trimmed
from
&dsn
;
quit;
%put NOTE: &=rowCount;
%if &rowCount > 0 %then %do;
data newTable;
set &dsn;
run;
%end;
%else %do;
%put NOTE: &sysmacroname &dsn is empty;
%end;
%mend;
%createData(dsn=xora.tempcars)
Bruno
... View more