Date: Fri, 24 Sep 2004 13:59:19 -0400
Reply-To: Steve Raimi <steven.raimi@GM.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Steve Raimi <steven.raimi@GM.COM>
Subject: Re: Numeric precision was >> Re: Oracle to SAS - subtle errors in
I don't understand how creating new formats would help me get around this.
Can you explain (or give an example)?
On Fri, 24 Sep 2004 11:40:53 -0600, Jack Hamilton
>I don't know of any way around the problem. That's why there are
>requests for an integer, fixed-point, or currency numeric type in SAS in
>addition to the floating point numbers now available.
>If you're only adding and subtracting, calculating in pennies isn't too
>difficult - you just have to create new formats to display decimal
>points correctly. It's when you start dividing or taking square roots
>that the going gets rough.
>Manager, Technical Development
>Metrics Department, First Health
>West Sacramento, California USA
>>>> "Steve Raimi" <steven.raimi@GM.COM> 09/24/2004 10:20 AM >>>
>>Store your data as pennies instead of dollars ?
>>Should be able to handle up to $90,071,992,547,409.92 without loss of
>>I might have missed it, but what happens when you sum the round of
>>amount * 100 ?
>>i.e. , sum (round (X*100)) as totalPennies
>>Do you have any precision greater than a penny to deal with (or
>>fractions of minimum unit of currency) ?
>>Richard A. DeVenezia
>Evidently, SAS can't handle up to $90,071,992,547,409.92 - that's what
>expected, but it's not working that way. The problem's not in the
>observations being added together. When I round them, the result is
>same, but truncating at the penny, tenth of penny...through
>of penny compromises the results. The problem is that the summed
>(5,033,268,614.17) overruns the precision available in 8 bytes and the
>result is shown with .24 for the pennies.
>I just got an email from SAS Tech Support recommending multiplying by
>and applying INT() (which would then conform to the 9 quadrillion
>and dividing the final result. What I'm trying to solicit is a way to
>prevent SAS novices in the group from having to make this adjustment,
>perform analyses, and then manually backing it out again.