when you use a variable in as a parameter in a macro it is definled in the local macro variable table and is not availble outside the macro. You need do define it before. %let macrovariable = Value1;
%let parameter_macrovariable = ¯ovariable;
%macro check_and_add( parameter_value =);
%let found = %sysfunc(findw(¶meter_macrovariable., ¶meter_value.));
%if &found. = 0 %then %do;
%let parameter_macrovariable = ¶meter_macrovariable. ¶meter_value.;
%put Updated list: ¶meter_macrovariable., new added value: ¶meter_value.;
%end;
%put &=parameter_macrovariable;
%mend;
%check_and_add(parameter_value = Value2)
%put &=parameter_macrovariable;
... View more