For SAS any number other than 0 or missing is equivalent to the logical value TRUE. When specialty is 1, specialty=1 evaluates to TRUE, then TRUE and 95 is equivalent to TRUE and TRUE which evaluates to TRUE. When specialty is 95, or anything other than 1, you end up with the equivalent of FALSE and TRUE, which is FALSE. The proper syntax is:
data specialty_code;
set master_data;
where specialty=1 or specialty=95;
run;
/* Or */
data specialty_code;
set master_data;
where specialty in (1, 95);
run;
... View more