<?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 detect and treat apostrophe and foreign characters in a string? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-treat-apostrophe-and-foreign-characters-in-a/m-p/840207#M332235</link>
    <description>&lt;P&gt;The weird characters you're getting are likely due to using a single byte encoded editor or environment for multibyte characters (i.e. UTF-8).&lt;/P&gt;
&lt;P&gt;Below should satisfy what you're asking for.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  var=compress(var,"'");
  if findc(var,' ','kfnp') then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 24 Oct 2022 07:12:03 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2022-10-24T07:12:03Z</dc:date>
    <item>
      <title>How to detect and treat apostrophe and foreign characters in a string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-treat-apostrophe-and-foreign-characters-in-a/m-p/840197#M332230</link>
      <description>&lt;P&gt;My string variable contains&amp;nbsp;apostrophes and foreign characters in a few observations. For example,&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data have;
	input var $30.;
	datalines;
Let's go for dinner
pi�ata dance collective
Another 인천
The 4th line
;
run;&lt;/CODE&gt;&lt;/PRE&gt;I want to remove the&amp;nbsp;apostrophe (') in the first observation, and delete the second and third observations because they contain characters that are neither alphabet nor number. Is there a good way to do this in SAS?&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 24 Oct 2022 04:32:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-treat-apostrophe-and-foreign-characters-in-a/m-p/840197#M332230</guid>
      <dc:creator>xyxu</dc:creator>
      <dc:date>2022-10-24T04:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect and treat apostrophe and foreign characters in a string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-treat-apostrophe-and-foreign-characters-in-a/m-p/840206#M332234</link>
      <description>&lt;P&gt;You can use the COMPRESS function to remove certain characters.&lt;/P&gt;
&lt;P&gt;Then there's a lot of function to identify different type of characters in a string:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n01f5qrjoh9h4hn1olbdpb5pr2td.htm#n0epkw2tu7yuion1877mn8mjjrex" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n01f5qrjoh9h4hn1olbdpb5pr2td.htm#n0epkw2tu7yuion1877mn8mjjrex&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I would try a combination of the functions starting with NOT...&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 07:04:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-treat-apostrophe-and-foreign-characters-in-a/m-p/840206#M332234</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2022-10-24T07:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect and treat apostrophe and foreign characters in a string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-treat-apostrophe-and-foreign-characters-in-a/m-p/840207#M332235</link>
      <description>&lt;P&gt;The weird characters you're getting are likely due to using a single byte encoded editor or environment for multibyte characters (i.e. UTF-8).&lt;/P&gt;
&lt;P&gt;Below should satisfy what you're asking for.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  var=compress(var,"'");
  if findc(var,' ','kfnp') then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Oct 2022 07:12:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-treat-apostrophe-and-foreign-characters-in-a/m-p/840207#M332235</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-10-24T07:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect and treat apostrophe and foreign characters in a string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-treat-apostrophe-and-foreign-characters-in-a/m-p/840240#M332244</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
 set have;
 var=compress(var,"'");
 if prxmatch('/[^a-z\d\s]/i',var) then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Oct 2022 11:51:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-treat-apostrophe-and-foreign-characters-in-a/m-p/840240#M332244</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-10-24T11:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect and treat apostrophe and foreign characters in a string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-treat-apostrophe-and-foreign-characters-in-a/m-p/840407#M332296</link>
      <description>Thanks! Do you have any suggestions for improving the editor's encoding issues? I used SAS 9.4 (English). If I add encoding='utf-8' into the import code, I got&lt;BR /&gt;&lt;BR /&gt;ERROR: Invalid string.&lt;BR /&gt;FATAL: Unrecoverable I/O error detected in the execution of the DATA step program.&lt;BR /&gt;Aborted during the EXECUTION phase.&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Oct 2022 22:08:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-treat-apostrophe-and-foreign-characters-in-a/m-p/840407#M332296</guid>
      <dc:creator>xyxu</dc:creator>
      <dc:date>2022-10-24T22:08:44Z</dc:date>
    </item>
  </channel>
</rss>

