Hi Guys, I’ve created some stand-alone code in a test file to illustrate some unexpected behavior that I am getting. We have 2 values, ‘a’ and ‘b’, with the ‘b’ column equal to the value of a-0.0001 I then create a flag to compare the column b with a calculation of a-0.0001 and flag as LT, EQ or GT b. Here is the stand-alone test data and code: data test; input a b; datalines; 10.0002 10.0001 9.9999 9.9998 9.8747 9.8746 8.8747 8.8746 7.8747 7.8746 6.8747 6.8746 5.8747 5.8746 4.8747 4.8746 3.8747 3.8746 2.8747 2.8746 1.8747 1.8746 0.8747 0.8746 ; run; data test; set test; a_minus_0001=a-0.0001; if b lt a-0.0001 then b_vs_a_minus_0001='LT'; else if b eq a-0.0001 then b_vs_a_minus_0001='EQ'; else if b gt a-0.0001 then b_vs_a_minus_0001='GT'; run; The result is quite strange/terrifying. As you can see, all results should flag as EQ, but some flag as GT and others flag as LT: If anyone could have a little look at this and see if they can add any info. We get the correct results if we force a round to 4 decimal places, but that would not be something that you would intuitively so. I'm stumped with this functionality… Any help gratefully appreciated. Thank you.
... View more