<?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: Outputting Proc Printto LOG to Two Locations in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Outputting-Proc-Printto-LOG-to-Two-Locations/m-p/673212#M202473</link>
    <description>&lt;P&gt;This may not help, but there is a SAS system option called ALTLOG.&lt;/P&gt;
&lt;P&gt;It is not conditional and must be set at invocation, i.e. the configuration file or the command line.&lt;/P&gt;
&lt;P&gt;This would capture an entire session's log as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this second file supposed to hold different information that the "timestamped" file? If not you may be able to copy that file with X command or %SYSEXEC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are running Display Manager you &lt;STRONG&gt;might&lt;/STRONG&gt; be able to get display manager commands in the body of a program to 1)make the log the active window 2) use the File or Save command to save the current contents of the Log, and return to execution (this possibly being a problem) save the log&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jul 2020 16:53:14 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-07-29T16:53:14Z</dc:date>
    <item>
      <title>Outputting Proc Printto LOG to Two Locations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-Proc-Printto-LOG-to-Two-Locations/m-p/672946#M202319</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have searched and have been unable to find a solution. This feels like it should be very simple but I am unable to resolve.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt; I have many scheduled programs that output logs via a proc print with their respective date &amp;amp; time stamps to use for general debugging. I run programming to read in the logs and look for keywords. I would like make a change to output TWO logs. One as I have been but an alternate log, without the date &amp;amp; time stamp, to a different directory. Please let me know how obvious this solution is...thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample Code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let date_time = %sysfunc(compress(%sysfunc(putn(%sysfunc(datepart(%sysfunc(int(%sysfunc(datetime()))))),yymmdd10.)),'-')) %sysfunc(compress(%sysfunc(translate(%sysfunc(putn(%sysfunc(timepart(%sysfunc(int(%sysfunc(datetime()))))),time8.)),'0','')),':'));

proc printto log='g:dir\logs\test1.log&amp;amp;date_time..log' new ;
/*need a output to another directory, without the datetime stamp*/
run;

data temp;
infile DATALINES dsd missover;
input a b c d;
CARDS;
1, 2, 3, 4
, 3, , 5
, 3
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Log:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mattmm_0-1595960828060.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47749iA963A4503B023CB2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mattmm_0-1595960828060.png" alt="mattmm_0-1595960828060.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2020 18:31:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-Proc-Printto-LOG-to-Two-Locations/m-p/672946#M202319</guid>
      <dc:creator>mattmm</dc:creator>
      <dc:date>2020-07-28T18:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting Proc Printto LOG to Two Locations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-Proc-Printto-LOG-to-Two-Locations/m-p/673212#M202473</link>
      <description>&lt;P&gt;This may not help, but there is a SAS system option called ALTLOG.&lt;/P&gt;
&lt;P&gt;It is not conditional and must be set at invocation, i.e. the configuration file or the command line.&lt;/P&gt;
&lt;P&gt;This would capture an entire session's log as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this second file supposed to hold different information that the "timestamped" file? If not you may be able to copy that file with X command or %SYSEXEC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are running Display Manager you &lt;STRONG&gt;might&lt;/STRONG&gt; be able to get display manager commands in the body of a program to 1)make the log the active window 2) use the File or Save command to save the current contents of the Log, and return to execution (this possibly being a problem) save the log&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 16:53:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-Proc-Printto-LOG-to-Two-Locations/m-p/673212#M202473</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-29T16:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting Proc Printto LOG to Two Locations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-Proc-Printto-LOG-to-Two-Locations/m-p/673216#M202474</link>
      <description>&lt;P&gt;I'm not aware of a way to have SAS write the log to two different destinations at once.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, once you are done writing the log via PROC PRINTTO, you could then close PROC PRINTTO and use operating system commands from within your SAS program, or the &lt;A href="https://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=n10dz22b5ixohin1vwzilweetek0.htm&amp;amp;locale=en" target="_self"&gt;FCOPY&lt;/A&gt; function, to copy the log to some other folder.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 17:02:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-Proc-Printto-LOG-to-Two-Locations/m-p/673216#M202474</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-29T17:02:20Z</dc:date>
    </item>
  </channel>
</rss>

