<?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 Error while reading special characters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-while-reading-special-characters/m-p/228579#M41295</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I want to determine the ascii value&amp;nbsp;of some special characters like greek symbols&amp;nbsp;&lt;SPAN&gt;α, η, ω etc. using below code snippet:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data ascii (encoding="utf-8");&lt;BR /&gt;ascii_val=rank('Φ');&lt;BR /&gt;put ascii_val=;&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But these symbols get manipulated and I obtain&amp;nbsp;wrong ascii values in log.&lt;BR /&gt;I actually want to read a file using the infile statement and scan every character present in a line and If it is found to be a special symobl(ascii value more than 127) then it should prompt an error message and terminate the execution of the data step.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Oct 2015 07:26:13 GMT</pubDate>
    <dc:creator>Arjumand</dc:creator>
    <dc:date>2015-10-06T07:26:13Z</dc:date>
    <item>
      <title>Error while reading special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-while-reading-special-characters/m-p/228579#M41295</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I want to determine the ascii value&amp;nbsp;of some special characters like greek symbols&amp;nbsp;&lt;SPAN&gt;α, η, ω etc. using below code snippet:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data ascii (encoding="utf-8");&lt;BR /&gt;ascii_val=rank('Φ');&lt;BR /&gt;put ascii_val=;&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But these symbols get manipulated and I obtain&amp;nbsp;wrong ascii values in log.&lt;BR /&gt;I actually want to read a file using the infile statement and scan every character present in a line and If it is found to be a special symobl(ascii value more than 127) then it should prompt an error message and terminate the execution of the data step.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2015 07:26:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-while-reading-special-characters/m-p/228579#M41295</guid>
      <dc:creator>Arjumand</dc:creator>
      <dc:date>2015-10-06T07:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Error while reading special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-while-reading-special-characters/m-p/228580#M41296</link>
      <description>&lt;P&gt;A variation of below code should give you what you're after.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  length string $256;
  string = collate(0,255);
  output;
  string = collate(0,127);
  output;
run;

data 
  want (keep=string)
  error (keep=rownum string)
  exceptions (keep=rownum pos ASCII_Col_Seq)
  ;

  set have;
  rownum=_n_;

  retain prxid;
  if _n_=1 then
    prxid=prxparse('/[\x80-\xFF]/');

  _start=1;
  _stop=lengthn(string);
  call prxnext(prxid, _start, _stop, string, pos);
  if pos&amp;gt;0 then
    do;
      output error;
      do while (pos &amp;gt; 0);
        ASCII_Col_Seq = rank(substr(string, pos,1));
        output exceptions;
