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 (June 2003, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 23 Jun 2003 08:55:42 -0400
Reply-To:   "Goldman, Brad (AT-Atlanta)" <Brad.Goldman@AUTOTRADER.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Goldman, Brad (AT-Atlanta)" <Brad.Goldman@AUTOTRADER.COM>
Subject:   Re: Editing a Character Field
Content-Type:   text/plain; charset="iso-8859-1"

> I have the following character field: > > x > ----------- > "5 (59.1)" > "55 (100.0)" > "64 (34.3)" > > The number in parentheses is the percentage. I would like to > remove it so > I get the following in a new field, y. > > y > ---- > "5" > "55" > "64" > > What is the best way to do this?

Key on the left parentheses using the index function, get a substring of x based on that.

y=substr(x,1,index(x,"(")-2));

-Brad


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