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

I know how to supress the notes in SAS by

options nonotes; 

I am wondering how I can supress specific notes that have a certin text strings because I have to read though a huge log, but still want to see unexpected notes. For example, omit: WARNING: The variable ORDER in the DROP, KEEP, or RENAME list has never been referenced.  

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

Be careful what you wish for!

 

It's one thing to suppress notes.  It's quite another to suppress warnings.  Warnings were designed by SAS to indicate that something may have gone wrong with your program.  The results may be different than what you want or expect.

 

You might be better off writing a program that reads the log as a raw data file, then prints the results you are looking for.  That way, the outcome is very much under your control, is more accurate than having a human read a huge log, and preserves all the original notes and warnings in case they are needed later.

View solution in original post

6 REPLIES 6
Rick_SAS
SAS Super FREQ

I don't advise turning off warnings, but it is possible. I think it was @Ksharp who mentioned that you can suppress these messages:

options dkricond=nowarning dkrocond=nowarning ;

- Doc for the DKRICOND= option  (Drop, Keep, Rename for Input)

- Doc for the DKROCOND= option (Drop, Keep, Rename for Output)

 

 

Astounding
PROC Star

Be careful what you wish for!

 

It's one thing to suppress notes.  It's quite another to suppress warnings.  Warnings were designed by SAS to indicate that something may have gone wrong with your program.  The results may be different than what you want or expect.

 

You might be better off writing a program that reads the log as a raw data file, then prints the results you are looking for.  That way, the outcome is very much under your control, is more accurate than having a human read a huge log, and preserves all the original notes and warnings in case they are needed later.

krueg314
Calcite | Level 5

I understand that warnings and errors are useful, but I run a custom version of SAS that has macros in the interface where there are macros I use that have warnings and notes I cannot change because I do not have permission. It seems clear that each warning need a custom way to get rid of the note so I'll just leave the code as is.

SASKiwi
PROC Star

The approach I take is to write code to begin with that does not produce warnings - it isn't that difficult. That means when a warning is written then something new has caused it to happen and needs investigation.

 

I would argue that code producing logs with warnings is not well written - how do you know then what is a new warning and should be checked out and what are "normal" warnings?

 

There is also the issue that a warning will cause a SAS job to have a non-zero return code. If you are running lots of SAS jobs, especially scheduled ones, then a zero return code is a sign that the job has run without any errors or warnings and does not need to be checked out.

Kurt_Bremser
Super User

You should NOT, and I mean NOT suppress such warnings, as they point to an error in the program, although one that does allow SAS to continue executing steps.

Identify the cause of the message, and remove it.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 6 replies
  • 16096 views
  • 11 likes
  • 5 in conversation