If you think it worked before perhaps the data is different? Maybe the value that looks like 1 is not exactly 1?
If is hard to tell what you want to happen. But here is a way for you to examine the impact the tests you are doing. Let's make a dummy dataset with some values of RULE and STATUS.
data results;
do rule='Rule 1','Rule 2','Other';
do status=1,2;
output;
end;
end;
run;
Now let's create some binary 1/0 variables from the various conditions you are testing.
data TEST;
set RESULTS;
r1= rule ne 'Rule 1';
r2= rule ne 'Rule 2';
r3= rule ne 'Rule 3';
s1= status ne 1;
test1= r1 and s1;
test2= r2 and s1;
test3= r3 and s1;
run;
So the R1-R3 variables are the various RULE NE xxx conditions. The S1 variable test if STATUS is no one.
Then the TEST1-TEST3 show the impact of using AND with one of the R variables and the S variables.
So TEST1 was what you original code was testing.
Obs rule status r1 r2 r3 s1 test1 test2 test3
1 Rule 1 1 0 1 1 0 0 0 0
2 Rule 1 2 0 1 1 1 0 1 1
3 Rule 2 1 1 0 1 0 0 0 0
4 Rule 2 2 1 0 1 1 1 0 1
5 Other 1 1 1 1 0 0 0 0
6 Other 2 1 1 1 1 1 1 1
So which of these 6 observations did you actually want to select?
... View more