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 "
Please help!
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.
METHOD=relative Criterion=0.000000001;
for example. Try to use different criteria if necessary.
Thanks!
Method = relative option in proc compare statement helped me. Thanks once again.
Thank you.
- Dr. Abhijeet Safai
@DrAbhijeetSafai wrote:
Thanks!
Method = relative option in proc compare statement helped me. Thanks once again.
Thank you.
- Dr. Abhijeet Safai
For the benefit of the rest of us, please mark the response with the needed answer as a solution. Thank you.
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!
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.