<?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 Parameter not resolving in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867218#M342489</link>
    <description>&lt;P&gt;My bad, try this:&lt;/P&gt;
&lt;PRE&gt;%unquote(WORK.&amp;amp;out_sales_tbl._hdp)&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2023 10:06:51 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2023-03-30T10:06:51Z</dc:date>
    <item>
      <title>Macro Parameter not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867185#M342469</link>
      <description>&lt;P&gt;Looking for some help on this error. Code which I've is similar to below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%macro temp_data( 
    out_sales_tbl=     
) / minoperator;

data WORK.&amp;amp;out_sales_tbl._hdp ;
....
run;
%mend;&lt;/PRE&gt;
&lt;P&gt;and we are calling the above macro as below. Value for this macro variable (out_sales_tbl) will be resolved by other macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; %temp_data (
    out_sales_tbl=%quote(&amp;amp;out_sales_tbl)
     );&lt;/PRE&gt;
&lt;P&gt;Error which I got is,&lt;/P&gt;
&lt;PRE&gt;SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
SYMBOLGEN:  Macro variable OUT_SALES_TBL resolves to out_sales_table
SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
NOTE: Line generated by the macro variable "OUT_SALES_TBL".
211  WORK.out_sales_table_hdp
                         ----
                         22
                           ----
                           202&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Mar 2023 07:40:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867185#M342469</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2023-03-30T07:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Parameter not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867189#M342471</link>
      <description>&lt;P&gt;Do you&amp;nbsp; have logic in trhe macro that affects the value of said macro variable?&lt;/P&gt;
&lt;P&gt;Otherwise, why do you need to resolve it within the macro?&lt;/P&gt;
&lt;P&gt;I guess I need to see the full code to be able to give you an appropriate advice.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 08:07:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867189#M342471</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2023-03-30T08:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Parameter not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867199#M342478</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro temp_data( 
    out_sales_tbl=     
) / minoperator;

data WORK.%&lt;STRONG&gt;unquote&lt;/STRONG&gt;(&amp;amp;out_sales_tbl._hdp) ;
....
run;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Good macroquoting reading:&lt;/P&gt;
&lt;P&gt;"&lt;A href="https://stats.oarc.ucla.edu/wp-content/uploads/2016/02/bt185.pdf" target="_self"&gt;&lt;EM&gt;Secrets of Macro Quoting Functions – How and Why&lt;/EM&gt;&lt;/A&gt;" by Susan O’Connor&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 10:10:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867199#M342478</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-03-30T10:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Parameter not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867202#M342479</link>
      <description>&lt;P&gt;Why do you think you need a macro quoting function around a simple dataset name?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 09:14:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867202#M342479</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-30T09:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Parameter not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867215#M342486</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;still the same error&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 10:03:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867215#M342486</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2023-03-30T10:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Parameter not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867218#M342489</link>
      <description>&lt;P&gt;My bad, try this:&lt;/P&gt;
&lt;PRE&gt;%unquote(WORK.&amp;amp;out_sales_tbl._hdp)&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 10:06:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867218#M342489</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-03-30T10:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Parameter not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867220#M342491</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;still the same error&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please give us information that we can work from. Show us the &lt;FONT color="#FF0000"&gt;entire&lt;/FONT&gt; LOG for this code you are working with (not just the ERROR messages). Also please show us the entire CODE, including the part where the macro variable is assigned a value. Also, please answer &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;'s question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 10:52:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867220#M342491</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-03-30T10:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Parameter not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867247#M342503</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp; still the same error&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 13:36:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867247#M342503</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2023-03-30T13:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Parameter not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867248#M342504</link>
      <description>&lt;P&gt;Show the log.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 13:37:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867248#M342504</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-03-30T13:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Parameter not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867251#M342506</link>
      <description>&lt;P&gt;Can you show the log from running &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;'s original suggestion, I think it should work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But more importantly, please make a small example of this problem, and post the code and the log you get.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From what I can see in the log you've shared, you've got code like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let out_sales_tbl=out_sales_table ;

%macro temp_data(out_sales_tbl=);
  %put _local_ ;
  data WORK.&amp;amp;out_sales_tbl._hdp ;
  run;
%mend;

%temp_data(out_sales_tbl=%quote(&amp;amp;out_sales_tbl))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As others have pointed to the macro quoting is not needed. Also note the &amp;amp;out_sales_tbl is resolved during the call to temp_data.&amp;nbsp; If you want to delay that, you would need to use %nrstr().&amp;nbsp; The quoting characters introduced by %quote() cause problems for the compiler, but&amp;nbsp;@yabwon's %unquote suggestion resolves them for my test:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let out_sales_tbl=out_sales_table ;

%macro temp_data(out_sales_tbl=);
  %put _local_ ;
  data WORK.%unquote(&amp;amp;out_sales_tbl._hdp) ;
  run;
%mend;

%temp_data(out_sales_tbl=%quote(&amp;amp;out_sales_tbl))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Mar 2023 14:00:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867251#M342506</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-03-30T14:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Parameter not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867262#M342511</link>
      <description>&lt;P&gt;The simple solution is to fix the CALL to the macro.&lt;/P&gt;
&lt;P&gt;A valid dataset name cannot contain any character that needs macro quoting so don't quote it.&lt;/P&gt;
&lt;P&gt;Plus you are just confusing yourself by calling the macro with the value of a macro variable that has the same name as the macro variable used as the parameter name.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let some_other_mvar = table_name;
%temp_data(out_sales_tbl=&amp;amp;some_other_mvar);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Mar 2023 14:40:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Parameter-not-resolving/m-p/867262#M342511</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-03-30T14:40:13Z</dc:date>
    </item>
  </channel>
</rss>

