fgleric 发表于 2012-10-18 00:06 
assume you give data a and b
a is firm's characteristics, constant among 2003-2008
b is firm's ann ...
i guess Stkcd is not a unique id in either files.
clear
use a
gen id=stkcd+year //but this one can work as a unique id; say, both are string variables
sort id
save,replace
use b,clear
gen id=stkcd+year
sort id
save,replace
use a,clear
merger 1:1 id using b // i think it should be 1:1, right?
save c