Date: Tue, 24 Mar 2009 09:53:11 -0500
Reply-To: Joe Matise <snoopy369@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Joe Matise <snoopy369@GMAIL.COM>
Subject: Re: reducing the length of numeric variable
Content-Type: text/plain; charset=ISO-8859-1
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.
On Tue, Mar 24, 2009 at 9:52 AM, Joe Matise <email@example.com> wrote:
> First off, you don't want to reduce the length (storage space used), as
> that reduces accuracy. You want to reduce the format length.
> Do you want it rounded? It looks like you don't, but keep that in mind.
> Simply formatting it to
> format cov4 5.3
> will show what you indicate below. Depending on how you output it to the
> other program, that may work.
> If not (if you're passing a dataset and not proc printing it or otherwise
> using output), you need to use
> cov_4 = floor(1000*cov_4)/1000
> round (floor,.001)
> the latter will actually round it, not just truncate it.
> On Tue, Mar 24, 2009 at 9:37 AM, firstname.lastname@example.org <
> email@example.com> wrote:
>> My cov_4 variable looks like
>> I want it to look like
>> I want to do this because I want to use the output file by some other