<?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: how to pass a parameter with macro variables into macro in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/how-to-pass-a-parameter-with-macro-variables-into-macro/m-p/330632#M62629</link>
    <description>&lt;P&gt;yes, I want to know how to pass them into the Macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your replying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Feb 2017 22:01:20 GMT</pubDate>
    <dc:creator>ttxq</dc:creator>
    <dc:date>2017-02-07T22:01:20Z</dc:date>
    <item>
      <title>how to pass a parameter with macro variables into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-pass-a-parameter-with-macro-variables-into-macro/m-p/330627#M62627</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I got a problem. I want to create a sas macro and the parameters are also macro variables, so how can I pass these macro variables into macro?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;%let a=c1,c2,c3,c4,c5;&lt;/P&gt;&lt;P&gt;%let b=d1,d2,d3,d4,d5;&lt;/P&gt;&lt;P&gt;%macro input(data1,data2);&lt;/P&gt;&lt;P&gt;&amp;nbsp; ... &amp;amp;data1;(I want to use a here)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ... &amp;amp;data2;(I want to use b here)&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%input(?,?); (what should I fill in here)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2017 21:48:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-pass-a-parameter-with-macro-variables-into-macro/m-p/330627#M62627</guid>
      <dc:creator>ttxq</dc:creator>
      <dc:date>2017-02-07T21:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a parameter with macro variables into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-pass-a-parameter-with-macro-variables-into-macro/m-p/330630#M62628</link>
      <description>&lt;P&gt;Do you need to pass them in? They exist and you can use them in the macro as shown.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2017 21:58:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-pass-a-parameter-with-macro-variables-into-macro/m-p/330630#M62628</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-07T21:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a parameter with macro variables into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-pass-a-parameter-with-macro-variables-into-macro/m-p/330632#M62629</link>
      <description>&lt;P&gt;yes, I want to know how to pass them into the Macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your replying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2017 22:01:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-pass-a-parameter-with-macro-variables-into-macro/m-p/330632#M62629</guid>
      <dc:creator>ttxq</dc:creator>
      <dc:date>2017-02-07T22:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a parameter with macro variables into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-pass-a-parameter-with-macro-variables-into-macro/m-p/330637#M62631</link>
      <description>&lt;P&gt;Ok, add two&amp;nbsp;extra parameters to your macro and then pass the two variable lists.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'll need to mask the commas or use a different separator. I think using a different separator is easier but if you want comma's for some reason, you can mask them using the techniques here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/31/012.html" target="_blank"&gt;http://support.sas.com/kb/31/012.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2017 22:09:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-pass-a-parameter-with-macro-variables-into-macro/m-p/330637#M62631</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-07T22:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a parameter with macro variables into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-pass-a-parameter-with-macro-variables-into-macro/m-p/330645#M62632</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/121267"&gt;@ttxq&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;yes, I want to know how to pass them into the Macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your replying.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Pass the names not the value.&amp;nbsp; Then you don't have to worry about quoting in the macro call.&amp;nbsp; Also you can't name a macro %INPUT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;26         %let a=c1,c2,c3,c4,c5;
27         %let b=d1,d2,d3,d4,d5;
28         %macro xinput(data1,data2);
29            %put NOTE: &amp;amp;&amp;amp;&amp;amp;data1 &amp;amp;&amp;amp;&amp;amp;data2;
30            %mend;
31         %xinput(a,b);
NOTE: c1,c2,c3,c4,c5 d1,d2,d3,d4,d5&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Feb 2017 22:43:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-pass-a-parameter-with-macro-variables-into-macro/m-p/330645#M62632</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2017-02-07T22:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a parameter with macro variables into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-pass-a-parameter-with-macro-variables-into-macro/m-p/330665#M62633</link>
      <description>&lt;P&gt;Placing commas inside a variable is often a poor idea. If you intend to use it as a macro parameter it will fail because the macro variable resolves with the commas and then each value after a comma is treated as a another parameter. Generally this results in the number of parameters passed not matching the macro definition.&lt;/P&gt;
&lt;P&gt;%let a=c1,c2,c3,c4,c5;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What kind of macro are you building that requires the commas?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And this may help&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let a = c1 c2 c3 c4;
%let ab = %sysfunc(translate(&amp;amp;a,',',' '));

%put &amp;amp;ab;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;if you place exactly one space between elements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or learn to use the macro quoting functions.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2017 23:53:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-pass-a-parameter-with-macro-variables-into-macro/m-p/330665#M62633</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-02-07T23:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a parameter with macro variables into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-pass-a-parameter-with-macro-variables-into-macro/m-p/330846#M62646</link>
      <description>It works. Thank you so much.</description>
      <pubDate>Wed, 08 Feb 2017 14:15:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-pass-a-parameter-with-macro-variables-into-macro/m-p/330846#M62646</guid>
      <dc:creator>ttxq</dc:creator>
      <dc:date>2017-02-08T14:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a parameter with macro variables into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-pass-a-parameter-with-macro-variables-into-macro/m-p/330847#M62647</link>
      <description>I create the macro that is used in proc sql select statement. so I need the comma. I'll try your method. Thank you for replying.</description>
      <pubDate>Wed, 08 Feb 2017 14:17:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-pass-a-parameter-with-macro-variables-into-macro/m-p/330847#M62647</guid>
      <dc:creator>ttxq</dc:creator>
      <dc:date>2017-02-08T14:17:15Z</dc:date>
    </item>
  </channel>
</rss>

