<?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 to run multiple programs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482906#M125158</link>
    <description>&lt;P&gt;Without mentioning&amp;nbsp;&lt;SPAN&gt;full folder path&amp;nbsp;also program runs successfully. Since location of my program sd0036.sas and macro %run_check is&amp;nbsp; same on Unix.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If macro is in different location then only I will need to specify the full path in %include.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I did run program without full path and it ran successfully and created .log and .lst file for sd0036.sas.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Jul 2018 18:29:56 GMT</pubDate>
    <dc:creator>petlove</dc:creator>
    <dc:date>2018-07-31T18:29:56Z</dc:date>
    <item>
      <title>%include to run multiple programs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482884#M125146</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to run many SAS programs by using below macro.&amp;nbsp;I have not defined path of program since they are present in same folder where I am running macro:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro run_check(prg);&lt;/P&gt;&lt;P&gt;proc printto log="&amp;amp;prg.log";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc printto print="&amp;amp;prg.lst";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%include "&amp;amp;prg.sas";&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;options symbolgen merror mlogic;&lt;BR /&gt;%run_check(SD0036.);&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;But it shows below ERROR in log file of SD0036.sas:&lt;/P&gt;&lt;P&gt;WARNING: Physical file does not exist, XXXXXXX/SD0036.sas.&lt;BR /&gt;ERROR: Cannot open %INCLUDE file SD0036.sas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure why 'Dot' comes after 'SD0036.sas' name in log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me now how to fix this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 17:24:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482884#M125146</guid>
      <dc:creator>petlove</dc:creator>
      <dc:date>2018-07-31T17:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: %include to run multiple programs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482886#M125148</link>
      <description>&lt;P&gt;You need to specify in the %include what folder your program is stored in. For example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%include "G:\team1\project2\mysasprogram.sas";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Jul 2018 17:28:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482886#M125148</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-31T17:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: %include to run multiple programs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482887#M125149</link>
      <description>&lt;P&gt;The dot is simple punctuation, properly formed sentences end with a dot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does SAS really print XXXXXX as the path or did you hide it yourself?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you sure the "working path" is really where you expect it to be?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 17:29:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482887#M125149</guid>
      <dc:creator>ybolduc</dc:creator>
      <dc:date>2018-07-31T17:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: %include to run multiple programs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482889#M125151</link>
      <description>&lt;P&gt;Remember to specify the full path along with the .sas filename&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 17:32:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482889#M125151</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-07-31T17:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: %include to run multiple programs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482901#M125154</link>
      <description>&lt;P&gt;My bad. My program name is "sd0036.sas', I was writing 'SD0036.sas'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for any inconvenience.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 18:06:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482901#M125154</guid>
      <dc:creator>petlove</dc:creator>
      <dc:date>2018-07-31T18:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: %include to run multiple programs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482902#M125155</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/135083"&gt;@petlove&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;My bad. My program name is "sd0036.sas', I was writing 'SD0036.sas'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry for any inconvenience.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It sounds like you have mis-understood the entire set of comments. The capitalization of your program name is not the problem. The problem is that you need to put the full folder path and file name in your %INCLUDE.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 18:08:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482902#M125155</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-31T18:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: %include to run multiple programs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482906#M125158</link>
      <description>&lt;P&gt;Without mentioning&amp;nbsp;&lt;SPAN&gt;full folder path&amp;nbsp;also program runs successfully. Since location of my program sd0036.sas and macro %run_check is&amp;nbsp; same on Unix.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If macro is in different location then only I will need to specify the full path in %include.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I did run program without full path and it ran successfully and created .log and .lst file for sd0036.sas.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 18:29:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482906#M125158</guid>
      <dc:creator>petlove</dc:creator>
      <dc:date>2018-07-31T18:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: %include to run multiple programs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482936#M125167</link>
      <description>&lt;P&gt;The SAS documentation actually includes an example with relative path (see Example 1): &lt;A href="http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsglobal&amp;amp;docsetTarget=p1s3uhhqtscz2sn1otiatbovfn1t.htm&amp;amp;locale=fr#n00bihrpksgveyn1i4sccqyilq74" target="_blank"&gt;http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsglobal&amp;amp;docsetTarget=p1s3uhhqtscz2sn1otiatbovfn1t.htm&amp;amp;locale=fr#n00bihrpksgveyn1i4sccqyilq74&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But be careful when using relative path, they are normally relative to the working path which is not necessarily the same as the path where the current program is stored. So in some context, relative paths can lead to unexpected behaviors.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 20:21:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482936#M125167</guid>
      <dc:creator>ybolduc</dc:creator>
      <dc:date>2018-07-31T20:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: %include to run multiple programs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482994#M125195</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/135083"&gt;@petlove&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I did run program without full path and it ran successfully and created .log and .lst file for sd0036.sas.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;See this as an example of "works by accident". ALWAYS use absolute path names when working on UNIX.&lt;/P&gt;
&lt;PRE&gt;cd /sas/programs
sas myprog.sas&lt;/PRE&gt;
&lt;P&gt;will run with a current working directory of /sas/programs, while&lt;/P&gt;
&lt;PRE&gt;cd
sas /sas/programs/myprog.sas&lt;/PRE&gt;
&lt;P&gt;will run with your home directory as CWD. Relative path names are always resolved from the CWD, so you will get different results.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 06:25:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/482994#M125195</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-01T06:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: %include to run multiple programs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/483522#M125383</link>
      <description>&lt;P&gt;HI all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to run multiple programs without calling %run_check for each dataset manually. I have create another macro with do loop.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro run_check(dsn);&lt;/P&gt;&lt;P&gt;proc printto log="&amp;amp;dsn.log";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc printto print="&amp;amp;dsn.lst";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%include "&amp;amp;dsn.sas";&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro prgrun;&lt;BR /&gt;%let dqclist=sd1044#sd1131#sd1121;&lt;/P&gt;&lt;P&gt;%do i= 1 %to %eval(%sysfunc(count(&amp;amp;dqclist,#))+1);&lt;BR /&gt;%let dqc=%scan(&amp;amp;dqclist,&amp;amp;i,#);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%run_check(/u1/stat/dqc/XXXX/prog/&amp;amp;dqc..);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%end;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;options symbolgen mlogic merror serror;&lt;BR /&gt;%prgrun;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was expecting to run all 3 programs&amp;nbsp;&lt;SPAN&gt;sd1044, sd1131 and sd1121. However, I see that only first program in the loop runs i.e. sd1044.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you please take look at it? Not sure why other 2 programs don't run?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 18:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-to-run-multiple-programs/m-p/483522#M125383</guid>
      <dc:creator>petlove</dc:creator>
      <dc:date>2018-08-02T18:42:43Z</dc:date>
    </item>
  </channel>
</rss>

