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.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 4585 views
  • 4 likes
  • 4 in conversation