<?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: Macro paramter parsing from another string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-paramter-parsing-from-another-string/m-p/806017#M317525</link>
    <description>&lt;P&gt;Use Sysfunc instead of Qsysfunc&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro mmm(p_aram,p_aram2);
%put &amp;gt;&amp;gt;&amp;gt; &amp;amp;p_aram.;
%put &amp;gt;&amp;gt;&amp;gt; &amp;amp;p_aram2.;
%mend;

%let x="x,y";
%let x = %sysfunc(compress(&amp;amp;x,%str(%")));
%put &amp;amp;x.;
%mmm(%str(&amp;amp;x.));&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 05 Apr 2022 10:31:59 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2022-04-05T10:31:59Z</dc:date>
    <item>
      <title>Macro paramter parsing from another string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-paramter-parsing-from-another-string/m-p/806015#M317524</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For some reason the first parameter reads the whole string is not separated by a comma.&amp;nbsp;How can I solve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%macro mmm(p_aram,p_aram2);
%put &amp;gt;&amp;gt;&amp;gt; &amp;amp;p_aram.;
%put &amp;gt;&amp;gt;&amp;gt; &amp;amp;p_aram2.;
%mend;

%let x="x,y";
%let x = %qsysfunc(compress(&amp;amp;x,%str(%")));
%put &amp;amp;x.;
%mmm(%str(&amp;amp;x.));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I want p_aram = x p_aram2 = y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 10:16:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-paramter-parsing-from-another-string/m-p/806015#M317524</guid>
      <dc:creator>ger15xxhcker</dc:creator>
      <dc:date>2022-04-05T10:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Macro paramter parsing from another string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-paramter-parsing-from-another-string/m-p/806017#M317525</link>
      <description>&lt;P&gt;Use Sysfunc instead of Qsysfunc&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro mmm(p_aram,p_aram2);
%put &amp;gt;&amp;gt;&amp;gt; &amp;amp;p_aram.;
%put &amp;gt;&amp;gt;&amp;gt; &amp;amp;p_aram2.;
%mend;

%let x="x,y";
%let x = %sysfunc(compress(&amp;amp;x,%str(%")));
%put &amp;amp;x.;
%mmm(%str(&amp;amp;x.));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Apr 2022 10:31:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-paramter-parsing-from-another-string/m-p/806017#M317525</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-04-05T10:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Macro paramter parsing from another string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-paramter-parsing-from-another-string/m-p/806019#M317526</link>
      <description>Thanks for your help</description>
      <pubDate>Tue, 05 Apr 2022 10:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-paramter-parsing-from-another-string/m-p/806019#M317526</guid>
      <dc:creator>ger15xxhcker</dc:creator>
      <dc:date>2022-04-05T10:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Macro paramter parsing from another string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-paramter-parsing-from-another-string/m-p/806020#M317527</link>
      <description>&lt;P&gt;Anytime &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 10:40:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-paramter-parsing-from-another-string/m-p/806020#M317527</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-04-05T10:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Macro paramter parsing from another string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-paramter-parsing-from-another-string/m-p/806060#M317546</link>
      <description>&lt;P&gt;Sounds like the issue is you are macro quoting the value, so the comma is "protected".&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let x="x,y";
%mmm(%sysfunc(dequote(&amp;amp;x)));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is there some reason why you thought you needed to add macro quoting?&lt;/P&gt;
&lt;P&gt;In that case use %QSCAN() to pick off the first and second values.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let x="x,y";
%let x=%qsysfunc(dequote(&amp;amp;x));
%mmm(%qscan(&amp;amp;x,1,%str(,)) , %qscan(&amp;amp;x,2,%str(,));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Apr 2022 14:02:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-paramter-parsing-from-another-string/m-p/806060#M317546</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-04-05T14:02:10Z</dc:date>
    </item>
  </channel>
</rss>

