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 (August 2003, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 26 Aug 2003 12:38:28 -0400
Reply-To:   Robert Abelson <rabelson@KAI-RESEARCH.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Robert Abelson <rabelson@KAI-RESEARCH.COM>
Subject:   Re: converting string (spaces) to numeric
Content-Type:   text/plain

Alvin,

You can use the COMPRESS function to remove the blanks.

number = input(compress(string),7.);

Hope this helps.

Bob Abelson KAI Research, Inc. 6001 Montrose Rd. Suite 920 Rockville, MD 20852 T: 301-770-2730 F: 301-770-4183 rabelson@kai-research.com

> -----Original Message----- > From: Alvin Igonia [SMTP:aigonia@CA.IBM.COM] > Sent: Tuesday, August 26, 2003 12:22 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: converting string (spaces) to numeric > > 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.


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