This is a numeric precision problem, not a SAS problem. It will happen with all computing software using floating point arithmetic (which needs to be the case given that 0.1 is the do loop increment.
For instance, the loop
do factor1=0 to 1 by 0.1;
will NOT produce factor1=1, because at least one of the values 0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9 can not be exactly represented using floating point arithmetic.
Therefore none of the factor combinations that should have two zeroes and a one will not appear. The same will happen with some of the other combinations.
I suggest you use
do factor=0 to 10 by 1;
The program below will then produce 66 observations:
data have;
do factor1 = 0 to 10 by 1;
do factor2 = 0 to 10 by 1;
do factor3 = 0 to 10 by 1;
output;
end;
end;
end;
run;
/*The data set WORK.HAVE has 1331 observations and 3 variables*/
data weight_schedule; set have;
if factor1 + factor2 + factor3 = 10;
run;
If you want, you can divide the factors, and their sums by 10 AFTER you do the filtering.
Editted addition:
PS: It's more than just the representation of numbers, it's the sequence of adding.
For instance, 0.1+0.1+0.8 (factor1+factor2+factor3) appears in WEIGHT_SCHEDULE, but 0.1+0.8+0.1 and 0.8+0.1+0.1 do not. I.e. 0.1+0.8 (in either order) does not generate the exact representation of 0.9.
... View more