<?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: Detect or Exclude rows which include not standard ASCII characters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Detect-or-Exclude-rows-which-include-not-standard-ASCII/m-p/886950#M350463</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
length url $3000.;
input url;
datalines;
blogs.sas.com/wan/2022/03/18/sas-eg-è·³å‡ºéŒ¯èª¤è¨Š 
www.dog.it
;
run;

data want;
 set have;
 if prxmatch('/[[:^ascii:]]/',url) then flag=1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 29 Jul 2023 09:35:11 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2023-07-29T09:35:11Z</dc:date>
    <item>
      <title>Detect or Exclude rows which include not standard ASCII characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Detect-or-Exclude-rows-which-include-not-standard-ASCII/m-p/886866#M350427</link>
      <description>&lt;P&gt;Hi Experts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following sample dataset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data have;
length url $3000.;
input url;
datalines;
blogs.sas.com/wan/2022/03/18/sas-eg-è·³å‡ºéŒ¯èª¤è¨Š 
www.dog.it
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I'm trying to find a way to exclude all the row in the dataset which include not ASCII standard characters or not printable characters. Any hints appreciated&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 17:28:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Detect-or-Exclude-rows-which-include-not-standard-ASCII/m-p/886866#M350427</guid>
      <dc:creator>dcortell</dc:creator>
      <dc:date>2023-07-28T17:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Detect or Exclude rows which include not standard ASCII characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Detect-or-Exclude-rows-which-include-not-standard-ASCII/m-p/886878#M350433</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/71355"&gt;@dcortell&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n1mdh2gvd5potjn14jipysvzn4o7.htm" target="_blank" rel="noopener"&gt;FINDC function&lt;/A&gt; with modifiers corresponding to character classes that you may want to keep or exclude. Or the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p0aesccozrvg19n1bg83z1jb9nid.htm" target="_blank" rel="noopener"&gt;VERIFY function&lt;/A&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
if ~verify(url, collate(32,126));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In this example I use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n1k9dtbhesk4lgn1dwbj5xfudwft.htm" target="_blank" rel="noopener"&gt;COLLATE function&lt;/A&gt; to specify the ASCII characters from blank (decimal ASCII code 32) to tilde (126) as the admissible characters. The subsetting IF statement excludes all observations where URL contains a character outside of this range.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 18:15:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Detect-or-Exclude-rows-which-include-not-standard-ASCII/m-p/886878#M350433</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-07-28T18:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Detect or Exclude rows which include not standard ASCII characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Detect-or-Exclude-rows-which-include-not-standard-ASCII/m-p/886880#M350434</link>
      <description>&lt;P&gt;The &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/default/lefunctionsref/n0fcshr0ir3h73n1b845c4aq58hz.htm" target="_self"&gt;COMPRESS&lt;/A&gt; function to the rescue! This example keeps only printable characters.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
	where compress(url,,'kw')=url;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 18:18:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Detect-or-Exclude-rows-which-include-not-standard-ASCII/m-p/886880#M350434</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2023-07-28T18:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Detect or Exclude rows which include not standard ASCII characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Detect-or-Exclude-rows-which-include-not-standard-ASCII/m-p/886901#M350441</link>
      <description>&lt;P&gt;That is going to include a LOT of non-ASCII characters.&lt;/P&gt;
&lt;PRE&gt;91   data want;
92     url=collate(0,255);
93     expect=collate(32,126);
94     try=compress(url,,'kw');
95     if try ne expect then do;
96       extra=compress(try,expect);
97       put extra= / extra $hex. ;
98     end;
99   run;

extra=€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ&amp;nbsp;¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇ
8082838485868788898A8B8C8E9192939495969798999A9B9C9E9FA0A1A2A3A4A5A6A7A8A9AAABACAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Jul 2023 20:15:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Detect-or-Exclude-rows-which-include-not-standard-ASCII/m-p/886901#M350441</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-07-28T20:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Detect or Exclude rows which include not standard ASCII characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Detect-or-Exclude-rows-which-include-not-standard-ASCII/m-p/886926#M350451</link>
      <description>&lt;P&gt;Your sample data indicate otherwise but should you by any change be dealing with multibyte characters in your real data then none of the already proposed solutions would work and you need to look into SAS string functions on level&amp;nbsp;I18N Level 2.&amp;nbsp;&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/nlsref/p1pca7vwjjwucin178l8qddjn0gi.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/nlsref/p1pca7vwjjwucin178l8qddjn0gi.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jul 2023 00:10:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Detect-or-Exclude-rows-which-include-not-standard-ASCII/m-p/886926#M350451</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-07-29T00:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Detect or Exclude rows which include not standard ASCII characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Detect-or-Exclude-rows-which-include-not-standard-ASCII/m-p/886941#M350458</link>
      <description>&lt;P&gt;Note that UTF-8 encoding is designed not to mess with normal ASCII codes, so the first (best) solution of using VERIFY() with COLLATE(32,126) will work fine on UTF-8 strings.&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jul 2023 05:14:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Detect-or-Exclude-rows-which-include-not-standard-ASCII/m-p/886941#M350458</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-07-29T05:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Detect or Exclude rows which include not standard ASCII characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Detect-or-Exclude-rows-which-include-not-standard-ASCII/m-p/886950#M350463</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
length url $3000.;
input url;
datalines;
blogs.sas.com/wan/2022/03/18/sas-eg-è·³å‡ºéŒ¯èª¤è¨Š 
www.dog.it
;
run;

data want;
 set have;
 if prxmatch('/[[:^ascii:]]/',url) then flag=1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 29 Jul 2023 09:35:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Detect-or-Exclude-rows-which-include-not-standard-ASCII/m-p/886950#M350463</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-07-29T09:35:11Z</dc:date>
    </item>
  </channel>
</rss>

