<?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: Include and log in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Include-and-log/m-p/87541#M24976</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you saying that the PROC PRINTTO did not work for you?&amp;nbsp; Show us the PRINTTO steps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Mar 2013 21:58:25 GMT</pubDate>
    <dc:creator>ArtC</dc:creator>
    <dc:date>2013-03-25T21:58:25Z</dc:date>
    <item>
      <title>Include and log</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-and-log/m-p/87537#M24972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all.. I have a problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have several programs, 'program1', 'program2' etc, which shall be run in row. So first 'program1' and then 'program2' etc. I run my programs in batch mode and I have used the %include-statement to run program2 after program1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that I want to save specific logs for each program. &lt;/P&gt;&lt;P&gt;How can I do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the programs are for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #575757; text-decoration: underline;"&gt;Program 1:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;data temp2;&lt;/P&gt;&lt;P&gt;set temp1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%include' program2'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Program 2:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;data temp3;&lt;/P&gt;&lt;P&gt;set temp2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried with proc printto and dm-statements but have no luck..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you can help me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Best, Silas Skovsbo, Aarhus University, Denmark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 16:07:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-and-log/m-p/87537#M24972</guid>
      <dc:creator>silasskovsbo</dc:creator>
      <dc:date>2013-03-25T16:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Include and log</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-and-log/m-p/87538#M24973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC PRINTTO should be able to do this for you.&amp;nbsp; What problems did you have with that approach?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;PRE&gt;proc printto log="d:\junk\logA.log" new;
run;

%include "d:\junk\A.sas"/source2;

proc printto log="d:\junk\logB.log" new;
run;

%include "d:\junk\B.sas"/source2;

proc printto;
run;
&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;You need to have /source2 on the %include statement to have it write to the log.&amp;nbsp; And need NEW on the proc printto otherwise it will keep appending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;--Q.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 17:08:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-and-log/m-p/87538#M24973</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2013-03-25T17:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: Include and log</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-and-log/m-p/87539#M24974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;as suggested by @Quentin PRINTTO should do the trick.&amp;nbsp; You could also submit the jobs individually using the OS scheduler.&amp;nbsp; Other options include the use of the ALTLOG options and the use of DM statements to redirect the log.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 18:22:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-and-log/m-p/87539#M24974</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2013-03-25T18:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Include and log</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-and-log/m-p/87540#M24975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the fast response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using /source2 helped a bit. Now I get the full log. But I do get the full log in one textile, logA.&lt;/P&gt;&lt;P&gt;This does not print two separate log-files for program A and one for program B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know how to get that? And can you make an exact example of it? Just with the mentioned data-statements above?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 20:06:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-and-log/m-p/87540#M24975</guid>
      <dc:creator>silasskovsbo</dc:creator>
      <dc:date>2013-03-25T20:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Include and log</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-and-log/m-p/87541#M24976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you saying that the PROC PRINTTO did not work for you?&amp;nbsp; Show us the PRINTTO steps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 21:58:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-and-log/m-p/87541#M24976</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2013-03-25T21:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: Include and log</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-and-log/m-p/87542#M24977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in the answers I have seen I do not see the close for the printto&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%Macro SaveLog&lt;/P&gt;&lt;P&gt;(program&lt;/P&gt;&lt;P&gt;,path=d:\junk\);&lt;/P&gt;&lt;P&gt;PROC Printto log="&amp;amp;Path\&amp;amp;Program..log" &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new; &lt;/P&gt;&lt;P&gt;run;&amp;nbsp; &lt;/P&gt;&lt;P&gt;%include "&amp;amp;Path\&amp;amp;Program..sas"/source2;&amp;nbsp; &lt;/P&gt;&lt;P&gt;PROC Printto; &lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;%mend SaveLog;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%SaveLog(A)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%SaveLog(B)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;commentary:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;personally I use&lt;/P&gt;&lt;P&gt;filename Project '.';&lt;/P&gt;&lt;P&gt;in my autoexec&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and in programs:&lt;/P&gt;&lt;P&gt;%include Project(&amp;lt;program-name&amp;gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you guess I learned SAS on BigIron?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;note that the extension is not needed, unless the prefix of the program name has digits&lt;/P&gt;&lt;P&gt;i.e.:&lt;/P&gt;&lt;P&gt;%include Project(01-inport-csv);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this has to be expanded and surrounded with quotes:&lt;/P&gt;&lt;P&gt;%include Project('01-inport-csv.sas');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ron Fehd&amp;nbsp; logs maven&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 15:40:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-and-log/m-p/87542#M24977</guid>
      <dc:creator>Ron_MacroMaven</dc:creator>
      <dc:date>2013-03-28T15:40:42Z</dc:date>
    </item>
  </channel>
</rss>

