Suppose I have a dataset with variables named var1 and var1_test. I am writing a macro with input var1. Now I am looking for a way to create var1_test from var1 and the string "_test". Eventually, I want to use this variable in a where condition. I tried the following:
%macro some_name(var =);
%let var2 = %sysfunc(catx(&var., '_test'));
proc sql;
select ...
from ...
where &var2. = 1;
quit;
%mend;
%let var2 = &var._test;var2or do you want the name to bevar1_test? Or doesn't it matter as long as it can go down into theWHEREclause?