<?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: print external log file to current log in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/print-external-log-file-to-current-log/m-p/790011#M252901</link>
    <description>&lt;P&gt;How about these ways.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Use the X command to open the log file in a different application.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x "notepad &amp;amp;logref";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Save the log file with DM statement instead of PROC PRINTTO.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc printto new print="&amp;amp;lstref";
run;


DM "LOG; FILE ""&amp;amp;logref"" ";/* at end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This does not work in batch mode.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Read the log file with the INFILE statement and output it to the log.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename f "&amp;amp;logref";
data _null_;
  infile f;
  input;
  putlog _infile_;
run;
filename f;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jan 2022 16:01:55 GMT</pubDate>
    <dc:creator>japelin</dc:creator>
    <dc:date>2022-01-13T16:01:55Z</dc:date>
    <item>
      <title>print external log file to current log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/print-external-log-file-to-current-log/m-p/790007#M252897</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I output my log to an external log file and reset to the default SAS log at end of program.&lt;/P&gt;
&lt;P&gt;proc printto new log="&amp;amp;logref" print="&amp;amp;lstref";&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc printto;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;I am wondering whether I can review the external log file in SAS log window at end of the program. Import external log ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Ivy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 15:35:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/print-external-log-file-to-current-log/m-p/790007#M252897</guid>
      <dc:creator>Ivy</dc:creator>
      <dc:date>2022-01-13T15:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: print external log file to current log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/print-external-log-file-to-current-log/m-p/790011#M252901</link>
      <description>&lt;P&gt;How about these ways.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Use the X command to open the log file in a different application.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x "notepad &amp;amp;logref";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Save the log file with DM statement instead of PROC PRINTTO.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc printto new print="&amp;amp;lstref";
run;


DM "LOG; FILE ""&amp;amp;logref"" ";/* at end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This does not work in batch mode.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Read the log file with the INFILE statement and output it to the log.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename f "&amp;amp;logref";
data _null_;
  infile f;
  input;
  putlog _infile_;
run;
filename f;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 16:01:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/print-external-log-file-to-current-log/m-p/790011#M252901</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2022-01-13T16:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: print external log file to current log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/print-external-log-file-to-current-log/m-p/790020#M252907</link>
      <description>Thank you very much !</description>
      <pubDate>Thu, 13 Jan 2022 16:30:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/print-external-log-file-to-current-log/m-p/790020#M252907</guid>
      <dc:creator>Ivy</dc:creator>
      <dc:date>2022-01-13T16:30:28Z</dc:date>
    </item>
  </channel>
</rss>

