<?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: define a macro parameter that can get a list of values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/define-a-macro-parameter-that-can-get-a-list-of-values/m-p/804277#M316710</link>
    <description>&lt;P&gt;MAy you please show the full code? I would like to test it via sas&lt;/P&gt;</description>
    <pubDate>Sat, 26 Mar 2022 16:29:33 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2022-03-26T16:29:33Z</dc:date>
    <item>
      <title>define a macro parameter that can get a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/define-a-macro-parameter-that-can-get-a-list-of-values/m-p/804272#M316706</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;What is the way to&amp;nbsp;define a macro parameter that can get a list of values?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%macro RRR(nr_Cylinders);
Data wanted;
Set SASHELP.CARS;
Where Cylinders in (&amp;amp;nr_Cylinders.);
Run;
%mend;
%RRR(4)
%RRR(4,5)    /**Here get an error. Question: How to define a macro parameter that can get a list of values???***/

 &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 26 Mar 2022 16:14:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/define-a-macro-parameter-that-can-get-a-list-of-values/m-p/804272#M316706</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-03-26T16:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: define a macro parameter that can get a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/define-a-macro-parameter-that-can-get-a-list-of-values/m-p/804273#M316707</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A macro doesn't accet the IN-operator unless it is specified with the macro definition:&lt;/P&gt;
&lt;PRE class="xisDoc-code"&gt;&lt;CODE&gt;%macro macroname(parm) / minoperator;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Mar 2022 16:17:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/define-a-macro-parameter-that-can-get-a-list-of-values/m-p/804273#M316707</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2022-03-26T16:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: define a macro parameter that can get a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/define-a-macro-parameter-that-can-get-a-list-of-values/m-p/804274#M316708</link>
      <description>But IF there is one element then the IN is working(%RRR(4)  is working well)</description>
      <pubDate>Sat, 26 Mar 2022 16:20:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/define-a-macro-parameter-that-can-get-a-list-of-values/m-p/804274#M316708</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-03-26T16:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: define a macro parameter that can get a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/define-a-macro-parameter-that-can-get-a-list-of-values/m-p/804276#M316709</link>
      <description>&lt;P&gt;What happens when you call the macro like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%RRR(4 5)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 26 Mar 2022 16:27:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/define-a-macro-parameter-that-can-get-a-list-of-values/m-p/804276#M316709</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-26T16:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: define a macro parameter that can get a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/define-a-macro-parameter-that-can-get-a-list-of-values/m-p/804277#M316710</link>
      <description>&lt;P&gt;MAy you please show the full code? I would like to test it via sas&lt;/P&gt;</description>
      <pubDate>Sat, 26 Mar 2022 16:29:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/define-a-macro-parameter-that-can-get-a-list-of-values/m-p/804277#M316710</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-03-26T16:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: define a macro parameter that can get a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/define-a-macro-parameter-that-can-get-a-list-of-values/m-p/804286#M316714</link>
      <description>&lt;P&gt;Just don't add the comma.&amp;nbsp; The comma tells the macro language you are passing values for two parameters.&lt;/P&gt;
&lt;P&gt;The IN operator does not care whether you use spaces or commas between the values.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Mar 2022 18:17:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/define-a-macro-parameter-that-can-get-a-list-of-values/m-p/804286#M316714</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-03-26T18:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: define a macro parameter that can get a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/define-a-macro-parameter-that-can-get-a-list-of-values/m-p/804334#M316732</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry, you are right. As you are not using the IN operator in macro code, but in a data step inside the macro, the options is unnecessary, though is does no harm.&lt;/P&gt;
&lt;P&gt;A single parameter with two elements can be passed to the macro by separating the values with a blank, while a comma is used to separate two different parameters to the macro. It is also possible to quote a parameter, so it can contain a comma, so all these are valid:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro RRR(nr_Cylinders);
  Data wanted;
    Set SASHELP.CARS;
    Where Cylinders in (&amp;amp;nr_Cylinders.);
  Run;
%mend;
%RRR(4);
%RRR(4 5);
%RRR(%quote(4,5));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 27 Mar 2022 07:29:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/define-a-macro-parameter-that-can-get-a-list-of-values/m-p/804334#M316732</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2022-03-27T07:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: define a macro parameter that can get a list of values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/define-a-macro-parameter-that-can-get-a-list-of-values/m-p/804431#M316782</link>
      <description>&lt;P&gt;With comma it works well&lt;/P&gt;</description>
      <pubDate>Sun, 27 Mar 2022 19:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/define-a-macro-parameter-that-can-get-a-list-of-values/m-p/804431#M316782</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-03-27T19:48:11Z</dc:date>
    </item>
  </channel>
</rss>

