%macro endif; %*--terminate the SAS system if an error in latest step is indicated--; %if &syserr > 4 %then %do; %*--obviously, the macro must be run at a step boundary--; data _null_; put '*****SAS will now terminate due to errors detected in earlier step(s)*****.'; endsas; run; %end; %mend endif;