Proc Printto not Appending to Log

Accepted Solution Solved
Reply
Contributor sm4
Contributor
Posts: 51
Accepted Solution

Proc Printto not Appending to Log

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!


Accepted Solutions
Solution
‎11-02-2017 06:16 PM
Super User
Posts: 23,773

Re: Proc Printto not Appending to Log

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


All Replies
Super User
Posts: 23,773

Re: Proc Printto not Appending to Log

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.

Contributor sm4
Contributor
Posts: 51

Re: Proc Printto not Appending to Log

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...

Solution
‎11-02-2017 06:16 PM
Super User
Posts: 23,773

Re: Proc Printto not Appending to Log

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?

Contributor sm4
Contributor
Posts: 51

Re: Proc Printto not Appending to Log

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

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 259 views
  • 3 likes
  • 2 in conversation