In SAS, what are good techniques/options for catching syntax errors?
In the enhanced editor, the coloring might give you a hint. However, on the mainframe I don't believe there is anything, in the editor, that will help you.
OPTIONS OBS=0 noreplace;
The obs=0 option specifies that 0 observarions are read in from the input
dataset and NOREPLACE tells SAS not to overwite an existing SAS dataset with one of the
same name. If you are creating a new datastet, it will be created with all the attributes,
but with 0 observations. (Be sure to reset the options, if needed, to Options Obs=max replace ; when no more syntax errors are found).
I'd be interested in any other techniques.
Explanation about options came from [here.]
You can use the automatic SAS variable called _ERROR_ to check for errors. If _ERROR_ =1 then there was an error. If it is 0 then there was not. You can have the SAS data step differentially process based on this automatic variable