Date: Thu, 14 May 2009 21:07:40 -0400
Reply-To: Ya Huang <ya.huang@AMYLIN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ya Huang <ya.huang@AMYLIN.COM>
Subject: Re: Text Manipulation
Use compress to get rid of all numbers, if left with a blank string,
the it was a string of number, then replace it:
data have;
input name $;
cards;
John
Jones
5648
Paul
78900
Julie
;
data need;
set have;
if compress(name,'0123456789')='' then name='Other';
run;
proc print;
run;
Obs name
1 John
2 Jones
3 Other
4 Paul
5 Other
6 Julie
On Thu, 14 May 2009 17:29:02 -0700, saurabh <saurabhkdas@GMAIL.COM> wrote:
>Hello All,
>
>I have a dataset , and its has a column called Name - Type Text.
>
>This column has the following values
>Name
>---------
>John
>Jones
>5648
>Paul
>78900
>Julie
>...
>...
>...
>
>
>
>What I wish is to change all those name which are numeric to a value =
>"Others".
>
>help needed.
>
>thanks
>SD
|