This work (Macro language with SAS 😞 %Macro test_merge() ; %Do i = 1 %to 7 ; data data&i. ; Set dataset2 ; If _N_ = &i. ; run ; data data&i. ; set data&i. %do j = 2 %to 7 ; data&i. %end ; ; run ; Data total&i. ; merge dataset1 data&i. ; run ; %End; Data total ; Set total: ; run ; %mend ; %test_merge() ;
... View more