Did the 2nd to %includes in the example run as intended? If they did, there might be something in one of your actual %includes that has to be addressed by the macro. The following alternative might be enough. It clears out most unfinished business, with the exception of replacing a missing %mend statement in your code: %macro runquit; ; run; quit; *))%*))*/; ;;;; options notes; run cancel; quit; proc unk; run; %if &syserr. ne 0 %then %do; %abort; %end; %mend runquit; data _null_; file "c:\art\saspgm1.sas"; put "data test; set sashelp.class obs=1;run;"; run; data _null_; file "c:\art\saspgm2.sas"; put "proc print data=sashelp.class (obs=1);run;"; run; data _null_; file "c:\art\saspgm3.sas"; put "proc print data=sashelp.class (obs=2);run;"; run; %include 'c:\art\saspgm1.sas'; %runquit %include 'c:\art\saspgm2.sas'; %runquit %include 'c:\art\saspgm3.sas';
... View more