I am working with a set of dta
files representing surveys from different years.
Conveniently, each year uses different values for the country
Try
replace country=1 if countryO=="Japan":country0valuelabel
replace country=2 if inlist(countryO,"South Korea":country0valuelabel,"Korea":country0valuelabel)
You will have to replace country0valuelabel
with the corresponding value label name in your data. You can find out its name by looking at the penultimate column in the output of describe country0
.