<?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 in title in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-title/m-p/542637#M149938</link>
    <description>Your code has other issues, but I'll give you a chance to debug those first by yourself. If you have other issues, post a new question.</description>
    <pubDate>Wed, 13 Mar 2019 02:30:11 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-03-13T02:30:11Z</dc:date>
    <item>
      <title>macro variable in title</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-title/m-p/542634#M149935</link>
      <description>&lt;P&gt;Hi SAS Users,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS University Edition and I want to add the macro variable in the title.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input group $;
datalines;
groupa
groupb
;
run;



%macro print (group);

title '&amp;amp;group';
proc print data = a;
where group = &amp;amp;group;
run;

%mend print;

%print (group);
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;my output title is only showing "&lt;SPAN&gt;&amp;amp;group" instead of "groupa" which I want to be.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How should I correct the code?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 02:23:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-title/m-p/542634#M149935</guid>
      <dc:creator>superbibi</dc:creator>
      <dc:date>2019-03-13T02:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable in title</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-title/m-p/542636#M149937</link>
      <description>&lt;P&gt;Use double quotes instead of single quotes, macro variables do not resolve in single quotes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This allows a user to have a &amp;amp; or % in a string and SAS will not try to resolve it, otherwise it would think it's related to a macro or macro variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117839"&gt;@superbibi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi SAS Users,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using SAS University Edition and I want to add the macro variable in the title.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input group $;
datalines;
groupa
groupb
;
run;



%macro print (group);

title '&amp;amp;group';
proc print data = a;
where group = &amp;amp;group;
run;

%mend print;

%print (group);
 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;my output title is only showing "&lt;SPAN&gt;&amp;amp;group" instead of "groupa" which I want to be.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How should I correct the code?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 02:28:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-title/m-p/542636#M149937</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-03-13T02:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable in title</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-title/m-p/542637#M149938</link>
      <description>Your code has other issues, but I'll give you a chance to debug those first by yourself. If you have other issues, post a new question.</description>
      <pubDate>Wed, 13 Mar 2019 02:30:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-title/m-p/542637#M149938</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-03-13T02:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable in title</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-title/m-p/542784#M149999</link>
      <description>&lt;P&gt;Thank you so much! After changing as a double quote it works! I correct the other issues too. Sorry for the mistakes.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 13:39:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-in-title/m-p/542784#M149999</guid>
      <dc:creator>superbibi</dc:creator>
      <dc:date>2019-03-13T13:39:06Z</dc:date>
    </item>
  </channel>
</rss>

