<?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 remove strange symbols from character data? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-remove-strange-symbols-from-character-data/m-p/585315#M14309</link>
    <description>&lt;P&gt;You need to inquire how these curly quotes were created, they are not what should be used around values in csv files.&lt;/P&gt;
&lt;P&gt;If you can't have it corrected at the source, you can change them by applying the translate() function on _infile_ before actually reading an observation:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input @;
_infile_ = translate(_infile_,'"','?');
input ........ ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Replace the question mark with the curly quote you want replaced.&lt;/P&gt;</description>
    <pubDate>Fri, 30 Aug 2019 18:08:56 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-08-30T18:08:56Z</dc:date>
    <item>
      <title>How to remove strange symbols from character data?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-remove-strange-symbols-from-character-data/m-p/585284#M14294</link>
      <description>&lt;P&gt;I am trying to import a .csv file which has the following format (first two observations)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PayeeID,Name,AreaID,RegionID,DistrictID,TerritoryID,TMRole,TMType,StartDate,EndDate&lt;BR /&gt;“0000100181”,"name",company name,30,321,3176,TM,TM,2018-01-01,2018-02-04&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the following code to import:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc import datafile = "C:\Users\conno\OneDrive\Desktop\DS 7900 - Data Science XLS Group\TEST.csv"&lt;BR /&gt;out = ds7900.data&lt;BR /&gt;DBMS = csv&lt;BR /&gt;replace;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the first column has some strange question mark symbols. For example, when printed to the results viewer:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;Obs PayeeID12 &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;�0000100181�&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;�0000100181�&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I want to remove these. Please help!&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 30 Aug 2019 16:39:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-remove-strange-symbols-from-character-data/m-p/585284#M14294</guid>
      <dc:creator>marmst10</dc:creator>
      <dc:date>2019-08-30T16:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove strange symbols from character data?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-remove-strange-symbols-from-character-data/m-p/585299#M14301</link>
      <description>Probably because of the curly quotes of the first item cause the strange character. The straight quotes of the second item don't result in a strange character. Or do they?</description>
      <pubDate>Fri, 30 Aug 2019 17:30:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-remove-strange-symbols-from-character-data/m-p/585299#M14301</guid>
      <dc:creator>JosvanderVelden</dc:creator>
      <dc:date>2019-08-30T17:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove strange symbols from character data?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-remove-strange-symbols-from-character-data/m-p/585310#M14306</link>
      <description>You may have a different encoding on the file. Can you check what the encoding is of the file? This usually happens when you have files that have moved across OS (Unix to Windows) or working in different countries where a different encoding is standards...or manually fixing data and introducing 'smart quotes' (Google that) rather than traditional quotes. The smart quotes usually means the data was in Excel or Word at some point though the browser can also introduce those and mess up the text.</description>
      <pubDate>Fri, 30 Aug 2019 17:59:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-remove-strange-symbols-from-character-data/m-p/585310#M14306</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-30T17:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove strange symbols from character data?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-remove-strange-symbols-from-character-data/m-p/585315#M14309</link>
      <description>&lt;P&gt;You need to inquire how these curly quotes were created, they are not what should be used around values in csv files.&lt;/P&gt;
&lt;P&gt;If you can't have it corrected at the source, you can change them by applying the translate() function on _infile_ before actually reading an observation:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input @;
_infile_ = translate(_infile_,'"','?');
input ........ ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Replace the question mark with the curly quote you want replaced.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 18:08:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-remove-strange-symbols-from-character-data/m-p/585315#M14309</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-08-30T18:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove strange symbols from character data?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-remove-strange-symbols-from-character-data/m-p/585317#M14310</link>
      <description>&lt;P&gt;This fixed it! Thank you. I just replaced the curly quotes, “ with straight quotes " and it removed the strange character.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 18:13:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-remove-strange-symbols-from-character-data/m-p/585317#M14310</guid>
      <dc:creator>marmst10</dc:creator>
      <dc:date>2019-08-30T18:13:27Z</dc:date>
    </item>
  </channel>
</rss>

