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.

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