BookmarkSubscribeRSS Feed
deleted_user
Not applicable
HI,

As I try to reconcile the data in Oracle (through SAS/Oracle) and SAS, I found there is slightly a very very small difference in the sum of numeric variables in both side.

Sample Codes:
PROC SUMMARY DATA = ORALib.inData NWAY MISSING;
VAR amount ;
OUTPUT OUT = inData_ORA (DROP =_TYPE_)
SUM=;
RUN;

PROC SUMMARY DATA = SASLib.inData NWAY MISSING;
VAR amount ;
OUTPUT OUT = inData_SAS (DROP =_TYPE_)
SUM=;
RUN;


Variable Oracle Amt Sum SAS Amt Sum Difference
AMOUNT 68726887.00 68726887.00 -.000000030

I suspect that SAS truncate some of the values of the numeric variables when I PROC SUMMARY straight into the Oracle Library. I understand this is very small difference but is there any way I avoid this different to happen? I tried LENGTH amount 8 but it does not really seem to solve the problem. What do you think if using INFORMAT rb8. in for PROC SUMMARY statement?

Thanks.
Jason@Aus
2 REPLIES 2
David_SAS
SAS Employee
Our PROC SUMMARY expert in R&D says:

[pre]
Unfortunately, there's no simple answer as to why they're getting slightly different sums when reading directly from Oracle vs reading a copy of the data.
[/pre]

I'm sorry that we couldn't be of more help.

-- David Kelley, SAS
deleted_user
Not applicable
> HI,
>
> As I try to reconcile
> SAS/Oracle) and SAS, I found very
> very small difference in the sum of numeric
.....

> Variable Oracle Amt Sum SAS Amt Sum Difference
> AMOUNT 68726887.00 68726887.00
> -.000000030
>
> I suspect that SAS truncate
> numeric variables when I PROC SUMMARY
> this is very small
> is there any way I avoid this
.....
> Thanks.
> Jason@Aus

When is it important to eliminate differences in values that occur beyond 15 significant digits ?

SAS Real Numbers cannot support greater precision.

Be glad you are in SAS. Put a 16 digit credit card number into excel, and watch the 16th become zero !

Peter

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1220 views
  • 0 likes
  • 2 in conversation