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 (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info 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.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 864 views
  • 2 likes
  • 5 in conversation