04-06-2012 02:41 PM
I have come across a strange situation where a numeric variable is zero in both the base and compare datasets, on the matching ID, and yet they are showing up in the differences output. Below is how I've set up the compare code:
proc compare base = work.base_ds
compare = work.compare_ds
listobs listvar maxprint=(25,3000) ;
ID InternalID notsorted;
attrib _ALL_ label=''; /*Get rid of labels, formats and informats for comparison.*/
format _ALL_ ;
informat _ALL_ ;
Below is an example of the results:
|| Base Compare
InternalID || Score Score Diff. % Diff
____________ || _________ _________ _________ _________
8329 || 0 0 0 0
8331 || 0 0 0 0
04-06-2012 05:43 PM
Or try the FUZZ= option. They are probably displaying as equal because of the format an may vary by a small amount.
If your data is such that a diference such as 1e-8 is "close enough to equal" try FUZZ= 1E-8 (OR 0.00000001) or other small value.
Differences smaller than your FUZZ value will be considered equal.
04-06-2012 06:16 PM
Thanks for the input ballardw, but the "difference" still shows up when I use your fuzz factor setting, even when I use a very fuzzy factor (0.001) the "difference" still shows. : |
04-06-2012 06:35 PM
This is yielding interesting/aggrevating information. Representing the fields in HEX16. format shows that:
Base - Score = 0000000000000000
Compare - Score = 0
So, after wondering how on earth one '0' was popping up, I finally realized that I had the MISSING='0' option set!!!
I was comparing a missing value to '0' without knowing it. The HEX format really brought that to life. Thank you.
This option was buried in my process control file, and was hard to locate. Please forgive me for wasting your time!
Need further help from the community? Please ask a new question.