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;
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;
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.
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.
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!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.