Use &syserr or &syscc (but you will need to reset it). %Macro Chec_Error; %let syscc = 0; run; quit; %if &syserr > 0 or &syscc > 0 %then %do; %put NOTE - "SYSERR - &syserr and SYSCC - &syscc "; %put NOTE - "Error Reason - &syserrortext"; %abort cancel; %end; %mend; Use the macro at the end of the code boundary.
... View more