I am trying to build Condition using some macro variables. tf_condition is the macro variable that holds the condition. Below is from the log.
tf_condition: UPCASE(tools) IN ("POWER TOOL1","POWER TOOL2","POWER TOOL3")
Then I use in a DATA STEP to filter the data.
DATA tools;
SET tools_all;
WHERE &tf_condition.;
RUN;
Below is the error:
WHERE &tf_condition; NOTE: Line generated by the macro variable "TF_CONDITION". 30 UPCASE(tools) IN ("POWER TOOL1","POWER TOOL2","POWER TOOL3") _ _ 22 76 ERROR: Syntax error while parsing WHERE clause. ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant, a missing value, -.
ERROR 76-322: Syntax error, statement will be ignored.
31 RUN;
If I ran the DATA step substituting value of tf_condition, then it runs fine.
I don't understand where is the problem. Please help.
... View more