BookmarkSubscribeRSS Feed
RobertNYC
Obsidian | Level 7

 

 

Hi all,

 

I run a very large program once a week and save a log file using PROC PRINTO of the entire the run. While I still need a log file of the entire run, I would also like separate log files generated just for certain sections of the code which need to be saved other places during the run. So, one main log and then several separate section logs.   I’m having trouble figuring out how to do this during one pass.  Below is the main Proc Print code I use.  Any assistance is greatly aperciated

 

 

%Let DateStamp = &SysDate.-&SysTime.;
PROC PRINTTO LOG="/sasdata/RUNLOG %sysfunc(getoption(SysIn))-&DateStamp..LOG";run;
PROC PRINTTO PRINT="/sasdata//LTVLISTOUTPUT %sysfunc(getoption(SysIn))-&DateStamp..lst";run;

 

1 REPLY 1
DanielSantos
Barite | Level 11

Hi.

 

I think you already found the correct procedure.

 

Only it's not a single time use. You can call PROC PRINTTO anytime you want, wherever you want, to any file you want.

 

Everytime PROC PRINTTO is called it will redirect log/output from there until it's called again (to redirect to something else) or the end of the code is reached.

 

To redirect back to log just use:

 

proc printto;
run;

Hope it helps.

 

Daniel Santos @ www.cgd.pt

 

 

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 725 views
  • 1 like
  • 2 in conversation