<?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 macro variable resolve in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-resolve/m-p/805654#M317374</link>
    <description>&lt;P&gt;&lt;STRONG&gt;dear all:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I want to put the macro variable just it seems like without resoving % or &amp;amp;.&lt;BR /&gt;here's the code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
length a $255.;
input a $;
datalines;
xx&amp;amp;xx
yy%yy
;
run;

proc sql;
select a into:a_list separated by " " from test;
quit;

%put &amp;amp;a_list.;

data _null_;
file "c:\test.txt";
put "&amp;amp;a_list.";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;when &lt;STRONG&gt;%put &amp;amp;a_list.;&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#0000FF"&gt;xx&amp;amp;xx&amp;nbsp;yy%yy&amp;nbsp;is&amp;nbsp;expected&lt;/FONT&gt;;&lt;/P&gt;
&lt;P&gt;when &lt;STRONG&gt;put "&amp;amp;a_list."; in data step&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#0000FF"&gt;xx&amp;amp;xx&amp;nbsp;yy%yy&amp;nbsp; is&amp;nbsp;expected in the txt file;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but，there's&amp;nbsp;always&amp;nbsp;two&amp;nbsp;warnings &amp;nbsp;:&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;WARNING: Apparent symbolic reference XX not resolved.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;WARNING: Apparent invocation of macro YY not resolved.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What should i do to make it without warnings?&lt;/P&gt;
&lt;P&gt;Thanks in advance !&lt;/P&gt;</description>
    <pubDate>Sun, 03 Apr 2022 00:55:00 GMT</pubDate>
    <dc:creator>duanzongran</dc:creator>
    <dc:date>2022-04-03T00:55:00Z</dc:date>
    <item>
      <title>macro variable resolve</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-resolve/m-p/805654#M317374</link>
      <description>&lt;P&gt;&lt;STRONG&gt;dear all:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I want to put the macro variable just it seems like without resoving % or &amp;amp;.&lt;BR /&gt;here's the code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
length a $255.;
input a $;
datalines;
xx&amp;amp;xx
yy%yy
;
run;

proc sql;
select a into:a_list separated by " " from test;
quit;

%put &amp;amp;a_list.;

data _null_;
file "c:\test.txt";
put "&amp;amp;a_list.";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;when &lt;STRONG&gt;%put &amp;amp;a_list.;&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#0000FF"&gt;xx&amp;amp;xx&amp;nbsp;yy%yy&amp;nbsp;is&amp;nbsp;expected&lt;/FONT&gt;;&lt;/P&gt;
&lt;P&gt;when &lt;STRONG&gt;put "&amp;amp;a_list."; in data step&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#0000FF"&gt;xx&amp;amp;xx&amp;nbsp;yy%yy&amp;nbsp; is&amp;nbsp;expected in the txt file;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but，there's&amp;nbsp;always&amp;nbsp;two&amp;nbsp;warnings &amp;nbsp;:&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;WARNING: Apparent symbolic reference XX not resolved.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;WARNING: Apparent invocation of macro YY not resolved.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What should i do to make it without warnings?&lt;/P&gt;
&lt;P&gt;Thanks in advance !&lt;/P&gt;</description>
      <pubDate>Sun, 03 Apr 2022 00:55:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-resolve/m-p/805654#M317374</guid>
      <dc:creator>duanzongran</dc:creator>
      <dc:date>2022-04-03T00:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable resolve</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-resolve/m-p/805684#M317379</link>
      <description>&lt;P&gt;Below how you can write to value of the macro variable to an output destination (print and log in below sample code).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  length a $255.;
  input a $;
  datalines;
xx&amp;amp;xx
yy%yy
;

proc sql noprint;
  select a into:a_list separated by " " 
  from test;
quit;

data _null_;
  file print;
  m_value=symget("a_list");
  put m_value;
  putlog m_value;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 Apr 2022 07:08:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-resolve/m-p/805684#M317379</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-04-03T07:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable resolve</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-resolve/m-p/805688#M317382</link>
      <description>&lt;P&gt;%SUPERQ() is a good way to add macro quoting to a macro variable's value.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put The value of A_LIST is %superq(a_list).;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 Apr 2022 08:31:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-resolve/m-p/805688#M317382</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-04-03T08:31:51Z</dc:date>
    </item>
  </channel>
</rss>

