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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1153 views
  • 0 likes
  • 2 in conversation