[prev in list] [next in list] [prev in thread] [next in thread]
List: sas-l
Subject: Re: SAS-L Digest - 30 Sep 2020 - Special issue (#2020-665)
From: Tim Berryhill <000008c2afdd9bfa-dmarc-request () LISTSERV ! UGA ! EDU>
Date: 2020-09-30 19:53:57
Message-ID: 08acfe83f5914978bc721c47a6d57074 () wellsfargo ! com
[Download RAW message or body]
Jack, I suspect that is just the default 12.2 numeric format. Once you have eleven \
digits left of the decimal, they omit the decimal (and the trailing pennies). Try \
formatting pay 14.2 in the final print. Been there, done that, remember the fix!
Tim
-----Original Message-----
Date: Wed, 30 Sep 2020 19:17:16 +0000
From: Jack Clark <jclark@HILLTOP.UMBC.EDU>
Subject: Re: Numeric Precision
Hello,
I posted the numeric precision question last week, and am still stumped on what is \
going on with the data I am working with. I am reading hospital claims data from a \
SAS data set with a variable called PAY_AMT. It is the payment amount for each claim \
in dollars and cents. When I look at the data it has 2 decimal places.
I limit the data to the claims I need and then sum up the PAY_AMT variable (I am \
using PROC SUMMARY with the SUM function, but did not have any different results \
using PROC SUMMARY). What I find is that when the sum is at least 10 billion \
(10,000,000,000), I do not get any decimal places in the sum. It is always a whole \
number. This does not seem right to me.
If feel like I am missing something simple here, but this example shows the same \
behavior. What happens to the decimals?
data test;
pay_amt = 10444555666.25; output;
pay_amt = 10222333444.26; output;
pay_amt = 10111222333.26; output;
;
run;
proc print data = test;
run;
proc sql;
create table test2 as
select sum(pay_amt) as pay
from test
;
quit;
proc print data = test2;
run;
Jack Clark
Manager of Technical Innovation and Automation
The Hilltop Institute
410-455-6256
jclark@hilltop.umbc.edu<mailto:jclark@hilltop.umbc.edu>
follow us [https://hilltopinstitute.org/images/twitterteal.png] \
<https://twitter.com/hilltopinstitut> \
[https://hilltopinstitute.org/images/linkedinteal.png] \
<https://www.linkedin.com/company/the-hilltop-institute-at-umbc/>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic