|
Looks like you want to get rid of any non-alphanumeric characters. I'm sure one of the regexp gurus will offer up something mysterious and incredibly concise, but compress() will also do what you ask. Note the doubled-up double quotes.
data _null_;
a = "int'-""l";
b = compress(a,"`~!@#$%^&*()-_=+[]\{}|;':"",./<>?");
put a= b=;
run;
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of
Thomas
Sent: Monday, April 25, 2005 11:01 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Clear redundant in string
Hi all,
May I know how to clear the redundant symbols contained in string as shown
belows?
Thank you!
Thomas
CONAME
YAHOO! INC.
ALCOA, INCORPORATION
INT'L BUSSINESS MACHINE
K&K ENTERPRISES
CONAME
YAHOO INC
ALCOA INCORPORATION
INTL BUSSINESS MACHINE
KK ENTERPRISES
__________________________________________________________________________________________________________________________________
This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations.
Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized.
If you received this e-mail in error, please advise me (by return e-mail or otherwise) immediately.
Ce courrier électronique est confidentiel et protégé. L'expéditeur ne renonce pas aux droits et obligations qui s'y rapportent.
Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) désigné(s) est interdite.
Si vous recevez ce courrier électronique par erreur, veuillez m'en aviser immédiatement, par retour de courrier électronique ou par un autre moyen.
|