I have two files: file1 has 300 companies, with id 1 to 300, file 2 has 600 products. How can I make a macro so that I have a file with each (300) firm with 600 products? Thanks so much!
I wrote following macro codes named time, but it does not work. (My logic is: pick out each firm first, merge it with file 2, so that I have 300 files each with 600 firms. Then I can just merge these 300 files together into what I need.)
%macro time;
data dd&i; set file1;
%do i=1 %to 300; if id_use=&i;
data final&i; merge file2 dd&i; by year quarter;
%end;
%mend time;
run;
... View more