Hi
I am trying to merge two datasets which have the same variable coded
differently in each.
In dataset 1, the variable is 6 digits, with the first digit being a zero.
in dataset 2, the same variable is 5 digits, and the first digit (which
should be a zero) as been truncated.
Does anyone know how to add a zero to the variable in the second dataset?
I take it that both matchvars are string variables. Otherwise there would
be no problem at all as the difference would be just in the formatting. If,
as you suggest, in dataset 1 there is always a zero first, its more
efficient to get rid of that one. This implies creating a str5 variable
using the string finction substr(matchvar1,2,5). See -help substr-