01-20-2016 08:47 AM
I want to save SAS logs and I have used Proc Printto and dm 'log' file = 'option'. These procedures are not working due to presence of ODS statements are written throughout the program.
Please suggest how do I save log files other than Printto and dm log options...
01-20-2016 08:52 AM
How is your SAS set up? Do you use SAS Studio, SAS Enterprise Guide, or basic Display Manager?
01-20-2016 09:03 AM
In my opinion this should be a program level setup. Easiest way to "store" a log is to batch submit things, log is automatically stored in the same directory. ODS shouldnit change proc printto, i.e. in my programs I need to write an rtf:
ods rtf file...;
ods rtf close;
This should not affect the log output. Generally I would advise avoiding the use of redirection of this type for several reasons.
01-20-2016 01:40 PM
One way to save logs automatically is to run your SAS program in batch. This does not require use of PROC PRINTTO and ODS output can be controlled by writing it to files.
01-21-2016 01:39 AM
The question stays, in what mode do you run your SAS codes: interactive (display manager, SAS Studio, Enterprise Guide) or in batch?
If in batch, you need a wrapper script that consistently specifies a location and filename for your logs. If you include program name, date&time, and process number in the filename of the log file, you will get a complete documentation of every batch run.