DATA Step, Macro, Functions and more

Stop SAS Processing On Error

Reply
Contributor
Posts: 51

Stop SAS Processing On Error

Hi

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

Steve

PROC Star
Posts: 7,363

Stop SAS Processing On Error

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.

Trusted Advisor
Posts: 1,300

Stop SAS Processing On Error

Check what your options are:

proc options group=ERRORHANDLING; run;

specificly look into ERRORABEND/NOERRORABEND, ERRORBYABEND/NOERRORBYABEND

Contributor
Posts: 51

Stop SAS Processing On Error

Thanks Guys

Will look into them and post back

Steve

Contributor
Posts: 35

Stop SAS Processing On Error

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.

Ask a Question
Discussion stats
  • 4 replies
  • 2137 views
  • 0 likes
  • 4 in conversation