BookmarkSubscribeRSS Feed
amrshd
Fluorite | Level 6

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

8 REPLIES 8
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.  

amrshd
Fluorite | Level 6
I have SAS 9.4
SASKiwi
PROC Star

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. 

Reeza
Super User
What do you mean by SAS logs?
amrshd
Fluorite | Level 6

I mean, when we run SAS codes there is log generated. I want to save that log as a txt file

Kurt_Bremser
Super User

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.

Reeza
Super User

How is ODS affecting your log?

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 6361 views
  • 1 like
  • 5 in conversation