Date: Mon, 23 Jun 2003 08:10:48 -0700
Reply-To: Prasad S Ravi <prasad.s.ravi@HOUSEHOLD.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Prasad S Ravi <prasad.s.ravi@HOUSEHOLD.COM>
Subject: Re: Editing a Character Field
Content-type: text/plain; charset=us-ascii
David:
Here is another way.
data one;
input x $20.;
datalines;
"5 (59.1)"
"55 (100.0)"
"64 (34.3)"
;
run;
data two;
set one;
y=quote(dequote(scan(x,1,' ')));
run;
proc print;
run;
Prasad Ravi
David Friedman
<harrypotterdhf@EARTH To: SAS-L@LISTSERV.UGA.EDU
LINK.NET> cc:
Sent by: "SAS(r) Subject: Editing a Character Field
Discussion"
<SAS-L@LISTSERV.UGA.E
DU>
06/22/2003 09:21 AM
Please respond to
David Friedman
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?