I have the code foreach, I do not know while it work in one case and does not work in another case.

The case it works is:

Code:
gen smallcountry = 0
foreach smallcountry_ in ZAMBIA ECUADOR ESTONIA CZECH ///
                ICELAND KENYA  LATVIA LITHUANIA ///
                LUXEMBOURG SLOVAKIA VENEZUELA{
    replace smallcountry = 1 if GEOGN == "`smallcountry_'"   
}
But in this code, it return error even the structure of two codes are almost the same


Code:
gen oecd = 0
foreach oecd_ in AUSTRIA  BELGIUM CANADA DENMARK FRANCE GERMANY  GREECE ///
                ICELAND IRELAND ITALY LUXEMBOURG NETHERLANDS NORWAY PORTUGAL SPAIN///
                SWEDEN SWITZERLAND TURKEY UNITEDK UNITEDS{
    replace oecd = 1 if GEOGN == "`oecd_'"   
}
Code:
. foreach oecd_ in AUSTRIA  BELGIUM CANADA DENMARK FRANCE GERMANY  GREECE ///
>                 ICELAND IRELAND ITALY LUXEMBOURG NETHERLANDS NORWAY PORTUGAL SPAIN///
{ required
Can you please help me to sort it out?
Thanks.