<?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: Run multiple SAS programs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Run-multiple-SAS-programs/m-p/483548#M125399</link>
    <description>&lt;P&gt;here is log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MLOGIC(PRGRUN): Beginning execution.&lt;BR /&gt;MLOGIC(PRGRUN): %LET (variable name is DQCLIST)&lt;BR /&gt;SYMBOLGEN: Macro variable DQCLIST resolves to sd1044#sd1131#sd1121&lt;BR /&gt;MLOGIC(PRGRUN): %DO loop beginning; index variable I; start value is 1; stop value is 3; by value is 1.&lt;BR /&gt;MLOGIC(PRGRUN): %LET (variable name is DQC)&lt;BR /&gt;SYMBOLGEN: Macro variable DQCLIST resolves to sd1044#sd1131#sd1121&lt;BR /&gt;SYMBOLGEN: Macro variable I resolves to 1&lt;BR /&gt;MLOGIC(RUN_CHECK): Beginning execution.&lt;BR /&gt;SYMBOLGEN: Macro variable DQC resolves to sd1044&lt;BR /&gt;MLOGIC(RUN_CHECK): Parameter P21 has value /&lt;SPAN&gt;u1/stat/dqc/XXXX/prog/&lt;/SPAN&gt;sd1044.&lt;BR /&gt;SYMBOLGEN: Macro variable P21 resolves to /&lt;SPAN&gt;u1/stat/dqc/XXXX/prog&lt;/SPAN&gt;/sd1044.&lt;BR /&gt;MPRINT(RUN_CHECK): proc printto log="&lt;SPAN&gt;u1/stat/dqc/XXXX/prog/&lt;/SPAN&gt;sd1044.log";&lt;BR /&gt;MPRINT(RUN_CHECK): run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Aug 2018 19:29:27 GMT</pubDate>
    <dc:creator>petlove</dc:creator>
    <dc:date>2018-08-02T19:29:27Z</dc:date>
    <item>
      <title>Run multiple SAS programs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-multiple-SAS-programs/m-p/483536#M125390</link>
      <description>&lt;DIV class="lia-message-heading lia-component-message-header"&gt;&lt;DIV class="lia-quilt-row lia-quilt-row-standard"&gt;&lt;DIV class="lia-quilt-column lia-quilt-column-20 lia-quilt-column-left"&gt;&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-left"&gt;&lt;DIV class="lia-message-subject"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-body lia-tooltip-trigger"&gt;&lt;DIV class="lia-message-body-content"&gt;&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 %prgrun 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;Thank you.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 02 Aug 2018 19:07:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-multiple-SAS-programs/m-p/483536#M125390</guid>
      <dc:creator>petlove</dc:creator>
      <dc:date>2018-08-02T19:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Run multiple SAS programs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-multiple-SAS-programs/m-p/483546#M125397</link>
      <description>&lt;P&gt;run the code with OPTION MPRINT turned on and examine. Or post the log with the option on.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 19:23:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-multiple-SAS-programs/m-p/483546#M125397</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-02T19:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Run multiple SAS programs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-multiple-SAS-programs/m-p/483548#M125399</link>
      <description>&lt;P&gt;here is log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MLOGIC(PRGRUN): Beginning execution.&lt;BR /&gt;MLOGIC(PRGRUN): %LET (variable name is DQCLIST)&lt;BR /&gt;SYMBOLGEN: Macro variable DQCLIST resolves to sd1044#sd1131#sd1121&lt;BR /&gt;MLOGIC(PRGRUN): %DO loop beginning; index variable I; start value is 1; stop value is 3; by value is 1.&lt;BR /&gt;MLOGIC(PRGRUN): %LET (variable name is DQC)&lt;BR /&gt;SYMBOLGEN: Macro variable DQCLIST resolves to sd1044#sd1131#sd1121&lt;BR /&gt;SYMBOLGEN: Macro variable I resolves to 1&lt;BR /&gt;MLOGIC(RUN_CHECK): Beginning execution.&lt;BR /&gt;SYMBOLGEN: Macro variable DQC resolves to sd1044&lt;BR /&gt;MLOGIC(RUN_CHECK): Parameter P21 has value /&lt;SPAN&gt;u1/stat/dqc/XXXX/prog/&lt;/SPAN&gt;sd1044.&lt;BR /&gt;SYMBOLGEN: Macro variable P21 resolves to /&lt;SPAN&gt;u1/stat/dqc/XXXX/prog&lt;/SPAN&gt;/sd1044.&lt;BR /&gt;MPRINT(RUN_CHECK): proc printto log="&lt;SPAN&gt;u1/stat/dqc/XXXX/prog/&lt;/SPAN&gt;sd1044.log";&lt;BR /&gt;MPRINT(RUN_CHECK): run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 19:29:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-multiple-SAS-programs/m-p/483548#M125399</guid>
      <dc:creator>petlove</dc:creator>
      <dc:date>2018-08-02T19:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: Run multiple SAS programs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-multiple-SAS-programs/m-p/483585#M125414</link>
      <description>&lt;P&gt;Interesting that the log shows the results for assigning a value to a macro variable P21 when none of the code you showed indicates any macro parameter starting with &amp;amp;P.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am suspecting that possibly something in the include file is also using a macro variable &amp;amp;i or a %do I = loop (and the stupid forum is changing lower case&amp;nbsp;&amp;nbsp;i_ to uppercase I ) . Then when the loop there completes it has a value larger than the &amp;amp;i in the outer loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 20:36:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-multiple-SAS-programs/m-p/483585#M125414</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-02T20:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Run multiple SAS programs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-multiple-SAS-programs/m-p/483592#M125415</link>
      <description>&lt;P&gt;My goodness....I was going crazy on this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for helping me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, there is &amp;amp;i in other program and that is why it was not going into another loop. I changed it to "J" and now its working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are my Savior.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 20:55:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-multiple-SAS-programs/m-p/483592#M125415</guid>
      <dc:creator>petlove</dc:creator>
      <dc:date>2018-08-02T20:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Run multiple SAS programs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-multiple-SAS-programs/m-p/483620#M125430</link>
      <description>&lt;P&gt;Welcome to one of the joys of macro programming: Scope of variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Often declaring variables used strictly locally in a macro such as your loop counters can be remedied by using the %local definition before their use. Best is do that as one of the first lines of a macro:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro dummy(parameters);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; %local I j k ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; %do I = 1 %to 5;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;other code&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %someothermacro (&amp;amp;I, &amp;amp;otherparm);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 23:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-multiple-SAS-programs/m-p/483620#M125430</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-02T23:27:48Z</dc:date>
    </item>
  </channel>
</rss>

