2 weeks ago - last edited 2 weeks ago
Hi all,
I performed PROC COMPARE to a dataset, as purpose of UAT, I have to check the accuracy of the data. In the first stage, I include the data that we have and saw A LOT of discrepancies. Hence, I tried to used same dataset which been used to upload into the server, then performed PROC COMPARE, I found out, IT STILL HAVE UNEQUAL VALUES.
Through eyeball checking, the base and compare data set, does HAVE SAME VALUES. But when performing PROC COMPARE, I realized that the variables in Base data set has been rounded to a number which I dont know about.
As an example:
Base: 0.38459348 ------ Compare: 0.38459348
Output >> 0.3846 base ---- 0.38459348 >> Different: -0.00000652
How can I cater this problem? I want the base dataset to be read as it is, without rounding up any values on the Base dataset
Kindly help. Really appreciate your help!
2 weeks ago
Proc compare does not round. The data is different.
One way to do what you want may be to compare within say a thousandth.
Add options: method=absolute criterion=0.001
2 weeks ago
Tried before, and still couldn't capture that the data is actually the same. The problem only appear to the numbers in the Base dataset, which is exactly the same as the one I uploaded to compare with. Logically, it should be an equal values for all fields.
Plus, I noticed that in the output, it only have 4 decimal points max whereas my data has 8 decimal points. Any other way to cater this difference? Like letting the base data set read the way it is, which is 8 decimal points instead of just 4..?
2 weeks ago
2 weeks ago
1. Yes. Below is the example output I got:
Base ABC | Compare ABC | Diff. |
0.254 | 0.25396771 | -3.229E-05 |
0.1234 | 0.12340589 | 5.89E-05 |
As noticed, the base ABC value is rounded. From eyeball checking, the base table ABC have exactly same value and same format as Compare ABC. But when we use to compare between both table, it only compares 4 decimal places (from its actual 8 decimal points) vs 8 decimal values (as in the compare table). It didnt round up any value in compare table, but it does round up the value in the base table.
2. Yes. Format is the same. Numeric BEST12.
3. Yes. Numeric Variable.
2 weeks ago
You are doing something wrong. The comparison works fine here.
data T1;
X=0.1234;
data T2;
X=0.12340589;
proc compare data=T1 compare=T2 method=absolute criterion=0.001;
run;
Values Comparison Summary Number of Variables Compared with All Observations Equal: 1. Number of Variables Compared with Some Observations Unequal: 0. Total Number of Values which Compare Unequal: 0. Total Number of Values not EXACTLY Equal: 1. Maximum Difference: 0.00000589. |