BookmarkSubscribeRSS Feed
slolay
Fluorite | Level 6

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

5 REPLIES 5
art297
Opal | Level 21

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.

FriedEgg
SAS Employee

Check what your options are:

proc options group=ERRORHANDLING; run;

specificly look into ERRORABEND/NOERRORABEND, ERRORBYABEND/NOERRORBYABEND

slolay
Fluorite | Level 6

Thanks Guys

Will look into them and post back

Steve

DouglasMartin
Calcite | Level 5

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.

Filipvdr
Pyrite | Level 9

I could not find the answer I was looking for.


I have flows build in DI studio, when I run the generated .sas code in batch I want the batch job to stop when/if the first error occurs.

 

Any idea's? 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 4776 views
  • 1 like
  • 5 in conversation