I wish to perform merges of the following nature:

My first dataset is as follows:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(code year)
14 1999
14 1999
14 1999
14 1999
14 1999
14 1999
end
Here, I have information by code-year. In a second dataset, however, I have the following:


Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(code year)
145 1999
146 1999
146 1999
147 1999
148 1999
149 1999
end
As you can see, the variable code in the first and second dataset is the merging variable. However, I wish to perform a 1:m merge from the first dataset to the second, but merge on the first two digits of the prefix. i.e. 14*. Is there any way this can be achieved on Stata?

Many Thanks,
Chinmay