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?

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 8 replies
  • 4693 views
  • 1 like
  • 5 in conversation