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 (April 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 15 Apr 2004 13:34:00 -0400
Reply-To:     "Frustino, Stephen" <SFrustino@COLLEGEBOARD.ORG>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Frustino, Stephen" <SFrustino@COLLEGEBOARD.ORG>
Subject:      PUTting a fixed width text file
Content-Type: text/plain; charset="iso-8859-1"

Dear colleagues,

I've been working with a number of procedures to read data from fixed width text files in one format and writing back subsets of it into multiple fixed width text files in a different format. A recurring issue has been when a variable being read in has leading blanks, it appears as left justified in the output file. However, those leading blanks are significant. Sometimes the variables also have trailing blanks. So what I end up doing is reading in a dummy variable that starts at the same point as the real variable that I want to write and ends at a point in the file at which I know that there will be a non-blank. I then use that variable in a piece of code as follows:

@ 903 + (min(47, (63-length(LEFT(VarDummy))))) VarReal

It works, but it's cumbersome. Would anyone have a better way of preserving leading blanks when using the PUT statement? Any suggestions would be appreciated. Thanks!

Stephen


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