<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Printing Logs for Separate Sections of a Large program During One pass in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Printing-Logs-for-Separate-Sections-of-a-Large-program-During/m-p/333856#M62857</link>
    <description>&lt;P&gt;Hi.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you already found the correct procedure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Only it's not a single time use. You can call PROC PRINTTO anytime you want, wherever you want, to any file you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To redirect back to log just use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc printto;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope it helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Daniel Santos&amp;nbsp;@ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Feb 2017 17:24:51 GMT</pubDate>
    <dc:creator>DanielSantos</dc:creator>
    <dc:date>2017-02-17T17:24:51Z</dc:date>
    <item>
      <title>Printing Logs for Separate Sections of a Large program During One pass</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Printing-Logs-for-Separate-Sections-of-a-Large-program-During/m-p/333828#M62855</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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. &amp;nbsp;&amp;nbsp;I’m having trouble figuring out how to do this during one pass. &amp;nbsp;Below is the main Proc Print code I use. &amp;nbsp;Any assistance is greatly aperciated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%Let DateStamp = &amp;amp;SysDate.-&amp;amp;SysTime.;
PROC PRINTTO LOG="/sasdata/RUNLOG %sysfunc(getoption(SysIn))-&amp;amp;DateStamp..LOG";run;
PROC PRINTTO PRINT="/sasdata//LTVLISTOUTPUT %sysfunc(getoption(SysIn))-&amp;amp;DateStamp..lst";run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2017 16:06:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Printing-Logs-for-Separate-Sections-of-a-Large-program-During/m-p/333828#M62855</guid>
      <dc:creator>RobertNYC</dc:creator>
      <dc:date>2017-02-17T16:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Printing Logs for Separate Sections of a Large program During One pass</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Printing-Logs-for-Separate-Sections-of-a-Large-program-During/m-p/333856#M62857</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you already found the correct procedure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Only it's not a single time use. You can call PROC PRINTTO anytime you want, wherever you want, to any file you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To redirect back to log just use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc printto;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope it helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Daniel Santos&amp;nbsp;@ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2017 17:24:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Printing-Logs-for-Separate-Sections-of-a-Large-program-During/m-p/333856#M62857</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2017-02-17T17:24:51Z</dc:date>
    </item>
  </channel>
</rss>