/*        put ASCII_Col_Seq= pos=;*/
        call prxnext(prxid, _start, _stop, string, pos);
      end;
    end;
  else
    output want;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Oct 2015 08:24:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-while-reading-special-characters/m-p/228580#M41296</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-10-06T08:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Error while reading special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-while-reading-special-characters/m-p/228610#M41305</link>
      <description>&lt;P&gt;Could&amp;nbsp;you please explain this code a bit?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2015 12:43:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-while-reading-special-characters/m-p/228610#M41305</guid>
      <dc:creator>Arjumand</dc:creator>
      <dc:date>2015-10-06T12:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Error while reading special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-while-reading-special-characters/m-p/228677#M41330</link>
      <description>&lt;P&gt;Hi, here's another idea.&amp;nbsp; First data step creates a data set with one variable that might contain one or more ASCII characters with a value of more than 127.&amp;nbsp; Next data step checks the length of the string to the length after removibg all characters ASCII value 128+.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data have;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;length x $10;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;do i=1 to 20;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;x=' ';&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;do j=1 to 10;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; y = ceil(100*ranuni(99)) + 32;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; x = catt(x,byte(y));&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;output;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;keep x;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* check for characters with ASCII value 128+ ... OK = 1 means there are none;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;set have;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;ok = length(x) eq length(compress(x,collate(128,255)));&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data set WANT ...&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ok&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; @$[e8€l`}\&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp; ,wQbkKƒ?fK&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp; .w&amp;gt;L+brMdA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp; +04ƒFKhn&amp;lt;a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp; Q8[U/?{K_y&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp; Lt(Bzl{+Wy&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; 7&amp;nbsp;&amp;nbsp;&amp;nbsp; h„9Zm0kZ7C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp; _xb+RLpa_k&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp; 4C6Qs&amp;amp;M^#]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;10&amp;nbsp;&amp;nbsp;&amp;nbsp; q3$ypchlqC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;11&amp;nbsp;&amp;nbsp;&amp;nbsp; 4SrN&amp;gt;?Xspa&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;12&amp;nbsp;&amp;nbsp;&amp;nbsp; jvr|1_X}fT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;13&amp;nbsp;&amp;nbsp;&amp;nbsp; {1|Q}DWQ0i&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;14&amp;nbsp;&amp;nbsp;&amp;nbsp; ~f]&amp;gt;Yjz7Gm&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;15&amp;nbsp;&amp;nbsp;&amp;nbsp; 86K08O*€g1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;16&amp;nbsp;&amp;nbsp;&amp;nbsp; H/sE6ITbSi&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;17&amp;nbsp;&amp;nbsp;&amp;nbsp; +b_8J5I?=v&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;18&amp;nbsp;&amp;nbsp;&amp;nbsp; O4~vtC3ZPw&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;19&amp;nbsp;&amp;nbsp;&amp;nbsp; MFr€-CuAeI&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;20&amp;nbsp;&amp;nbsp;&amp;nbsp; h„D24xiM}i&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want the data step to just stop when characters 128+ are encountered, you could just use ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;if length(x) ne length(compress(x,collate(128,255))) then stop;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are reading raw data rather than a data set, you could use ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;infile 'z:\ascii.txt';&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;input;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;if&amp;nbsp;length(_infile_) ne length(compress(_infile_,collate(128,255))) then stop;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2015 17:34:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-while-reading-special-characters/m-p/228677#M41330</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2015-10-06T17:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Error while reading special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-while-reading-special-characters/m-p/228719#M41335</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some brief explanations as requested.&lt;/P&gt;&lt;P&gt;My thinking behind this code was that it's often very helpful to get a list of all "forbidden" characters together with their positions in the string. This supports best further investigation and problem resolution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Data Want: Two rows get created, the first one contains "forbidden" characters (in real life: You might also want to exclude&amp;nbsp;characters in the low range, eg. HEX 00).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- The ERROR table simply contains a copy of records from WANT where an issue has been found.&lt;/P&gt;&lt;P&gt;- The EXCEPTION table contains a row per issue found in the row from WANT. It gives you the exact position in the string for the hurting character as well as the HEX value. ROWNUM will allow you to trace back where the issue originates from (you could also use the business key columns instead; if there are any).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- prxid=prxparse('/[\x80-\xFF]/'); &amp;nbsp;This compiles a Regular Expression which allows searching for characters in the Hex range of 80 to FF (=single byte encoded characters greater Decimal 127).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- The way I've used PRXNEXT() allows you to implement a loop over the source string from have searching for forbidden characters one-by-one. The syntax used is pretty close to the example from the doc and explained there. &amp;nbsp;&lt;A href="https://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#n1obc9u7z3225mn1npwnassehff0.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#n1obc9u7z3225mn1npwnassehff0.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this sheds some light on the code I've posted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2015 20:38:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-while-reading-special-characters/m-p/228719#M41335</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-10-06T20:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: Error while reading special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-while-reading-special-characters/m-p/228735#M41340</link>
      <description>&lt;P&gt;Hi, you can also get a list of "bad" characters in an ERROR data set without resorting to PRX functions (for those of us who have never "gotten the hang of PRX") ... that smiley face in data set WANT is an HTML thing ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* make variable X length 20 to increase the chance of 2+ bad characters;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data have;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;length x $20;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;do i=1 to 20;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;x=' ';&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;do j=1 to 20;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;y = ceil(100*ranuni(99)) + 32;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;x = catt(x,byte(y));&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;output;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;keep x;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data error (keep=rec pos character ascii) want(keep=x ok);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;set have;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;ok = length(x) eq length(compress(x,collate(128,255)));&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;output want;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;rec=_n_;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;start=1;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;do j=1 to length(x);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp;pos = findc(x,collate(128,255),start);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp;if pos then do; &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; character=char(x,pos); ascii=rank(character); start+pos; output error; &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp;end;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the ERROR data set ...&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;Obs rec pos character ascii&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;1 &amp;nbsp; &amp;nbsp;1 &amp;nbsp; 6 &amp;nbsp; &amp;nbsp;€ &amp;nbsp; &amp;nbsp; &amp;nbsp; 128&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;2 &amp;nbsp; &amp;nbsp;1 &amp;nbsp;17 &amp;nbsp; &amp;nbsp;ƒ &amp;nbsp; &amp;nbsp; &amp;nbsp; 131&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;3 &amp;nbsp; &amp;nbsp;2 &amp;nbsp;14 &amp;nbsp; &amp;nbsp;ƒ &amp;nbsp; &amp;nbsp; &amp;nbsp; 131&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;4 &amp;nbsp; &amp;nbsp;4 &amp;nbsp; 2 &amp;nbsp; &amp;nbsp;„&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;132&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;5 &amp;nbsp; &amp;nbsp;8 &amp;nbsp; 8 &amp;nbsp; &amp;nbsp;€ &amp;nbsp; &amp;nbsp; &amp;nbsp; 128&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;6 &amp;nbsp; 10 &amp;nbsp; 4 &amp;nbsp; &amp;nbsp;€ &amp;nbsp; &amp;nbsp; &amp;nbsp; 128&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;7 &amp;nbsp; 10 &amp;nbsp;12 &amp;nbsp; &amp;nbsp;„ &amp;nbsp; &amp;nbsp; &amp;nbsp; 132&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;8 &amp;nbsp; 11 &amp;nbsp;17 &amp;nbsp; &amp;nbsp;„ &amp;nbsp; &amp;nbsp; &amp;nbsp; 132&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;9 &amp;nbsp; 18 &amp;nbsp;10 &amp;#129;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;129&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;10 &amp;nbsp;19 &amp;nbsp; 4 &amp;nbsp; &amp;nbsp;‚ &amp;nbsp; &amp;nbsp; &amp;nbsp; 130&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;11 &amp;nbsp;19 &amp;nbsp; 8 &amp;nbsp; &amp;nbsp;€ &amp;nbsp; &amp;nbsp; &amp;nbsp; 128&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;12 &amp;nbsp;19 &amp;nbsp;13 &amp;nbsp; &amp;nbsp;ƒ &amp;nbsp; &amp;nbsp; &amp;nbsp; 131&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;13 &amp;nbsp;20 &amp;nbsp; 2 &amp;nbsp; &amp;nbsp;€ &amp;nbsp; &amp;nbsp; &amp;nbsp; 128&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the WANT data set ...&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;Obs &amp;nbsp; &amp;nbsp; &amp;nbsp; x &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ok&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;1 &amp;nbsp;@$[e8€l`}\,wQbkKƒ?fK 0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;2 &amp;nbsp;.w&amp;gt;L+brMdA+04ƒFKhn&amp;lt;a 0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;3 &amp;nbsp;Q8[U/?{K_yLt(Bzl{+Wy 1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;4 &amp;nbsp;h„9Zm0kZ7C_xb+RLpa_k 0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;5 &amp;nbsp;4C6Qs&amp;amp;M^#]q3$ypchlqC 1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;6 &amp;nbsp;4SrN&amp;gt;?Xspajvr|1_X}fT 1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;7 &amp;nbsp;{1|Q}DWQ0i~f]&amp;gt;Yjz7Gm 1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;8 &amp;nbsp;86K08O*€g1H/sE6ITbSi 0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;9 &amp;nbsp;+b_8J5I?=vO4~vtC3ZPw 1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;10 MFr€-CuAeIh„D24xiM}i 0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;11 n&amp;gt;n$/_a[|.1oK!78„sMx 0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;12 S?m-{2]|&amp;amp;6'&amp;#127;i$oI{3#T &amp;nbsp;1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;13 X$4Cq#igu&amp;amp;'*eJIgqLw# 1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;14 ]5ewe:ppE3't$}DsII0$ 1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;15 U;N=cO*iy}xQ_%uICg^` 1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;16 Vw.H\=Y?rI[]u^4g/M)O 1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;17 M&amp;lt;pLy)%3wg\?bef`76"^ 1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;18 +aJFURsNc&amp;#129;_&amp;#127;/|HMvDsL &amp;nbsp; 0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;19 t1q‚C@S€WCq7ƒK]ƒi3\" 0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;20 T€S3sWm"&amp;gt;P,!*k1NC08C 0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2015 21:19:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-while-reading-special-characters/m-p/228735#M41340</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2015-10-06T21:19:32Z</dc:date>
    </item>
  </channel>
</rss>

