<?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 replace the characters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/replace-the-characters/m-p/475908#M122404</link>
    <description>&lt;P&gt;I need to replace the characters with others, but when write this, code don't work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro example();

%let decodedata=f"eif";
%put decodedata=&amp;amp;decodedata; 
%let decodedata1=%sysfunc(tranwrd(&amp;amp;decodedata,",&amp;amp;quot));
%put decodedata1=&amp;amp;decodedata1;
%mend example;


%example();&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;and when write&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let decodedata1=%sysfunc(tranwrd(&amp;amp;decodedata,' " ',&amp;amp;quot));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;get the original string in response. What's wrong?&lt;/P&gt;</description>
    <pubDate>Fri, 06 Jul 2018 06:36:34 GMT</pubDate>
    <dc:creator>Liliya95</dc:creator>
    <dc:date>2018-07-06T06:36:34Z</dc:date>
    <item>
      <title>replace the characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/replace-the-characters/m-p/475908#M122404</link>
      <description>&lt;P&gt;I need to replace the characters with others, but when write this, code don't work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro example();

%let decodedata=f"eif";
%put decodedata=&amp;amp;decodedata; 
%let decodedata1=%sysfunc(tranwrd(&amp;amp;decodedata,",&amp;amp;quot));
%put decodedata1=&amp;amp;decodedata1;
%mend example;


%example();&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;and when write&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let decodedata1=%sysfunc(tranwrd(&amp;amp;decodedata,' " ',&amp;amp;quot));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;get the original string in response. What's wrong?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 06:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/replace-the-characters/m-p/475908#M122404</guid>
      <dc:creator>Liliya95</dc:creator>
      <dc:date>2018-07-06T06:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: replace the characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/replace-the-characters/m-p/475917#M122405</link>
      <description>&lt;P&gt;Posting log with options symbolgen mprint and mlogic activated will show what happened.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the code you posted:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the variable &amp;amp;quot is undefined&lt;/LI&gt;
&lt;LI&gt;in macro-code an empty string is %str( )&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 06 Jul 2018 07:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/replace-the-characters/m-p/475917#M122405</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2018-07-06T07:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: replace the characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/replace-the-characters/m-p/475920#M122406</link>
      <description>&lt;P&gt;Look at the log, the macro fails because of the unbalanced double quote, and the single %let fails because of the undefined symbol quot. Note that &amp;amp;quot; is something that works in HTML, but not as some kind of tag in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are you trying to achieve? With complicated replacements involving quotes, I'd do it in a data step with symget() and call symputx(). Using data step functions in data steps is always easier and more transparent.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 07:17:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/replace-the-characters/m-p/475920#M122406</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-06T07:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: replace the characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/replace-the-characters/m-p/475922#M122407</link>
      <description>&lt;P&gt;Why are you doing data manipulation in SAS Macro when there is a fully fledged language for such a purpose called base SAS?&amp;nbsp; You are setting yourself up for bad unstable coding.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 07:36:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/replace-the-characters/m-p/475922#M122407</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-07-06T07:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: replace the characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/replace-the-characters/m-p/475947#M122426</link>
      <description>&lt;P&gt;This is untested but should work.&amp;nbsp; Change this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;amp;decodedata,",&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use this instead:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;%bquote(&amp;amp;decodedata),%str(%"),&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's possible, I do agree with the others that claim you would be well-served by switching to SAS language instead of macro language.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 10:42:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/replace-the-characters/m-p/475947#M122426</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-07-06T10:42:02Z</dc:date>
    </item>
  </channel>
</rss>

