Use value label in if command

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.


To complement @Dimitriy's answer:

clear all
set more off

sysuse auto
keep foreign weight

describe foreign
label list origin

replace weight = . if foreign == 0

list in 1/15
list in 1/15, nolabel 

describe displays the value label associated with a variable. label list can show the content of a particular value label.

Tags:

Stata