<?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: Specifying Series in Macro Do Loop in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Specifying-Series-in-Macro-Do-Loop/m-p/666122#M199252</link>
    <description>&lt;P&gt;&lt;BR /&gt;The Macro Appendix has examples of common macro usage, including one with a macro loop.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jun 2020 15:30:36 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-06-30T15:30:36Z</dc:date>
    <item>
      <title>Specifying Series in Macro Do Loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Specifying-Series-in-Macro-Do-Loop/m-p/666005#M199215</link>
      <description>&lt;P&gt;Hi SAS Experts, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just have a question on specifying series for do loops. Instead of the usual %do n=1 %to..., I would like to specify a series such that it will activate a certain set of numbers (in this case 1, 7,8,10...). But it does not work. Any ways out? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;David&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let n_MSA=48;

%macro combineMSA(MSA);
%do n=1,7,8,10,11,17,19,23,27,28,29,35,36,38,40,44,46;

data data.diction_MSA&amp;amp;n.; set data.diction;
if MSA ne &amp;amp;n. then delete;
run;

%end;
%mend;
%combineMSA;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jun 2020 07:50:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Specifying-Series-in-Macro-Do-Loop/m-p/666005#M199215</guid>
      <dc:creator>DavidLie</dc:creator>
      <dc:date>2020-06-30T07:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying Series in Macro Do Loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Specifying-Series-in-Macro-Do-Loop/m-p/666009#M199216</link>
      <description>&lt;P&gt;Do this in your macro:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%local list i n;
%let list=1 7 8 10 11 17 19 23 27 28 29 35 36 38 40 44 46;
%do i = 1 %to %sysfunc(countw(&amp;amp;list.));
  %let n = %scan(&amp;amp;list.,&amp;amp;i.);
  /* your loop body */
%end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jun 2020 08:17:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Specifying-Series-in-Macro-Do-Loop/m-p/666009#M199216</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-06-30T08:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying Series in Macro Do Loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Specifying-Series-in-Macro-Do-Loop/m-p/666010#M199217</link>
      <description>&lt;P&gt;Please try the call execute alternate to macro do loop&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
do n=1,7,8,10,11,17,19,23,27,28,29,35,36,38,40,44,46;
output;
end;
run;


data _null_;
call execute("data data.diction_MSA"||strip(put(n,best.))||"; set data.diction;if MSA ne "||strip(put(n,best.))||" then delete;run;");
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jun 2020 08:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Specifying-Series-in-Macro-Do-Loop/m-p/666010#M199217</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-06-30T08:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying Series in Macro Do Loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Specifying-Series-in-Macro-Do-Loop/m-p/666122#M199252</link>
      <description>&lt;P&gt;&lt;BR /&gt;The Macro Appendix has examples of common macro usage, including one with a macro loop.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 15:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Specifying-Series-in-Macro-Do-Loop/m-p/666122#M199252</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-06-30T15:30:36Z</dc:date>
    </item>
  </channel>
</rss>

