BookmarkSubscribeRSS Feed
thewan
Quartz | Level 8

Hi,

I have a number of simulations that I am running. I know that some of them will fail due to a floating point error. The problem is that SAS aborts the program when it detects this error. Is it possible to continue the program and just not collect results from the simulations that fail? I am looking for a try catch error solution. I googled and tried the options that other people recommended (see below) but none of them worked. Thank you.

options obs=max nosyntaxcheck;
options dkricond=nowarn;
 options nosyntaxcheck;

 

3 REPLIES 3
Reeza
Super User

You may need to do this at the point of calculation where the error may occur rather than use a generic option. 

 


@thewan wrote:

Hi,

I have a number of simulations that I am running. I know that some of them will fail due to a floating point error. The problem is that SAS aborts the program when it detects this error. Is it possible to continue the program and just not collect results from the simulations that fail? I am looking for a try catch error solution. I googled and tried the options that other people recommended (see below) but none of them worked. Thank you.

options obs=max nosyntaxcheck;
options dkricond=nowarn;
 options nosyntaxcheck;

 


 

ballardw
Super User

Since you already know that some will fail with a floating point error, what causes that floating point error?

Perhaps you just need to check variables for some ranges of values and don't do the calculation and do a graceful exit.

 

Does this error occur in a data step or a proc? If a procedure, which one? There may be options to help recover if you can provide explicit examples.

SASKiwi
PROC Star

Check the ERRORABEND SAS option using PROC OPTIONS. Typically SAS programs don't abort unless this option is set or your code contains ABORT statements.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 3 replies
  • 4129 views
  • 4 likes
  • 4 in conversation