<?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: Running multiple SAS programs from one program in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281229#M56984</link>
    <description>&lt;P&gt;Where should the logs go?&amp;nbsp; What should they be named?&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jun 2016 19:06:19 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-06-29T19:06:19Z</dc:date>
    <item>
      <title>Running multiple SAS programs from one program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281215#M56981</link>
      <description>&lt;P&gt;How to run multiple SAS programs from one single SAS program. A log file should also be created for each SAS program&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 18:42:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281215#M56981</guid>
      <dc:creator>KBACHU</dc:creator>
      <dc:date>2016-06-29T18:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Running multiple SAS programs from one program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281222#M56982</link>
      <description>&lt;P&gt;Why?&lt;/P&gt;
&lt;P&gt;If your requirement is&amp;nbsp;separated logs, it's easier to call those&amp;nbsp;programs in an external shell/dos script instead.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 18:51:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281222#M56982</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-06-29T18:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: Running multiple SAS programs from one program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281229#M56984</link>
      <description>&lt;P&gt;Where should the logs go?&amp;nbsp; What should they be named?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 19:06:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281229#M56984</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-06-29T19:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Running multiple SAS programs from one program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281232#M56985</link>
      <description>&lt;P&gt;Logs should be created at the same location as programs and should be named as programs. I tried running the below test.sas code in which I included multiple SAS programs, but it doesnt create the log files separately instead writing everything to test.log file. I would like to have the log files created for each SAS program, something like test2.log, test3.log, test4.log&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Content of test.sas is as below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;%INCLUDE&lt;/SPAN&gt; &lt;SPAN style="background: white; color: purple; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;'\\XYZ\test2.sas'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;%INCLUDE&lt;/SPAN&gt; &lt;SPAN style="background: white; color: purple; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;'\\XYZ\test3.sas'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;%INCLUDE&lt;/SPAN&gt; &lt;SPAN style="background: white; color: purple; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;'\\XYZ\test4.sas'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 19:11:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281232#M56985</guid>
      <dc:creator>KBACHU</dc:creator>
      <dc:date>2016-06-29T19:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Running multiple SAS programs from one program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281237#M56987</link>
      <description>&lt;P&gt;Use PROC PRINTTO before each %include to create and direct the log file to where you want it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 19:20:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281237#M56987</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-29T19:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Running multiple SAS programs from one program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281242#M56989</link>
      <description>&lt;P&gt;Reeza and I are thinking alike.&amp;nbsp; I would write a macro:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro run_one (path);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; proc printto log="&amp;amp;path.log";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; %include "&amp;amp;path.sas";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;%mend run_one;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then the trick is to call the macro properly:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%run_one (\\XYZ\test2.)&lt;/P&gt;
&lt;P&gt;%run_one (\\XYZ\test3.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notice that the dot is part of the macro call, but not the extension of "sas".&amp;nbsp; That makes it easier for the macro to specify both the log and the program.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 19:29:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281242#M56989</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-06-29T19:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Running multiple SAS programs from one program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281250#M56993</link>
      <description>&lt;P&gt;Thanks Everyone. I tried using proc&amp;nbsp;printto but it still writes the actual output in the original program log file. The log files for test2 and test3 has only the below information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2 The SAS System Wednesday, June 29, 2016 03:48:46 PM&lt;/P&gt;
&lt;P&gt;NOTE: PROCEDURE PRINTTO used (Total process time):&lt;/P&gt;
&lt;P&gt;real time 0.01 seconds&lt;/P&gt;
&lt;P&gt;cpu time 0.00 seconds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;　&lt;/P&gt;
&lt;P&gt;NOTE: PROCEDURE CONTENTS used (Total process time):&lt;/P&gt;
&lt;P&gt;real time 0.03 seconds&lt;/P&gt;
&lt;P&gt;cpu time 0.03 seconds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;45&lt;/P&gt;
&lt;P&gt;46 %run_one (T:\test2.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 19:52:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281250#M56993</guid>
      <dc:creator>KBACHU</dc:creator>
      <dc:date>2016-06-29T19:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Running multiple SAS programs from one program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281251#M56994</link>
      <description>&lt;P&gt;Yes, it absolutely does that.&amp;nbsp; If you want the output as well as the logs to be moved, you need to add to the macro:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro run_one (path);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; proc printto log="&amp;amp;path.log";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; proc printto print="&amp;amp;path.lst";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; %include "&amp;amp;path.sas";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;%mend run_one;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 19:56:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281251#M56994</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-06-29T19:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Running multiple SAS programs from one program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281268#M57002</link>
      <description>&lt;P&gt;I was wrong. It did work. Thanks everyone for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 20:40:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281268#M57002</guid>
      <dc:creator>KBACHU</dc:creator>
      <dc:date>2016-06-29T20:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Running multiple SAS programs from one program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281271#M57004</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22722"&gt;@KBACHU﻿&lt;/a&gt;&amp;nbsp;Please mark the question Solved.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 20:59:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-multiple-SAS-programs-from-one-program/m-p/281271#M57004</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-29T20:59:46Z</dc:date>
    </item>
  </channel>
</rss>

