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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.