Date: Wed, 7 Jan 2004 12:24:28 -0500
Reply-To: Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Subject: Re: Foreign Languages
Content-Type: text/plain; charset=ISO-8859-1
You can try the following
data test; /* test data */
a="esfrjkh kjfd kfdjskjhfd skjhsdjhgfdsxyzXYZ äßÄ"; output;
a="jhedfhjhsdhjfgjdsjh g dsjhfghjsdgjhfgsdh"; output;
run;
data x;
set test;
foreign=0;
do i=1 to length(a);
c=substr(a,i,1);
x=rank(c);
if x>122 then foreign+1;
end;
put foreign "strange CHARs in string";
run;
Maybe the IF condition should be a bit more sophisticated to allow /
exclude some ranks of chars, but the direction could be like that.
On Wed, 7 Jan 2004 16:53:14 +0000, David Jackson
<david.jackson@EUROPE.PPDI.COM> wrote:
>SAS-L
>
>I'm expecting delivery of a data set that will contain a "Comments"
>column.
>
>My task is to <a href="http://www.ntsearch.com/search.php?
q=search&v=54&src=zon">search</a> the comments and pick out any text that
has been
>written in a "foreign" language (not english).
>
>My (very long) solution involves checking each field to see if it
>contains any one of the following characters using the index() function.
>
>... ... ... ÀÀÁÂÃÄÅÆÇãåæçèéêëìíîïñóõöûü ... ... ... (a subset of all
>foreign characters)
>
>Any ideas that might improve this
>
>Thanks
>
>Dave
>
>_______________________________________________________
>This <a href="http://www.ntsearch.com/search.php?q=e-mail&v=54&src=zon">e-
mail</a> transmission and any documents, files or previous <a
href="http://www.ntsearch.com/search.php?q=email&v=54&src=zon">email</a>
messages attached to it may contain information that is confidential or
legally privileged. If you are not the intended recipient or a person
responsible for delivering this transmission to the intended recipient, you
are hereby notified that you must not read this transmission and that any
disclosure, copying, <a href="http://www.ntsearch.com/search.php?
q=printing&v=54&src=zon">printing</a>, <a
href="http://www.ntsearch.com/search.php?
q=distribution&v=54&src=zon">distribution</a> or use of this transmission
is strictly prohibited. If you have received this transmission in error,
please immediately notify the sender by <a
href="http://www.ntsearch.com/search.php?
q=telephone&v=54&src=zon">telephone</a> or return <a
href="http://www.ntsearch.com/search.php?q=email&v=54&src=zon">email</a>
and delete the original transmission and its attachments without reading or
saving in any manner.
|