Date: Tue, 26 Aug 2003 19:19:26 +0100
Reply-To: Roland <roland@RASHLEIGH-BERRY.FSNET.CO.UK>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Roland <roland@RASHLEIGH-BERRY.FSNET.CO.UK>
Organization: Universe Monitors
Subject: Re: converting string (spaces) to numeric
I've used the comma. informat for years for reading in numbers. I love it. I
can always trust it. It takes nearly everything you can throw at it.
1 data _null_;
2 str='100 000 000';
3 x=input(str,comma13.);
4 put x=;
5 run;
x=100000000
NOTE: DATA statement used:
real time 0.43 seconds
"Alvin Igonia" <aigonia@CA.IBM.COM> wrote in message
news:200308261622.h7QGMMa28177@listserv.cc.uga.edu...
> Has anyone ever converted a string to numeric (ie. '1 000 000' to
1000000).
>
> I have a program I am trying to modify. The data has change. We use to
> read the data string without any spaces but now it contains spaces.
>
> I don't really want to do a do-loop and check for spaces but if it's the
> only way, i guess i will have to.
|