I have 2 files sortcompustat-contains financial data (65929 obs) sortedmain_vwretd200-contains calculated indexes (53539 obs) I want to merge these 2 files, using their permno (company code) and financial year. lpermno of sortcompustat = permno of sortedmain_vwretd200 fyear of both files are the same. I have used the following proc sql steps, however the output adv_vwretd has 463498 observations having duplicate merging: proc sql; create table adv_vwretd as select a.* , b.* from sorted_main_vwretd200 a left join sortcompustat b on a.permno=b.lpermno order by permno, fyear; run; how do i merge the two files with 1 permno for each financial year would contain 1 observation?
... View more