Dear SAS community,
I had a Macro to cut every 4000 records into a new macro which later I can use them as filters in my proc sql query, my macro is as following:
%Macro test(test);
%do i=1 %to &test;
proc sql;
select distinct "'"||ID||"'" into :group&i separated by ','
from BPLCheck.padrug (firstobs=%eval(4000*(&i-1)+1) obs=%eval(4000*&i) )
quit;
%end;
%mend test;
%test(2)
However, while I call the &group1 and &group 2 within my proc sql query in the where statement,
where (id in (&group1) or (&group2))
SAS can not recognize those two macros. What did I do wrong? How can I make this work.
Any help is greatly appreciated.
Thanks