|
Ali,
DO NOT CHANGE ANY LENGTH OF A NON-INTEGER VARIABLE!
One of my worst mistakes I made was to give an OK to making
4-byte variables for medical expenditures when pressed to
answer yes. I verified that all values in pennies would fit,
but the project people did not want to work in pennies.
The project was plagued by rounding errors for months before
accepting the 8-byte penalty. Remember all SAS procedures and
DATA steps work with 8-byte values and the conversion can
cause major problems even when you round values.
If the lengths must be changed then the place to do it
is in the extraction code. Details depend on the nature of
the extraction code.
Ian Whitlock
================
Date: Fri, 28 Oct 2005 06:21:49 -0700
Reply-To: Ali G <Alistair.Gordon@NEWTYNE.COM>
Sender: "SAS(r) Discussion"
From: Ali G <Alistair.Gordon@NEWTYNE.COM>
Organization: http://groups.google.com
Subject: Re: Resetting numeric variable length
Comments: To: sas-l@uga.edu
In-Reply-To: <1130504959.999505.180260@g43g2000cwa.googlegroups.com>
Content-Type: text/plain; charset="iso-8859-1"
> DON'T DO THIS. Leave it with a length of 8. If you only want to show 5
> digits then use the format "5." when you display it or assign that
> format to the variable.
I have to: I'm extracting a monster DB2 table and need to shorten the
numeric lengths down to save some valuable space. A pass-thru to DB2
seems to set all numerics to 8 by default and I need to change them.
|