The problem lies in the creation of the macro variable. It must have been created using macro quoting functions as part of the code, which means that there are extraneous characters inserted into the value of the macro variable. Usually, the software figures out what to do, which means that macro language removes those extraneous characters before passing the SAS statements to the SAS language processor. But sometimes macro language gets it wrong and doesn't figure it out in time to correctly parse the characters within the macro variable. Most notorious for having this flaw: PROC SQL, and WHERE statements. If you were to use this plain vanilla assignment (with no macro quoting functions), there should be no problem with referring to the macro variable:
%let tf_condition = UPCASE(tools) IN ("POWER TOOL1","POWER TOOL2","POWER TOOL3") ;
DATA tools;
SET tools_all;
WHERE &tf_condition.;
RUN;
... View more