Suppressing Specific SAS Notes in the Log

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Suppressing Specific SAS Notes in the Log

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.  


Accepted Solutions
Solution
‎08-09-2016 08:37 AM
Respected Advisor
Posts: 4,995

Re: Suppressing Specific SAS Notes in the Log

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


All Replies
SAS Super FREQ
Posts: 3,415

Re: Suppressing Specific SAS Notes in the Log

[ Edited ]

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)

 

 

Solution
‎08-09-2016 08:37 AM
Respected Advisor
Posts: 4,995

Re: Suppressing Specific SAS Notes in the Log

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.

New Contributor
Posts: 3

Re: Suppressing Specific SAS Notes in the Log

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.

Esteemed Advisor
Posts: 6,693

Re: Suppressing Specific SAS Notes in the Log

If you don't have permission to change the code you will have to live with the warnings.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Respected Advisor
Posts: 3,065

Re: Suppressing Specific SAS Notes in the Log

[ Edited ]

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.

Esteemed Advisor
Posts: 6,693

Re: Suppressing Specific SAS Notes in the Log

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 615 views
  • 9 likes
  • 5 in conversation