Date: Tue, 24 Mar 2009 22:35:47 +0530
Reply-To: Anindya Mozumdar <anindya.lugbang@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Anindya Mozumdar <anindya.lugbang@GMAIL.COM>
Subject: Re: reducing the length of numeric variable
In-Reply-To: <b7a7fa630903240753x478ba111n3fceb7afda4e412a@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
On Tue, Mar 24, 2009 at 8:23 PM, Joe Matise <snoopy369@gmail.com> wrote:
> Small correction to my explanation ... you either want to truncate the
> number, or reduce its formatted length; you do not want to reduce the number
> of bytes used to store the number (length), as that can have accuracy
> complications beyond that of simple truncation.
>
> -Joe
>
I am not sure about the case with SAS, but leaving numeric variables
with the default length of 8 bytes might be actually more efficient
because of internal architectural issues (I had taken a course many
years ago, and may not remember the exact details). As others have
pointed out, use formats to display the number with lesser decimal
places. Explore the function ROUND if you actually want to change the
value contained in the numeric variable.
Regards,
Anindya
|