BookmarkSubscribeRSS Feed
dkanand86
Calcite | Level 5

Hi Everyone,

 

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.

 

Regards

4 REPLIES 4
JoshB
Quartz | Level 8

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

 

Quick example

 

/* 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.

Reeza
Super User
GOOGLE SAS LOG PARSER to find several macro's that parse the log.
SASKiwi
PROC Star

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. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1837 views
  • 0 likes
  • 4 in conversation