data x(index =(id));
set y;
where (code1 in ('1','2','3','4','5','6','7','8')) and code2 in ('12');
keep c1id c2 ..... c2000;/* ... is hard coded columns c3 to c1999*/
run;
proc sql;
create table w1 as
select x.c1id,c2,.....,c2000,t1.a1,.....t1.a500
from x
left join
t1
on x.id=t1.id;
index on x.id ;
run;
like above created tables w1 to w400 by changing left join tables t1 to t400
now merged all the tables w1 through w400 all by id.
data final;
merge w1 to w400;
by id;
run;
Q) tested the code fine and working for one id. But when running this code for 2 million id's it is taking longer time.
any suggestions to work this code faster?