How to check, if procedure run with warning or not?

Reply
Contributor
Posts: 28

How to check, if procedure run with warning or not?

Dear all,

I’m currently working on my program, which processes ANCOVA analysis by PROC MIXED in a loop. Some models are running correctly, some with warnings in the LOG.

Is there a way to check which one run with warning, which not?

I tried the macro variable SYSWARNINGTEXT, but when it  was set once to the warning text, it keeps the message for the subsequent PROC MIXED runs in a loop, even when they run correctly.

Thank you,

Natalie

Super User
Super User
Posts: 7,952

Re: How to check, if procedure run with warning or not?

Hi,

I have seen several different methods when analyzing logs.  My personal preference is to have a separate utility which you can drop a log onto and that provides a report on errors/warnings/notes found.  Note this is a custom built tool I wrote however you could do something similar in SAS.   I built a small .NET app which you can drag text files onto the icon and it will scan them for known issues from another text file.

You could wrap each procedure up in some additional code to check the outcome, but its a bit a of work and is it really worth the effort when you can just check the output log.

If your running interactively then run each step individually, if you run the whole program direct logs to a file then scan that file (this would also go further if your automating things, then the log could be automatically scanned).

Also, you need to be clear on what you are looking for as its not only errors/warnings which could trip you up, there are logical errors and some notes could also impact.

Super User
Posts: 7,781

Re: How to check, if procedure run with warning or not?

You can check for the state of the %syscc macro variable after each iteration and set it to zero at the start of the next.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 28

Re: How to check, if procedure run with warning or not?

Posted in reply to KurtBremser

Hi Kurt,

thanks for your reply. The SYSCC seems to work with "regular" warnings, but somehow it doesn't pick up the warning from PROC MIXED "More coefficients specified...".

We are running about 600 ANCOVA models and I wanted to flag those which produce this warning.

Natalie

Super User
Posts: 7,781

Re: How to check, if procedure run with warning or not?

When the "warnings" do not change the value of &SYSCC (and SAS technical support can't come up with a better solution), then some method that checks the log will be necessary.

You could run each model in a different batch job, producing individual logs, and check these with tools like grep

Or you could wrap it all in a single program, use PROC PRINTTO in each iteration to let each step write into a separate external file, and check this log with a DATA step.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Trusted Advisor
Posts: 3,212

Re: How to check, if procedure run with warning or not?

syserr is associacted with syswarning SAS(R) 9.4 Macro Language: Reference  it should give the value to the syscc.
As this does not happen SAS is not working conform his own documented error-handling concepts. I am convinced they should correct that.  

SAS(R) 9.4 Language Reference: Concepts, Second Edition

This paper is giving some info on notes    http://support.sas.com/resources/papers/proceedings12/332-2012.pdf

I was looking for a special option for error handling or macro-var as seen with other procs.

As by-pass you could do a analyses on logging output, but in the newer user interfaces (SAS studio 3,  Eguide 6.1, web-based, BI server/client) this approach is getting discouraged.
Only in old habit having your own open desktop a lot of this is still well allowed. The reason is:  working with files on the OS level is seen as the problem  (xcmd lockdown etc). 

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 5 replies
  • 300 views
  • 3 likes
  • 4 in conversation