Hi,
I am trying to test two datasets to make sure both are same. I am using OUTNOEQUAL option to not report the matching values in the output. But somehow its still showing up. Any leads?
Attached is the outuput i am getting.
Regards,
This is because of the way numbers are stored on the machine. What you are seeing is one or the other (or possibly both) have a tiny fraction, for example:
123.0000000000000001
versus
123.00
You don't necessarily see this directly in the dataset and is usually the result of mathematical operations where the result is not rounded/processed properly.
Try fuzz=
as given in this post:
And if your interested in it the full explanation:
if you simply want to test if two data sets are exactly the same, then use PROC COMPARE and the generated &sysinfo. macro variable. The value of &sysinfo. will be zero for matching data sets.
Thanks for your inputs.
This is because of the way numbers are stored on the machine. What you are seeing is one or the other (or possibly both) have a tiny fraction, for example:
123.0000000000000001
versus
123.00
You don't necessarily see this directly in the dataset and is usually the result of mathematical operations where the result is not rounded/processed properly.
Try fuzz=
as given in this post:
And if your interested in it the full explanation:
Thanks a lot RW9. it worked perfectly.
Many thanks again !
Hi,
Also to check for Date values. I have two variables defined as Date9. and Datetime20. which obviously give difference. But is there any way to match these. Do i need to convert the format of any of the variable to match it. Or any option in Proc compare is there?
Please suggest.
Regards,
Its a good idea to start a new thread for new questions
I don think there is an option for that. Dates and datetimes are actually numbers, number of days or seconds since a certain point in time, hence they are very different. You can only compare like for like.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.