LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2009, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: saurabhkdas@GMAIL.COM

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


Back to: Top of message | Previous page | Main SAS-L page