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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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