Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In SAS, what are good techniques/options for catching syntax errors?

Tags:

sas

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.

I use

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. Thanks

Explanation about options came from here.

like image 659
Jay Corbett Avatar asked May 07 '09 18:05

Jay Corbett


1 Answers

I use the cancel option on the run statement. It will check the syntax of the data step then terminate it without actually executing it. It's the data step analog to the noexec option in proc sql.

data something;
<stuff here>
run cancel;

Lots more details in this SUGI pdf

like image 140
cmjohns Avatar answered Sep 24 '22 12:09

cmjohns