12-16-2016 02:19 AM
I am running proc compare on two datasets which are excatly same, but it is still reporting mismatches.
seems something like the difference is due to format difference in both the dataset.
Obs || Base Compare Diff. % Diff
______|| _________ _________ _________ _________
99 || 1.5714 1.5714 -2.22E-16 -1.41E-14
100 || 1.5714 1.5714 -2.22E-16 -1.41E-14
107 || 1.5714 1.5714 -2.22E-16 -1.41E-14
how can i solve this is issue as i need to report that both the datasets are exactly same, hence cant use the option,
" method=absolute "
12-16-2016 02:31 AM
These differences are artifacts of the way SAS store numbers.
Numerical Accuracy in SAS is a good starter.
If you moved a dataset from z/OS to another platform, the internal format of the 8-byte real number changes slightly (less bits in the mantissa, more in the exponent). When fractions are present, the inaccuracy inherent in the real number format is increased, and that causes the differences.
Use a proper round() function to cut off the unimportant digits before comparing.
I had to deal with that effect when moving old data originating from DB/2 on z/OS to a UNIX environment. Back then, DB/2 used timestamps with 6 digits after the comma as primary keys. After the transfer, exactly half of the keys did not match those keys that were newly imported from unload files on UNIX, indicating a one-bit accuracy loss.