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 (May 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 22 May 2008 05:56:22 -0700
Reply-To:     Laptop765@GMAIL.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Laptop765@GMAIL.COM
Organization: http://groups.google.com
Subject:      Re: Automatic Trim on Input?
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

On May 21, 3:47 pm, BD9...@ATT.COM ("Duell, Bob") wrote: > You are using standard column input, which trims leading blanks. > > Change to "formatted" input and use the $CHAR informat with pointer > control. For example: > > DATA newdata; > INFILE infile; > INPUT @1 first $char6. > @7 second $char4. > @11 third $char10. > @21 fourth $char26. > @47 fifth $char53.; > RUN; > > That should do it! > > -----Original Message----- > From: SAS(r) Discussion [mailto:SA...@LISTSERV.UGA.EDU] On Behalf Of > > Laptop...@GMAIL.COM > Sent: Wednesday, May 21, 2008 11:50 AM > To: SA...@LISTSERV.UGA.EDU > Subject: Automatic Trim on Input? > > Say I have the following input: > DATA newdata; > INFILE infile; > INPUT first $ 1-6 > second $ 7-10 > third $ 11-20 > fourth $ 21-46 > fifth $ 47-100 > RUN; > > I manipulate the data for a while and then go to output it again. > When I output it (using same field numbers), I find that SAS has re- > arranged the layout of the fields... It looks like the data has been > trimmed and left-justified. This turns out to be a major problem > considering my data files are laid out by columns and the larger > columns (fourth and fifth) are actually many sub-fields whose column > alignment need to stay where they are. Is there any way to turn this > off and keep any trailing/leading spaces?

Worked perfectly! Thanks!


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