BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
shlomiohana
Obsidian | Level 7

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
r_behata
Barite | Level 11

Try :

 

options errors=max;

View solution in original post

5 REPLIES 5
r_behata
Barite | Level 11

Try :

 

options errors=max;
shlomiohana
Obsidian | Level 7

Where to write the command?
My program is written with a macro

Quentin
Super User

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.

The Boston Area SAS Users Group is hosting free webinars!
Next up: Lisa Mendez & Richann Watson present Get Tipsy with Debugging Tips for SAS® Code: The After Party on Wednesday Jul 16.
Register now at https://www.basug.org/events.
ballardw
Super User

@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.


 

Kurt_Bremser
Super User

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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 5 replies
  • 1394 views
  • 2 likes
  • 5 in conversation