<?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: How to handle special character in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-special-character/m-p/768455#M243754</link>
    <description>&lt;P&gt;Yes this is not working, do you have any other solution for this senerio.&lt;/P&gt;</description>
    <pubDate>Sun, 19 Sep 2021 11:57:20 GMT</pubDate>
    <dc:creator>pdhokriya</dc:creator>
    <dc:date>2021-09-19T11:57:20Z</dc:date>
    <item>
      <title>How to handle special character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-special-character/m-p/767611#M243386</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How should I handle below special charcters?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;â€™ replaced by '&lt;/P&gt;
&lt;P&gt;â€¢ by space&lt;/P&gt;
&lt;P&gt;Â´ replace by '&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data abc;&lt;BR /&gt;y="The Subject’s status was not changed";output;&lt;BR /&gt;y="The Subject has - •6 point";output;&lt;BR /&gt;y="The subject didn´t capture photo";output;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data xyz;&lt;BR /&gt;set abc ;&lt;BR /&gt;y1=tranwrd (y, "’" , "'");&lt;BR /&gt;y1=tranwrd (y, "•" ,"");&lt;BR /&gt;y1=tranwrd (y, "´" , "'");&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 06:01:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-special-character/m-p/767611#M243386</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2021-09-14T06:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle special character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-special-character/m-p/767627#M243392</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data xyz;
set abc ;
y1=tranwrd (y, "’" , "'");
y1=tranwrd (y, "•" ,"");
y1=tranwrd (y, "´" , "'");
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since you always create y1 anew from y, only the last result will show up in your output, overwriting the results of the previous translations. Change this to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data xyz;
set abc ;
y1=tranwrd (y, "’" , "'");
y1=tranwrd (y1, "•" ,"");
y1=tranwrd (y1, "´" , "'");
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Sep 2021 07:56:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-special-character/m-p/767627#M243392</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-14T07:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle special character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-special-character/m-p/768455#M243754</link>
      <description>&lt;P&gt;Yes this is not working, do you have any other solution for this senerio.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Sep 2021 11:57:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-special-character/m-p/768455#M243754</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2021-09-19T11:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle special character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-special-character/m-p/768470#M243759</link>
      <description>&lt;P&gt;You seem to have an encoding issue.&amp;nbsp; In your post you have two different sets of characters.&amp;nbsp; One set in the description of the problem and different characters in the code.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 178px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63706iED82371CB990E128/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 206px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63707i7770B3D556B2D470/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So which ones to you have in your actual file?&amp;nbsp; Look at the Hexadecimal representation of the strings to see&amp;nbsp; what is actually in the file.&lt;/P&gt;
&lt;PRE&gt;E28099 â€™
E280A2 â€¢
C2B4   Â´
92     ’
95     •
B4     ´
&lt;/PRE&gt;
&lt;P&gt;What encoding is your SAS session using? Check the value of the SYSENCODING macro variable.&amp;nbsp; What encoding is the dataset that has values using?&amp;nbsp; Check PROC CONTENTS output for the dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use hexadecimal constants in your SAS code to make the code more portable.&lt;/P&gt;
&lt;P&gt;Run the right code for the encoding that is in the character variable Y.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* UTF-8 codes ;
y1=tranwrd(y, 'E28099'x , "'");
y1=tranwrd(y1,'E280A2'x ," ");
y1=tranwrd(y1, 'C2B4'x , "'");

* WLATIN1 code ;
y1=translate(y,"' '",'929584'x);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 19 Sep 2021 15:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-special-character/m-p/768470#M243759</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-09-19T15:28:59Z</dc:date>
    </item>
  </channel>
</rss>

