<?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: Leave space(eq Don't compress) after replacement(tranwrd and %sysfunc) in MACRO in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Leave-space-eq-Don-t-compress-after-replacement-tranwrd-and/m-p/354794#M83042</link>
    <description>&lt;P&gt;Build the string in a data _null_ step and use call symput. In a data step&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;tranwrd("&amp;amp;pow","t","Table ")&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;should work.&lt;/P&gt;</description>
    <pubDate>Sun, 30 Apr 2017 09:35:16 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-04-30T09:35:16Z</dc:date>
    <item>
      <title>Leave space(eq Don't compress) after replacement(tranwrd and %sysfunc) in MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leave-space-eq-Don-t-compress-after-replacement-tranwrd-and/m-p/354793#M83041</link>
      <description>&lt;P&gt;Hi,all&lt;/P&gt;&lt;P&gt;I want change macro variable's value "t-1-1" to "Table 1-1",say,"Table" + space + "1-1"&lt;BR /&gt;So I try #1&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let pow=t-1-1;
%let x = %sysfunc(tranwrd(&amp;amp;pow,t,Table ));
%put x=&amp;amp;x;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The %put statement returns "x=Table-1-1"&lt;BR /&gt;but I want "x=Table -1-1",which containing space.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Other way I tried is&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let x2 = %sysfunc(tranwrd(&amp;amp;pow,t,%quote(Table ));&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but this resulted in ERROR and can't make macro variable.&lt;/P&gt;&lt;P&gt;Please help me! &amp;nbsp;XD&lt;/P&gt;&lt;P&gt;Sincerely.&lt;/P&gt;</description>
      <pubDate>Sun, 30 Apr 2017 08:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leave-space-eq-Don-t-compress-after-replacement-tranwrd-and/m-p/354793#M83041</guid>
      <dc:creator>t_ar_taat</dc:creator>
      <dc:date>2017-04-30T08:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Leave space(eq Don't compress) after replacement(tranwrd and %sysfunc) in MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leave-space-eq-Don-t-compress-after-replacement-tranwrd-and/m-p/354794#M83042</link>
      <description>&lt;P&gt;Build the string in a data _null_ step and use call symput. In a data step&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;tranwrd("&amp;amp;pow","t","Table ")&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;should work.&lt;/P&gt;</description>
      <pubDate>Sun, 30 Apr 2017 09:35:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leave-space-eq-Don-t-compress-after-replacement-tranwrd-and/m-p/354794#M83042</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-04-30T09:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: Leave space(eq Don't compress) after replacement(tranwrd and %sysfunc) in MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leave-space-eq-Don-t-compress-after-replacement-tranwrd-and/m-p/354798#M83046</link>
      <description>&lt;P&gt;Your second one does work--&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let x2 = %sysfunc(tranwrd(&amp;amp;pow,t,%quote(Table )));/*add another closing parenthesis*/&lt;/P&gt;&lt;P&gt;%put x=&amp;amp;x2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will not recommend using macro execution functions such as quote or bquote and its NR mate in quoting constant text, I'd rather use %str as it is powerful to quote at the time of macro compilation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let x2 = %sysfunc(tranwrd(&amp;amp;pow,t,%str(Table )));&lt;BR /&gt;%put x=&amp;amp;x2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naveen Srinivasan&lt;/P&gt;</description>
      <pubDate>Sun, 30 Apr 2017 09:57:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leave-space-eq-Don-t-compress-after-replacement-tranwrd-and/m-p/354798#M83046</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-04-30T09:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Leave space(eq Don't compress) after replacement(tranwrd and %sysfunc) in MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leave-space-eq-Don-t-compress-after-replacement-tranwrd-and/m-p/354801#M83047</link>
      <description>&lt;P&gt;Thank you so much,%str did work well&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8636iA9EDF040D5AF7599/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="per_str.png" title="per_str.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Apr 2017 10:30:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leave-space-eq-Don-t-compress-after-replacement-tranwrd-and/m-p/354801#M83047</guid>
      <dc:creator>t_ar_taat</dc:creator>
      <dc:date>2017-04-30T10:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Leave space(eq Don't compress) after replacement(tranwrd and %sysfunc) in MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leave-space-eq-Don-t-compress-after-replacement-tranwrd-and/m-p/354802#M83048</link>
      <description>&lt;P&gt;Thank you so much Kurt,your knowledge work so nice.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let pow=t-1-1;
data _null_;
 call symput("x",tranwrd("&amp;amp;pow","t","Table "));
run;
%put x is &amp;amp;x;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 30 Apr 2017 10:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leave-space-eq-Don-t-compress-after-replacement-tranwrd-and/m-p/354802#M83048</guid>
      <dc:creator>t_ar_taat</dc:creator>
      <dc:date>2017-04-30T10:34:15Z</dc:date>
    </item>
  </channel>
</rss>

