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!
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?
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.
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...
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?
It appends - thanks so much for dealing with my ignorance!! This is extremely helpful for keeping the previous macro records.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.