mercredi 12 février 2020

sas if no observations then stop execute

Any idea why this stop execution code doesn't work? There is no observation in table1, but proc print still runs.

%macro execute (inputdata=work.table1);

data _null_;
if 0 then set &inputdata. nobs=n;
call symputx('totobs',n);
stop;
run;


%if &totobs. = 0 %then %put exit;
%else %do;
%put execute further;
%end;
%mend execute;
%execute(inputdata=work.table1)

proc print data= work.table1;
run;

Aucun commentaire:

Enregistrer un commentaire