- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I used proc printto to save logs, yet this way the log summary will not show if any error or warning. I am wondering if there is anyway that I can save all the log information while also could view the log summary?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The way to do this is to use the ALTLOG option. This sadly is only a startup option. it would be very useful to have the choice on the go.
An imperfect alternative is to re-read the log file:
option spool ;
proc printto log = "&wdir\tt.log" new;
proc sql; create table T as select 1 as X, 1 as X from SASHELP.CLASS; quit;
proc printto log = log;
data _null_;
infile "&wdir\tt.log";
input;
putlog _infile_;
run;
I see that you use EG. EG will highlight some messages, depending on its mood at the time and its version:
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@ChrisNZ wrote:
I see that you use EG. EG will highlight some messages, depending on its mood at the time and its version:
EG 8.2 (and presumably subsequent versions) is a lot better than its predecessors.
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I dislike PRINTTO for that very reason. In batch jobs, I use -ALTLOG which creates a copy of the log, but I've not tried setting that up in Enterprise Guide. I'm not sure that ALTLOG would be supported in EG since it usually has to be specified at start up.
I think the best alternative in EG is to create a step in the Project that automatically exports your log. It's not perfect, but it's generally workable.
Above the program editor window, there is a "Share" icon. You would click on that and then "Log" and then "Export as a step in project."
A wizard should open up. Step through the wizard, making sure to uncheck "Overwrite existing output".
SAS will automatically copy the log every time you run that part of the process and will embed a date time stamp in the filename. Unfortunately, macro variables are not resolved in this context. 😞
Make sure you select and run both the program and the export step or the log will not be automatically saved.
Jim