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 (September 2010, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 28 Sep 2010 01:03:48 -0400
Reply-To:     "Ravinder.Maramamula" <ravinsun@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Ravinder.Maramamula" <ravinsun@GMAIL.COM>
Subject:      Re: Character and Alphanumeric values
Comments: To: Nat Wooding <nathani@verizon.net>
In-Reply-To:  <6ECF7E682E5040D086134C162835F274@D1871RB1>
Content-Type: text/plain; charset=ISO-8859-1

As always you people rock and thanks for the different perspectives to the problem :-)

-Ravi

On Mon, Sep 27, 2010 at 5:46 PM, Nat Wooding <nathani@verizon.net> wrote:

> One of our former active participants who now lurks pointed out that a > better if statement would be > > if Anydigit ( var ) then output AlphaNum; > > Nat > > -----Original Message----- > From: Nat Wooding [mailto:nathani@verizon.net] > Sent: Monday, September 27, 2010 5:20 PM > To: 'SAS-L@LISTSERV.UGA.EDU' > Subject: RE: Character and Alphanumeric values > > The following will segregate the purely alpha strings from the mixed > strings. > > Nat Wooding > > data have ; > infile datalines; > informat var $25.; > input var; > datalines; > aa > ab > abc > abcde > abcdefghijklmnopqrstuvwxyz > a23 > b1 > ab2 > ; > Data AlphaNUM Alpha; > set have; > > if Compress ( var , ' ' , 'a' ) ge '0' then output AlphaNum; > else output Alpha; > proc print; > run; > > -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of > Ravinder.Maramamula > Sent: Monday, September 27, 2010 12:08 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: Character and Alphanumeric values > > Gerhard, > > > Sorry for the confusion ,I want to remove all the patterns which are > associated with numbers. > so i want to remove all the below patterns and want to put in another > dataset. > a1,a21,ab1,abc231,a1bcdef . > > How can i achieve that ,any help in this aspect is well appreciated. > > > Thanks, > Ravinder > > On Mon, Sep 27, 2010 at 9:18 PM, Gerhard Hellriegel < > gerhard.hellriegel@t-online.de> wrote: > > > for me it is not fully clear what you want. You write, you want to remove > > all the alphanumeric data and place it in another dataset. Alphanumeric > is > > ALL, numbers and characters! What do you want to remove? Your example > > seems to extract only records without any numeric part. The "want" > > dataset, is that the "other" - dataset, or that what remains after > > removing something. What is with data with any number-parts? Records > > deleted? > > > > I'm not aware of any informat for telephone numbers. Think there are no > > real standards for the numbers. > > With the compress-function you can remove anything what you don't want, > > including blanks, -, (, ), .... > > > > data a; > > x="(123) - 123456"; > > y=compress(x,"(),.+-[] "); > > put x= / y=; > > run; > > > > Gerhard > > > > > > > > > > > > On Mon, 27 Sep 2010 06:06:09 -0400, Ravinder.Maramamula > > <ravinsun@GMAIL.COM> wrote: > > > > >Hi list, > > > > > > > > >I have a dataset and it contains a character variable which > > >has mixture of values like character and alphanumeric. > > >I want to validate the dataset and remove all the alphanumeric > > >values and place it in another dataset. > > > > > >data have ; > > >infile datalines; > > >input var; > > >datalines; > > >aa > > >ab > > >abc > > >abcde > > >.... > > >... > > >abcdefghijklmnopqrstuvwxyz > > >a23 > > >b1 > > >ab2 > > >; > > >dataset want: > > >aa > > >ab > > >abc > > >abcde > > >..... > > >..... > > >abcdefghijklmnopqrstuvwxyz > > >; > > >Do we have any informat which would directly read telephone numbers of > > type > > >(987)6543210 as 9876543210. > > > > > >Thanks in advance for your time. > > > > > >Regards, > > >Ravi > > > > > > -- > TOUGHT TIMES NEVER LAST!!!!!BUT TOUGH PEOPLE DO!!!!! >

-- TOUGHT TIMES NEVER LAST!!!!!BUT TOUGH PEOPLE DO!!!!!


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