BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sm4
Quartz | Level 8 sm4
Quartz | Level 8

Hi,

 

The SAS documentation says that proc printto should allow appending to the log ("If you omit NEW, the new information is appended to the existing file.")

 

I've tried this and it doesn't work for me - log is just overwritten as usual:

proc printto log=log; 
run;

 

 

I've tried specifying the path/filename in the log= statement too, but that doesn't work either (and is probably irrelevant). 

Someone on a related page mentioned using a proc printto option called MOD that "allows appending instead of replacing," but that option isn't recognized by SAS as far as I can tell.

 

Context: When I run macro 2 after running macro 1, I want macro 2's log to be appended to macro 1's log rather than overwriting it.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

When you run in batch it's like running it in new session every time, so you get a separate log every time. 

 

What happens if you use PROC PRINTTO but point it to a text file? Does it append or replace the text file?

View solution in original post

4 REPLIES 4
Reeza
Super User

What SAS set up are you using? SAS Base treats the log differently than EG/Studio and the documentation is likely referencing working with Base SAS.

sm4
Quartz | Level 8 sm4
Quartz | Level 8

Thanks for the reply!

 

I see. I'm running through batch mode in Unix. I think I've googled this pretty extensively but can't find anything other than proc printto that's suitable for my purposes...

Reeza
Super User

When you run in batch it's like running it in new session every time, so you get a separate log every time. 

 

What happens if you use PROC PRINTTO but point it to a text file? Does it append or replace the text file?

sm4
Quartz | Level 8 sm4
Quartz | Level 8

It appends - thanks so much for dealing with my ignorance!! This is extremely helpful for keeping the previous macro records.

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
  • 4 replies
  • 1571 views
  • 3 likes
  • 2 in conversation