Hello,
I have the following warning commands in the log after the note: division by zero displays 20 times.
WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.
By default SAS only displays 20 of the messages and then has the Warning.
How can I change the default so all notes appear in the command log and the warning will not appear?
Thanks.
Try :
options errors=max;
Where to write the command?
My program is written with a macro
It's a system option, so you can submit that that OPTIONS statement any time before you call the macro, and the option will be set for your entire SAS session.
@shlomiohana wrote:
Hello,
I have the following warning commands in the log after the note: division by zero displays 20 times.
WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.
By default SAS only displays 20 of the messages and then has the Warning.
How can I change the default so all notes appear in the command log and the warning will not appear?
Thanks.
Instead of changing the warning fix the code.
You are dividing by 0. So if you test that the denominator is 0 before the calculation the error will go away:
if v ne 0 then someresult = <expression> / v;
Then this particular easy to address issue goes away.
Be VERY careful with setting the option to MAX. If you run a data step with millions of observations that cause these NOTEs, your log will blow up your EG, or at least cause an extended freeze while the log is downloaded.
The proper avenue is to code around the problem by checking for a zero divisor before the division is done; it will only take a simple IF statement.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.