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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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