Frequently programs that use 0.1 repeatedly in a computation will run into this problem. This is because it's not possible to represent 0.1 exactly in binary, and after a few repititions the errors accumulate. Try this version of your test. Observe that the ranges created by the first data step (by adding 0.1 to the previous number) are slightly different than the values in the 2nd data step. See TS-DOC: TS-230 - Dealing with Numeric Representation Error in SAS Applications data a; eexcl='Y'; fmtname='gpa'; do i=2 to 4 by 0.1; start=i; i2 = i; end=i+0.1; label=put(start,4.2)||'-'||put(end-0.01,4.2); output; end; run; proc format cntlin=a; run; proc print data=a; format i gpa.; format i2 hex16.; run; data b; do i=2,2.6,3,3.55,4; j=i; j2 = j; output; end; run; proc print data=b; format j gpa.; format j2 hex16.; run;
... View more