Hello everyone, I did a proc sql left join on many tables using a loop but it took too many time to perform since I got pretty big tables, so I wondered if there is a better way to do it. I got 12 tables with same variable ID and other numbered variables : Table 1 has ID, A_1,B_1,C_1 as variables Table 2 has ID, A_2, B_2, C_2 as variables ... Table i has ID, A_i ,B_i, C_i as variables for i from 3 to 12. I would like to have a single table which is the result of a left join of all those tables : ID,A_1,B_1,C_1, A_2,B_2,C_2....A_12,B_12_C12 . Down below is an example of a macro i use for it. %macro join(); %do j= 2 %to 12 ; proc sql; create table table1 as select a.*, b.* from table1 as a left join table&j as b on a.id=b.id ; quit; %end; %mend; Thiss gives me a result but it took too long if I have huge tables( around 20 millions of rows). Thanks in advance.
... View more