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?
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;
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.
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!
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.