Writing SAS Log to multiple places

Reply
Contributor
Posts: 36

Writing SAS Log to multiple places

Can I write SAS Log to multiple places ?

When I use PROC PRINTO command it only writes log in the file and not in the SAS efault log. I want to write to both. How can I achieve the same ?

PROC PRINTTO LOG="C:\Users\rkpanda\&datep1..log" NEW;

RUN;

Respected Advisor
Posts: 3,799

Re: Writing SAS Log to multiple places

Posted in reply to rajat051984

I would use system option ALTLOG you get the "regular" log and one being written to ALTLOG location.  You have to start SAS with the option but you can accommodate that.

If you still like using PROC PRINTTO.  You can just copy the PRINTTOed log back to LOG at the end of the program.

proc printto;

  run;

data _null_;

  infile "C:\Users......

  input;

  put _infile_;

  run;

Contributor
Posts: 36

Re: Writing SAS Log to multiple places

Posted in reply to data_null__

The folder where I weant to store the logs, will change for every program. So I guess ALTLOG will not work . Also I don't have proper authorization to change SAS system settings.

With respect to the PRINTTO procedure, can I do the reverse ? Copy from the default log back to a file.

Respected Advisor
Posts: 3,799

Re: Writing SAS Log to multiple places

Posted in reply to rajat051984

What is your execution "mode".

Contributor
Posts: 36

Re: Writing SAS Log to multiple places

Posted in reply to data_null__

I am using Windows SAS Editor and executing it by clicking the 'RUN' button.

Trusted Advisor
Posts: 1,929

Re: Writing SAS Log to multiple places

Posted in reply to rajat051984

Would it work to use PROC PRINTTO to place a LOG file in one location, and then within SAS execute DOS commands to copy the LOG file to other location(s)?

Contributor
Posts: 36

Re: Writing SAS Log to multiple places

Posted in reply to PaigeMiller

Thanks Paige for your reply. I want to watch the Default Log printing from my SAS session,  to check the progress of the job. I want the log stored in a folder location for record keeping purpose, so that in future if I need to check something I can go back to it.

Having multiple stored log is not my purpose.

Trusted Advisor
Posts: 3,214

Re: Writing SAS Log to multiple places

Posted in reply to rajat051984

The logging framework SAS(R) 9.4 Logging: Configuration and Programming Reference, Second Edition is probably already active.

It are the same guys you need to ask for your wanted service as the -altlog system option.  Wat is the problem asking them? 

---->-- ja karman --<-----
Contributor
Posts: 36

Re: Writing SAS Log to multiple places

Thanks, will try.

Ask a Question
Discussion stats
  • 8 replies
  • 329 views
  • 3 likes
  • 4 in conversation