Hi all,
I came across this question when trying to pull multiple datasets from the same data source. The question is how I can delimit the macro variables when the parameters are defined with multiple numeric values. Below is the example I have. When I tried to plug in the parameters with multiple values like idlist1 and idlist3, the macro cannot take it as the parameters have the same delimiter comma as that between the macro variables "datasetid" and "idlist".
%let idlist1=1111, 3333;
%let idlist2=2222;
%let idlist3=5555,6666,7777;
%macro pull_iddat(datsetid,idlist);
proc sql;
create table want_&datsetid. as
select *
from libdat.datset_a a
inner join libdat.datset_b b on a.joinid = b.joinid
and b.idvar in (&idlist.)
;quit;
%mend;
%pull_iddat(11,&idlist1.);
%pull_iddat(22,&idlist2.);
%pull_iddat(33,&idlist3.);
Can anyone help?
Thanks a lot!
Lizi
... View more