02-14-2012 11:08 AM
if just for debug purpose, you don't need to do anything (no addtional coding needed) except checking your log. Your log will tell you when _error_ has been set to 1, where you just have had an error occurred.
02-14-2012 10:55 AM
"...will stop the sas code from running" can mean a lot of things.
Depending on that, and how you are executing the program, there a very many alternatives how write your code.
If a an error occur, in most situations SAS will go into syntax check mode, and the rest of the program will just compile, not execute.
02-14-2012 11:14 AM
Another option is to simply add the word ' cancel' after your run statement (see: http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0611A&L=sas-l&P=R18708&D=1&H=0&O=D&T=1 )
That will cause SAS to ONLY look for syntax errors and NOT actually run the code.
02-16-2012 08:05 AM
If you are running interactively, you might want to look at OPTIONS DMSSYNCHK;
Be warned that (at least IMHO) SAS seriously broke it when they went to SAS 9.2; in SAS 9.1.3 it reset every time you submitted something, making it a very useful option to keep subsequent steps from running if an error occured. In SAS 9.2 if the DMSSYNCHK option is set and an error is caught you have to restart SAS to get it to behave again, which is enough of a p.i.t.a. that I quit using it. Don't know if they fixed that glitch in SAS 9.3.