06-02-2014 04:44 AM
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.
06-02-2014 04:52 AM
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.
06-02-2014 04:59 AM
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.
06-03-2014 01:08 AM
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.
06-03-2014 01:51 AM
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.
06-03-2014 01:58 AM
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.
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).