07-15-2015 01:16 PM
I would like to review a set of Log files produced. I would like to automate the process by running some sort of SAS code that would comb through the log files and returns all lines containing errors and warnings for my review. any ideas?
07-15-2015 06:27 PM
Many ways to skin that particular cat depending on what you're after.
Here's an example I wrote once to seek steps with run times higher that 4 seconds.
You log analysis program will look very similar. Just modify to suit your needs.
if LASTREC then put MAXTIME= /;
retain N MAXTIME;
pad truncover end=LASTREC;
input X $250.;
if X=:'real time' then TIME=input(scan(X,3,' '),stimer.);
if TIME>4 or N;
if N=. then put / '==============' / / X9 / X8 / X7 / X6 / X5 / X4 / X3 / X2 / X1;
if TIME>4 then do;
if _N_ < N+9 then put X;
07-15-2015 06:32 PM
Is there any reason it has to be a SAS program? Depending on the operating system, there may be system commands already built to do what you are asking for. So that's question #1, what is your operating system.
Suggestion: Don't limit your search to errors and warnings. Some notes may be important: uninitialized variables, type conversions, many-to-many merges to name a few.
07-17-2015 01:53 PM
it doesnt have to be, but it is more convinient I guess, Since the code is part of a monthly run. I appreciate your suggestion regarding the extra notes. Ill make sure to include those as well.
10-26-2015 08:12 AM
I found a pretty cool add-in to Base SAS on www.tatesoft.com that may be very usefull to you. The tool called Log Analyser is integrated into Base SAS and can produce Log summary report in a second. You may also analyse log in details if you wish. Really great tool!