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
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.
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.
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
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.
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).
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!
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.