BookmarkSubscribeRSS Feed
OS2Rules
Obsidian | Level 7

Hi All:

We are in the midst of converting from SAS 9.1 to SAS 9.3.  As part of the process we are running sample programs on both systems

with the same data and comparing the results.  All the results are in SAS tables.

In one such test there were some errors in the figures where the difference is very small - in the order of 1.3E-13.  I know that these

values would affect the outcome because the figures are dollars and cents, but I'm wondering why there is a difference in the first

place?  Is this something with version of SAS or perhaps I need to change a option?

I one such case I have over 2 million records in each table and only 1 record is unequal and the difference is -1.31E-14.

Thanks in advance.

4 REPLIES 4
Doc_Duke
Rhodochrosite | Level 12

Perhaps reviewing these two documents will resolve it for you

https://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/base_lrconcept_9196.pdf

SAS(R) 9.3 Language Reference: Concepts, Second Edition

E-13 is in the range where the floating point processor can produce random errors.

SASKiwi
PROC Star

If you are using PROC COMPARE to confirm if two SAS tables are the same or not, when you use METHOD = EXACT it is likely to report the very small floating point differences you are seeing. Try METHOD = ABSOLUTE instead and SAS will ignore differences in the precision range.

OS2Rules
Obsidian | Level 7

SASWiki:

Using METHOD=ABSOLUTE resulted in the same error, but METHOD=RELATIVE passed the record.  Seems that the

field in error is 3.72E12 and has a difference of .000488 between files.  This is above the CRITERION value of .00001 so

that is why the fields are different.

I must add that the 2 tables were created on 2 different machines running 2 different versions of SAS with different

bitness (on x32 the other x64).  I think this contributes to the why some random numbers are a little out of sync.

Thanks.

SASKiwi
PROC Star

METHOD = ABSOLUTE works for me but I am comparing within the same operating system and my differences are 1E-14 and smaller. Tweeking the CRITERION should give you what you require if you want to avoid reporting "large small differences".

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 4 replies
  • 873 views
  • 3 likes
  • 3 in conversation