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 (December 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 2 Dec 2008 13:17:08 -0500
Reply-To:   Jim Groeneveld <jim.1stat@YAHOO.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Jim Groeneveld <jim.1stat@YAHOO.COM>
Subject:   Re: Removing leading blanks from a numeric value
Comments:   To: Katie Schmidt <kathryn.schmidt@IBX.COM>

Dear Katie,

It depends on the format that you use. If you use e.g. 10.4 all values will be decimal justified, possibly causing leading spaces. If you omit the format values the result may be left justified:

DATA TestData; INPUT c $ @@; n = INPUT ( c, BEST.); * no further w.d info; PUT c= n=; CARDS; 1 .00001 999999 ; RUN;

yields in the log:

c=1 n=1 c=.00001 n=0.00001 c=999999 n=999999

Show us your code where you want left justification.

Regards - Jim. -- Jim Groeneveld, Netherlands Statistician, SAS consultant home.hccnet.nl/jim.groeneveld

On Tue, 2 Dec 2008 11:59:32 -0500, Katie Schmidt <kathryn.schmidt@IBX.COM> wrote:

>I converted a variable with a character format to a variable with a numeric >format. Now the the numeric variable shows up in the SAS dataset with >leading spaces (in other words, the values are not left-justified). > >How do I get rid of the leading spaces and left justify the numeric >variable? > >The trim and left functions work but they also convert the variable back to >a character format at the same time, which is NOT what I want. > >Thanks to anyone who can help!


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