09-14-2011 09:00 AM
How do I stop SAS when it encounters an error. Just want it to stop processing, not terminate the session (Abend).
By simply stopping I can then still have the work datasets and log available to look for the cause.
Is there an Option for this
Thanks in advance
09-14-2011 10:08 AM
One option is to run the code via a wrapper, i.e. wrap the code within a macro, check for errors, and determine whether the next step will run based on the error codes.
E.g., take a look at: http://www2.sas.com/proceedings/sugi30/021-30.pdf
It shows the method for running in batch but, at the end, also shows how to set it up to run interactively.
09-15-2011 09:16 AM
If you are using SAS interactively, look at OPTIONS DMSSYNCHK. Be warned that SAS broke that a little bit in 9.2 as compared to 9.1.3. I don't know if they repaired it in 9.3. In 9.1.3 if you hit an error with DMSSYNCHK on it would stop subesquent steps that had already been submitted from running but would still allow you to resubmit without problems. In 9.2 if you hit an error with DMSSYNCHK you seem to have to restart SAS to get out of that error state. Still, even if you are stuck in that state you can still look at your datasets, logs, etc.