if i=0 then put 'AT ZERO';
end;
run;
Numeric Comparison Considerations
As discussed in “Computational Considerations of Fractions” on page 53, imprecision
can cause problems with computations. Imprecision can also cause problems with
comparisons. Consider the following example in which the PUT statement is not
executed:
data _null_;
x=1/3;
if x=.33333 then put 'MATCH';
run;
However, if you add the ROUND function, as in the following example, the PUT
statement is executed:
data _null_;
x=1/3;
if round(x,.00001)=.33333 then put 'MATCH';
run;
In general, if you are doing comparisons with fractional values, it is good practice to use
the ROUND function.
Storing Numbers with Less Precision
As discussed in “How SAS Stores Numeric Values” on page 49, SAS enables ...