If SAS encounters an error, sometimes it will stop with the following message:

NOTE: SAS set option OBS=0 and will continue to check statements.

This will allow the rest of the code to be syntax checked without impacting any data. But what if you want to handle this error, and continue processing? This is possible, as follows:

/* reset the error variable */
%let syscc=0;  
/*  reset the obs=0 option */
options obs=max; 
/* re-enable the replacement of permanent datasets */
options replace; 
 /* remove syntaxcheck only mode */
options nosyntaxcheck;
/* this variable lets you capture the last ERROR message */
%put &=syserrortext; 


Inspiration: https://stackoverflow.com/a/37174073/66696