12-17-2015 02:45 PM
I would like to summarise the usual SAS LOG into more meaningful way, to identify quickly SAS log errors, warnings and notes.
Please suggest ways of achieving this output.
12-17-2015 02:56 PM - edited 12-17-2015 02:58 PM
1. Use PROC PRINTTO to route the log to a file.
2. Use data step to read in that log file keeping the lines you're interested in
/* route the log */ PROC PRINTTO LOG="directory/file.log' NEW; RUN; /* run all your regular sas code to generate the log */ /* return log to default */ PROC PRINTTO LOG=LOG; RUN;
/* read in the generated log file and keep what you want to see */ data processed_log; length line $1000; infile "directory/file.log"; input; logfile = "directory/file.log"; line_num = _n_; line = _infile_; issue = 0; if index(upcase(line),"ERROR") > 0 then do; issue = 1; output; end; run;
I would treat that as pseudocode, but it should be flexible to fit your need. You can look for errors, warnings, notes, etc. with similar logic. Good luck.
12-17-2015 04:15 PM - edited 12-18-2015 06:55 PM
Both SAS Enterprise Guide and SAS Studio do that without any extra coding.
These SAS clients work with either local PC SAS or remote SAS servers.