BookmarkSubscribeRSS Feed
ybz12003
Rhodochrosite | Level 12

Good morning, all:

 

I would like to save the SAS log in text file as record for furture review, how could I do it? Should I put the command statement at the begining of all the SAS code or at the end?  Please help, thanks.

 

For example, I would like to save the SAS log into "C:\Documment\SAS file\SAS log.txt"

4 REPLIES 4
LinusH
Tourmaline | Level 20

How do you use SAS?

If you run SAS in batch mode, a log is created by default.

 

Take a look at the LOG option, and PROC PRINTTO.

Data never sleeps
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

 

At the point you want to send the log to a file run:

proc printto log= "C:\Documment\SAS file\SAS log.txt";
run;

And when you want to end outputting to file:

proc printto;
run;
Astounding
PROC Star

Note that PROC PRINTTO will move your log to the file you select.  You might want something slightly different ... keeping the log where it is, but sending a copy of it to a file that you choose.  You can do that with a different tool.

 

ALTLOG must be specified at SAS invocation, not in the middle of a program:

 

http://support.sas.com/documentation/cdl/en/hostwin/67962/HTML/default/viewer.htm#n02cl0iq0k1fmxn11p...

 

It will send a copy of the log to the destination that you choose, while leaving the original log in place.

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
  • 1021 views
  • 3 likes
  • 5 in conversation