<?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 variable is declared using %str function, but output is not fetching? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-is-declared-using-str-function-but-output-is-not/m-p/900078#M355727</link>
    <description>&lt;P&gt;The macro tokens like % complicate things a bit. %superq should help.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  call symput('pass','rAk%B25%');
run;
%put %%SUPERQ(pass);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n1oerrlvth1qy5n1bgeje94oloud.htm" target="_self"&gt;Deciding When to Use a Macro Quoting Function and Which Function to Use&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Oct 2023 04:36:09 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2023-10-26T04:36:09Z</dc:date>
    <item>
      <title>Macro variable is declared using %str function, but output is not fetching?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-is-declared-using-str-function-but-output-is-not/m-p/900072#M355723</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am try to declare a macro variable and print the macro variable in log window using the put statement, but output is not fetching. Can you help me.&lt;/P&gt;&lt;P&gt;Attaching the output image for reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;%let pass=%str(rAk%B25%);&lt;BR /&gt;%put &amp;amp;pass;&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;Result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="u63406443_0-1698293433438.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89099i0CF9920482B4AADE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="u63406443_0-1698293433438.png" alt="u63406443_0-1698293433438.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 04:12:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-is-declared-using-str-function-but-output-is-not/m-p/900072#M355723</guid>
      <dc:creator>u63406443</dc:creator>
      <dc:date>2023-10-26T04:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable is declared using %str function, but output is not fetching?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-is-declared-using-str-function-but-output-is-not/m-p/900073#M355724</link>
      <description>&lt;P&gt;Do you actually have the %B25 macro that you are trying to call?&amp;nbsp; What does it do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps you meant to use %NRSTR()?&amp;nbsp; if so double the % characters to mask them.&lt;/P&gt;
&lt;PRE&gt;1    %let pass=%nrstr(rAk%%B25%%);
2    %put &amp;amp;pass;
rAk%B25%
&lt;/PRE&gt;
&lt;P&gt;Your code it probably still looking for the closing ), right parenthesis, since you masked the one in the first line by prefixing it with a % character.&lt;/P&gt;
&lt;PRE&gt;1    %let pass=%str(rAk%B25%);
2    %put &amp;amp;pass;
3    );
WARNING: Apparent invocation of macro B25 not resolved.
ERROR: Open code statement recursion detected.
&lt;/PRE&gt;
&lt;P&gt;Add the closing ) to your %LET.&lt;/P&gt;
&lt;PRE&gt;1    %let pass=%str(rAk%B25%));
WARNING: Apparent invocation of macro B25 not resolved.
2    %put &amp;amp;pass;
WARNING: Apparent invocation of macro B25 not resolved.
rAk%B25)
&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Oct 2023 04:22:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-is-declared-using-str-function-but-output-is-not/m-p/900073#M355724</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-10-26T04:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable is declared using %str function, but output is not fetching?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-is-declared-using-str-function-but-output-is-not/m-p/900077#M355726</link>
      <description>&lt;P&gt;Thank you Tom.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 04:34:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-is-declared-using-str-function-but-output-is-not/m-p/900077#M355726</guid>
      <dc:creator>u63406443</dc:creator>
      <dc:date>2023-10-26T04:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable is declared using %str function, but output is not fetching?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-is-declared-using-str-function-but-output-is-not/m-p/900078#M355727</link>
      <description>&lt;P&gt;The macro tokens like % complicate things a bit. %superq should help.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  call symput('pass','rAk%B25%');
run;
%put %%SUPERQ(pass);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n1oerrlvth1qy5n1bgeje94oloud.htm" target="_self"&gt;Deciding When to Use a Macro Quoting Function and Which Function to Use&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 04:36:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-is-declared-using-str-function-but-output-is-not/m-p/900078#M355727</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-10-26T04:36:09Z</dc:date>
    </item>
  </channel>
</rss>

