Using the idea provided by @Tom the following code creates a dataset using the names entered in the prompt:
data work.selected_customer;
length
cust_name $ 50
;
%if &resident_customer_count = 1 %then %do;
cust_name = "&resident_customer";
output;
%end;
%else %do;
do i = 1 to &resident_customer_count;
cust_name = symget(cats("resident_customer", i));
output;
end;
%end;
drop i;
run;
And a small demonstration of the usage together with sashelp.class, because i am to lazy to make up a dataset with four name-variables:
proc sql;
select c.*
from sashelp.class as c, work.selected_customer as s
where find(c.Name, s.cust_Name, 'it')
;
quit;
... View more