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.

BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: 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-2024.png

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.

 

Register now!

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