If you just want to check for a certain number of records processed in an export, you can do that:
%let nrecords=0; * necessary, because the following data step will have no iteration at all if dataset indataset is empty;
data _null_;
file "outfile" /* options */;
set indataset /* options */ end=done;
put
/* variables */
;
if done then call symput('nrecords',strip(put(_n_,best.)));
run;
%macro write_sem;
%if "&nrecords" ne "0" %then %do;
data _null_;
file "semfile";
put 'OK';
run;
%end;
%mend;
%write_sem;
... View more