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 (February 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 25 Feb 2008 21:32:44 +0100
Reply-To:     Rune RunnestÝ <rune@FASTLANE.NO>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Rune RunnestÝ <rune@FASTLANE.NO>
Subject:      Re: How to right-align values when writing from a data set to a
Comments: To: sas-l@uga.edu

I just write to inform you that the replacement of the dollar signs with the character format sign solved the problem.

May be you might wonder why I don't use numeric informat for the variables I want to get right-aligned and character informat for the variables I want to get left-aligned ? Then I could have written them right back to file without any extra gambot. The reason is that some of the values on the disk file, which I read with the INFILE statement, have leading zeros. That's a sign of bad quality, which is what I intend to detect. If I had used numeric informat, SAS would have skipped the leading zeros, and I wouldn't have noticed them. It's not the data values in the SAS data set that is important to check, but the values on the file on the disk. So it's a point that the values in the data sets reflect what is on the file. Therefore, I have to use character informat. Then I use SAS to correct the values, and write the correct values back to file. If the values were originally right-aligned on the file, I have to use -R for those variables when writing them back to file. It is important that the values keep the same alignment on the corrected file.

As far as I know, there is no chance to get a variable right-aligned in the SAS data set when it is read from the file with charcter informat. In case I have misunderstood or there is some technique that I am not aware of, I would appreciate to be informed.

Rune


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