<?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: Creating a Macro that populates a set within PROC SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-Macro-that-populates-a-set-within-PROC-SQL/m-p/293252#M60978</link>
    <description>&lt;P&gt;Awesome, Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 22 Aug 2016 20:16:07 GMT</pubDate>
    <dc:creator>Jeremy_Wade</dc:creator>
    <dc:date>2016-08-22T20:16:07Z</dc:date>
    <item>
      <title>Creating a Macro that populates a set within PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-Macro-that-populates-a-set-within-PROC-SQL/m-p/293184#M60946</link>
      <description>&lt;P&gt;Is it possible to replace this statement within PROC SQL:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;case when&amp;nbsp;variable in ('1', '2', '3', '4') then ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with a macro of the form&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;case when variable&amp;nbsp;in (%macroname(4)) then ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the macro would populate the set with the positive integers (in character form) 1 through 4 (or any positive number in place of 4).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, and sorry if this has been asked&amp;nbsp;before.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2016 16:21:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-Macro-that-populates-a-set-within-PROC-SQL/m-p/293184#M60946</guid>
      <dc:creator>Jeremy_Wade</dc:creator>
      <dc:date>2016-08-22T16:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Macro that populates a set within PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-Macro-that-populates-a-set-within-PROC-SQL/m-p/293196#M60955</link>
      <description>&lt;P&gt;While it is very possible in any case, it is easier if you are willing to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Use double quotes instead of single quotes&lt;/LI&gt;
&lt;LI&gt;Skip the commas entirely (the WHERE clause should work either way)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is one possible approach using the simplifying assumptions above:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro macroname (limit);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%local i;&lt;/P&gt;
&lt;P&gt;%do i=1 %to &amp;amp;limit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; "&amp;amp;i"&lt;/P&gt;
&lt;P&gt;%end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%mend macroname;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2016 17:16:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-Macro-that-populates-a-set-within-PROC-SQL/m-p/293196#M60955</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-08-22T17:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Macro that populates a set within PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-Macro-that-populates-a-set-within-PROC-SQL/m-p/293252#M60978</link>
      <description>&lt;P&gt;Awesome, Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2016 20:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-Macro-that-populates-a-set-within-PROC-SQL/m-p/293252#M60978</guid>
      <dc:creator>Jeremy_Wade</dc:creator>
      <dc:date>2016-08-22T20:16:07Z</dc:date>
    </item>
  </channel>
</rss>

