I think you can use another merge (not tested), just an idea (if by year only, not month):
tempfile f1 f2
save `f1'
keep if _merge==3
drop _merge month
duplicates drop
expand 5
sort code year, stable
by code year : replace year=year+_n-2
sort code year
save `f2'
use `f1'
drop _merge
sort code year
merge code year using `f2'