*! _incomelevel_iso2 <3 Mar 2019 : 20:52:10>                 by João Pedro Azevedo
*                 auto generated and updated using _update_countrymetadata.ado

 program define _incomelevel_iso2

     syntax , match(varname)

*********************

         gen incomelevel_iso2 = ""
         replace incomelevel_iso2 = "XD"  if `match' == "ABW"
         replace incomelevel_iso2 = "XM"  if `match' == "AFG"
         replace incomelevel_iso2 = "NA"  if `match' == "AFR"
         replace incomelevel_iso2 = "XN"  if `match' == "AGO"
         replace incomelevel_iso2 = "XT"  if `match' == "ALB"
         replace incomelevel_iso2 = "XD"  if `match' == "AND"
         replace incomelevel_iso2 = "NA"  if `match' == "ANR"
         replace incomelevel_iso2 = "NA"  if `match' == "ARB"
         replace incomelevel_iso2 = "XD"  if `match' == "ARE"
         replace incomelevel_iso2 = "XD"  if `match' == "ARG"
         replace incomelevel_iso2 = "XT"  if `match' == "ARM"
         replace incomelevel_iso2 = "XT"  if `match' == "ASM"
         replace incomelevel_iso2 = "XD"  if `match' == "ATG"
         replace incomelevel_iso2 = "XD"  if `match' == "AUS"
         replace incomelevel_iso2 = "XD"  if `match' == "AUT"
         replace incomelevel_iso2 = "XT"  if `match' == "AZE"
         replace incomelevel_iso2 = "XM"  if `match' == "BDI"
         replace incomelevel_iso2 = "NA"  if `match' == "BEA"
         replace incomelevel_iso2 = "NA"  if `match' == "BEC"
         replace incomelevel_iso2 = "XD"  if `match' == "BEL"
         replace incomelevel_iso2 = "XM"  if `match' == "BEN"
         replace incomelevel_iso2 = "XM"  if `match' == "BFA"
         replace incomelevel_iso2 = "XN"  if `match' == "BGD"
         replace incomelevel_iso2 = "XT"  if `match' == "BGR"
         replace incomelevel_iso2 = "NA"  if `match' == "BHI"
         replace incomelevel_iso2 = "XD"  if `match' == "BHR"
         replace incomelevel_iso2 = "XD"  if `match' == "BHS"
         replace incomelevel_iso2 = "XT"  if `match' == "BIH"
         replace incomelevel_iso2 = "NA"  if `match' == "BLA"
         replace incomelevel_iso2 = "XT"  if `match' == "BLR"
         replace incomelevel_iso2 = "XT"  if `match' == "BLZ"
         replace incomelevel_iso2 = "NA"  if `match' == "BMN"
         replace incomelevel_iso2 = "XD"  if `match' == "BMU"
         replace incomelevel_iso2 = "XN"  if `match' == "BOL"
         replace incomelevel_iso2 = "XT"  if `match' == "BRA"
         replace incomelevel_iso2 = "XD"  if `match' == "BRB"
         replace incomelevel_iso2 = "XD"  if `match' == "BRN"
         replace incomelevel_iso2 = "NA"  if `match' == "BSS"
         replace incomelevel_iso2 = "XN"  if `match' == "BTN"
         replace incomelevel_iso2 = "XT"  if `match' == "BWA"
         replace incomelevel_iso2 = "NA"  if `match' == "CAA"
         replace incomelevel_iso2 = "XM"  if `match' == "CAF"
         replace incomelevel_iso2 = "XD"  if `match' == "CAN"
         replace incomelevel_iso2 = "NA"  if `match' == "CEA"
         replace incomelevel_iso2 = "NA"  if `match' == "CEB"
         replace incomelevel_iso2 = "NA"  if `match' == "CEU"
         replace incomelevel_iso2 = "XD"  if `match' == "CHE"
         replace incomelevel_iso2 = "XD"  if `match' == "CHI"
         replace incomelevel_iso2 = "XD"  if `match' == "CHL"
         replace incomelevel_iso2 = "XT"  if `match' == "CHN"
         replace incomelevel_iso2 = "XN"  if `match' == "CIV"
         replace incomelevel_iso2 = "NA"  if `match' == "CLA"
         replace incomelevel_iso2 = "NA"  if `match' == "CME"
         replace incomelevel_iso2 = "XN"  if `match' == "CMR"
         replace incomelevel_iso2 = "XM"  if `match' == "COD"
         replace incomelevel_iso2 = "XN"  if `match' == "COG"
         replace incomelevel_iso2 = "XT"  if `match' == "COL"
         replace incomelevel_iso2 = "XM"  if `match' == "COM"
         replace incomelevel_iso2 = "XN"  if `match' == "CPV"
         replace incomelevel_iso2 = "XT"  if `match' == "CRI"
         replace incomelevel_iso2 = "NA"  if `match' == "CSA"
         replace incomelevel_iso2 = "NA"  if `match' == "CSS"
         replace incomelevel_iso2 = "XT"  if `match' == "CUB"
         replace incomelevel_iso2 = "XD"  if `match' == "CUW"
         replace incomelevel_iso2 = "XD"  if `match' == "CYM"
         replace incomelevel_iso2 = "XD"  if `match' == "CYP"
         replace incomelevel_iso2 = "XD"  if `match' == "CZE"
         replace incomelevel_iso2 = "NA"  if `match' == "DEA"
         replace incomelevel_iso2 = "NA"  if `match' == "DEC"
         replace incomelevel_iso2 = "XD"  if `match' == "DEU"
         replace incomelevel_iso2 = "NA"  if `match' == "DFS"
         replace incomelevel_iso2 = "XN"  if `match' == "DJI"
         replace incomelevel_iso2 = "NA"  if `match' == "DLA"
         replace incomelevel_iso2 = "XT"  if `match' == "DMA"
         replace incomelevel_iso2 = "NA"  if `match' == "DMN"
         replace incomelevel_iso2 = "NA"  if `match' == "DNF"
         replace incomelevel_iso2 = "XD"  if `match' == "DNK"
         replace incomelevel_iso2 = "NA"  if `match' == "DNS"
         replace incomelevel_iso2 = "XT"  if `match' == "DOM"
         replace incomelevel_iso2 = "NA"  if `match' == "DSA"
         replace incomelevel_iso2 = "NA"  if `match' == "DSF"
         replace incomelevel_iso2 = "NA"  if `match' == "DSS"
         replace incomelevel_iso2 = "NA"  if `match' == "DXS"
         replace incomelevel_iso2 = "XT"  if `match' == "DZA"
         replace incomelevel_iso2 = "NA"  if `match' == "EAP"
         replace incomelevel_iso2 = "NA"  if `match' == "EAR"
         replace incomelevel_iso2 = "NA"  if `match' == "EAS"
         replace incomelevel_iso2 = "NA"  if `match' == "ECA"
         replace incomelevel_iso2 = "NA"  if `match' == "ECS"
         replace incomelevel_iso2 = "XT"  if `match' == "ECU"
         replace incomelevel_iso2 = "XN"  if `match' == "EGY"
         replace incomelevel_iso2 = "NA"  if `match' == "EMU"
         replace incomelevel_iso2 = "XM"  if `match' == "ERI"
         replace incomelevel_iso2 = "XD"  if `match' == "ESP"
         replace incomelevel_iso2 = "XD"  if `match' == "EST"
         replace incomelevel_iso2 = "XM"  if `match' == "ETH"
         replace incomelevel_iso2 = "NA"  if `match' == "EUU"
         replace incomelevel_iso2 = "NA"  if `match' == "FCS"
         replace incomelevel_iso2 = "XD"  if `match' == "FIN"
         replace incomelevel_iso2 = "XT"  if `match' == "FJI"
         replace incomelevel_iso2 = "XD"  if `match' == "FRA"
         replace incomelevel_iso2 = "XD"  if `match' == "FRO"
         replace incomelevel_iso2 = "XN"  if `match' == "FSM"
         replace incomelevel_iso2 = "NA"  if `match' == "FXS"
         replace incomelevel_iso2 = "XT"  if `match' == "GAB"
         replace incomelevel_iso2 = "XD"  if `match' == "GBR"
         replace incomelevel_iso2 = "XN"  if `match' == "GEO"
         replace incomelevel_iso2 = "XN"  if `match' == "GHA"
         replace incomelevel_iso2 = "XD"  if `match' == "GIB"
         replace incomelevel_iso2 = "XM"  if `match' == "GIN"
         replace incomelevel_iso2 = "XM"  if `match' == "GMB"
         replace incomelevel_iso2 = "XM"  if `match' == "GNB"
         replace incomelevel_iso2 = "XT"  if `match' == "GNQ"
         replace incomelevel_iso2 = "XD"  if `match' == "GRC"
         replace incomelevel_iso2 = "XT"  if `match' == "GRD"
         replace incomelevel_iso2 = "XD"  if `match' == "GRL"
         replace incomelevel_iso2 = "XT"  if `match' == "GTM"
         replace incomelevel_iso2 = "XD"  if `match' == "GUM"
         replace incomelevel_iso2 = "XT"  if `match' == "GUY"
         replace incomelevel_iso2 = "NA"  if `match' == "HIC"
         replace incomelevel_iso2 = "XD"  if `match' == "HKG"
         replace incomelevel_iso2 = "XN"  if `match' == "HND"
         replace incomelevel_iso2 = "NA"  if `match' == "HPC"
         replace incomelevel_iso2 = "XD"  if `match' == "HRV"
         replace incomelevel_iso2 = "XM"  if `match' == "HTI"
         replace incomelevel_iso2 = "XD"  if `match' == "HUN"
         replace incomelevel_iso2 = "NA"  if `match' == "IBB"
         replace incomelevel_iso2 = "NA"  if `match' == "IBD"
         replace incomelevel_iso2 = "NA"  if `match' == "IBT"
         replace incomelevel_iso2 = "NA"  if `match' == "IDA"
         replace incomelevel_iso2 = "NA"  if `match' == "IDB"
         replace incomelevel_iso2 = "XN"  if `match' == "IDN"
         replace incomelevel_iso2 = "NA"  if `match' == "IDX"
         replace incomelevel_iso2 = "XD"  if `match' == "IMN"
         replace incomelevel_iso2 = "XN"  if `match' == "IND"
         replace incomelevel_iso2 = "NA"  if `match' == "INX"
         replace incomelevel_iso2 = "XD"  if `match' == "IRL"
         replace incomelevel_iso2 = "XT"  if `match' == "IRN"
         replace incomelevel_iso2 = "XT"  if `match' == "IRQ"
         replace incomelevel_iso2 = "XD"  if `match' == "ISL"
         replace incomelevel_iso2 = "XD"  if `match' == "ISR"
         replace incomelevel_iso2 = "XD"  if `match' == "ITA"
         replace incomelevel_iso2 = "XT"  if `match' == "JAM"
         replace incomelevel_iso2 = "XT"  if `match' == "JOR"
         replace incomelevel_iso2 = "XD"  if `match' == "JPN"
         replace incomelevel_iso2 = "XT"  if `match' == "KAZ"
         replace incomelevel_iso2 = "XN"  if `match' == "KEN"
         replace incomelevel_iso2 = "XN"  if `match' == "KGZ"
         replace incomelevel_iso2 = "XN"  if `match' == "KHM"
         replace incomelevel_iso2 = "XN"  if `match' == "KIR"
         replace incomelevel_iso2 = "XD"  if `match' == "KNA"
         replace incomelevel_iso2 = "XD"  if `match' == "KOR"
         replace incomelevel_iso2 = "XD"  if `match' == "KWT"
         replace incomelevel_iso2 = "NA"  if `match' == "LAC"
         replace incomelevel_iso2 = "XN"  if `match' == "LAO"
         replace incomelevel_iso2 = "XT"  if `match' == "LBN"
         replace incomelevel_iso2 = "XM"  if `match' == "LBR"
         replace incomelevel_iso2 = "XT"  if `match' == "LBY"
         replace incomelevel_iso2 = "XT"  if `match' == "LCA"
         replace incomelevel_iso2 = "NA"  if `match' == "LCN"
         replace incomelevel_iso2 = "NA"  if `match' == "LCR"
         replace incomelevel_iso2 = "NA"  if `match' == "LDC"
         replace incomelevel_iso2 = "NA"  if `match' == "LIC"
         replace incomelevel_iso2 = "XD"  if `match' == "LIE"
         replace incomelevel_iso2 = "XN"  if `match' == "LKA"
         replace incomelevel_iso2 = "NA"  if `match' == "LMC"
         replace incomelevel_iso2 = "NA"  if `match' == "LMY"
         replace incomelevel_iso2 = "XN"  if `match' == "LSO"
         replace incomelevel_iso2 = "NA"  if `match' == "LTE"
         replace incomelevel_iso2 = "XD"  if `match' == "LTU"
         replace incomelevel_iso2 = "XD"  if `match' == "LUX"
         replace incomelevel_iso2 = "XD"  if `match' == "LVA"
         replace incomelevel_iso2 = "XD"  if `match' == "MAC"
         replace incomelevel_iso2 = "XD"  if `match' == "MAF"
         replace incomelevel_iso2 = "XN"  if `match' == "MAR"
         replace incomelevel_iso2 = "NA"  if `match' == "MCA"
         replace incomelevel_iso2 = "XD"  if `match' == "MCO"
         replace incomelevel_iso2 = "XN"  if `match' == "MDA"
         replace incomelevel_iso2 = "NA"  if `match' == "MDE"
         replace incomelevel_iso2 = "XM"  if `match' == "MDG"
         replace incomelevel_iso2 = "XT"  if `match' == "MDV"
         replace incomelevel_iso2 = "NA"  if `match' == "MEA"
         replace incomelevel_iso2 = "XT"  if `match' == "MEX"
         replace incomelevel_iso2 = "XT"  if `match' == "MHL"
         replace incomelevel_iso2 = "NA"  if `match' == "MIC"
         replace incomelevel_iso2 = "XT"  if `match' == "MKD"
         replace incomelevel_iso2 = "XM"  if `match' == "MLI"
         replace incomelevel_iso2 = "XD"  if `match' == "MLT"
         replace incomelevel_iso2 = "XN"  if `match' == "MMR"
         replace incomelevel_iso2 = "NA"  if `match' == "MNA"
         replace incomelevel_iso2 = "XT"  if `match' == "MNE"
         replace incomelevel_iso2 = "XN"  if `match' == "MNG"
         replace incomelevel_iso2 = "XD"  if `match' == "MNP"
         replace incomelevel_iso2 = "XM"  if `match' == "MOZ"
         replace incomelevel_iso2 = "XN"  if `match' == "MRT"
         replace incomelevel_iso2 = "XT"  if `match' == "MUS"
         replace incomelevel_iso2 = "XM"  if `match' == "MWI"
         replace incomelevel_iso2 = "XT"  if `match' == "MYS"
         replace incomelevel_iso2 = "NA"  if `match' == "NAC"
         replace incomelevel_iso2 = "NA"  if `match' == "NAF"
         replace incomelevel_iso2 = "XT"  if `match' == "NAM"
         replace incomelevel_iso2 = "XD"  if `match' == "NCL"
         replace incomelevel_iso2 = "XM"  if `match' == "NER"
         replace incomelevel_iso2 = "XN"  if `match' == "NGA"
         replace incomelevel_iso2 = "XN"  if `match' == "NIC"
         replace incomelevel_iso2 = "XD"  if `match' == "NLD"
         replace incomelevel_iso2 = "NA"  if `match' == "NLS"
         replace incomelevel_iso2 = "XD"  if `match' == "NOR"
         replace incomelevel_iso2 = "XM"  if `match' == "NPL"
         replace incomelevel_iso2 = "NA"  if `match' == "NRS"
         replace incomelevel_iso2 = "XT"  if `match' == "NRU"
         replace incomelevel_iso2 = "NA"  if `match' == "NXS"
         replace incomelevel_iso2 = "XD"  if `match' == "NZL"
         replace incomelevel_iso2 = "NA"  if `match' == "OED"
         replace incomelevel_iso2 = "XD"  if `match' == "OMN"
         replace incomelevel_iso2 = "NA"  if `match' == "OSS"
         replace incomelevel_iso2 = "XN"  if `match' == "PAK"
         replace incomelevel_iso2 = "XD"  if `match' == "PAN"
         replace incomelevel_iso2 = "XT"  if `match' == "PER"
         replace incomelevel_iso2 = "XN"  if `match' == "PHL"
         replace incomelevel_iso2 = "XD"  if `match' == "PLW"
         replace incomelevel_iso2 = "XN"  if `match' == "PNG"
         replace incomelevel_iso2 = "XD"  if `match' == "POL"
         replace incomelevel_iso2 = "NA"  if `match' == "PRE"
         replace incomelevel_iso2 = "XD"  if `match' == "PRI"
         replace incomelevel_iso2 = "XM"  if `match' == "PRK"
         replace incomelevel_iso2 = "XD"  if `match' == "PRT"
         replace incomelevel_iso2 = "XT"  if `match' == "PRY"
         replace incomelevel_iso2 = "XN"  if `match' == "PSE"
         replace incomelevel_iso2 = "NA"  if `match' == "PSS"
         replace incomelevel_iso2 = "NA"  if `match' == "PST"
         replace incomelevel_iso2 = "XD"  if `match' == "PYF"
         replace incomelevel_iso2 = "XD"  if `match' == "QAT"
         replace incomelevel_iso2 = "XT"  if `match' == "ROU"
         replace incomelevel_iso2 = "NA"  if `match' == "RRS"
         replace incomelevel_iso2 = "NA"  if `match' == "RSO"
         replace incomelevel_iso2 = "XT"  if `match' == "RUS"
         replace incomelevel_iso2 = "XM"  if `match' == "RWA"
         replace incomelevel_iso2 = "NA"  if `match' == "SAS"
         replace incomelevel_iso2 = "XD"  if `match' == "SAU"
         replace incomelevel_iso2 = "NA"  if `match' == "SCE"
         replace incomelevel_iso2 = "XN"  if `match' == "SDN"
         replace incomelevel_iso2 = "XM"  if `match' == "SEN"
         replace incomelevel_iso2 = "XD"  if `match' == "SGP"
         replace incomelevel_iso2 = "XN"  if `match' == "SLB"
         replace incomelevel_iso2 = "XM"  if `match' == "SLE"
         replace incomelevel_iso2 = "XN"  if `match' == "SLV"
         replace incomelevel_iso2 = "XD"  if `match' == "SMR"
         replace incomelevel_iso2 = "XM"  if `match' == "SOM"
         replace incomelevel_iso2 = "XT"  if `match' == "SRB"
         replace incomelevel_iso2 = "NA"  if `match' == "SSA"
         replace incomelevel_iso2 = "XM"  if `match' == "SSD"
         replace incomelevel_iso2 = "NA"  if `match' == "SSF"
         replace incomelevel_iso2 = "NA"  if `match' == "SST"
         replace incomelevel_iso2 = "XN"  if `match' == "STP"
         replace incomelevel_iso2 = "XT"  if `match' == "SUR"
         replace incomelevel_iso2 = "XD"  if `match' == "SVK"
         replace incomelevel_iso2 = "XD"  if `match' == "SVN"
         replace incomelevel_iso2 = "XD"  if `match' == "SWE"
         replace incomelevel_iso2 = "XN"  if `match' == "SWZ"
         replace incomelevel_iso2 = "XD"  if `match' == "SXM"
         replace incomelevel_iso2 = "NA"  if `match' == "SXZ"
         replace incomelevel_iso2 = "XD"  if `match' == "SYC"
         replace incomelevel_iso2 = "XM"  if `match' == "SYR"
         replace incomelevel_iso2 = "XD"  if `match' == "TCA"
         replace incomelevel_iso2 = "XM"  if `match' == "TCD"
         replace incomelevel_iso2 = "NA"  if `match' == "TEA"
         replace incomelevel_iso2 = "NA"  if `match' == "TEC"
         replace incomelevel_iso2 = "XM"  if `match' == "TGO"
         replace incomelevel_iso2 = "XT"  if `match' == "THA"
         replace incomelevel_iso2 = "XM"  if `match' == "TJK"
         replace incomelevel_iso2 = "XT"  if `match' == "TKM"
         replace incomelevel_iso2 = "NA"  if `match' == "TLA"
         replace incomelevel_iso2 = "XN"  if `match' == "TLS"
         replace incomelevel_iso2 = "NA"  if `match' == "TMN"
         replace incomelevel_iso2 = "XT"  if `match' == "TON"
         replace incomelevel_iso2 = "NA"  if `match' == "TSA"
         replace incomelevel_iso2 = "NA"  if `match' == "TSS"
         replace incomelevel_iso2 = "XD"  if `match' == "TTO"
         replace incomelevel_iso2 = "XN"  if `match' == "TUN"
         replace incomelevel_iso2 = "XT"  if `match' == "TUR"
         replace incomelevel_iso2 = "XT"  if `match' == "TUV"
         replace incomelevel_iso2 = "XD"  if `match' == "TWN"
         replace incomelevel_iso2 = "XM"  if `match' == "TZA"
         replace incomelevel_iso2 = "XM"  if `match' == "UGA"
         replace incomelevel_iso2 = "XN"  if `match' == "UKR"
         replace incomelevel_iso2 = "NA"  if `match' == "UMC"
         replace incomelevel_iso2 = "XD"  if `match' == "URY"
         replace incomelevel_iso2 = "XD"  if `match' == "USA"
         replace incomelevel_iso2 = "XN"  if `match' == "UZB"
         replace incomelevel_iso2 = "XT"  if `match' == "VCT"
         replace incomelevel_iso2 = "XT"  if `match' == "VEN"
         replace incomelevel_iso2 = "XD"  if `match' == "VGB"
         replace incomelevel_iso2 = "XD"  if `match' == "VIR"
         replace incomelevel_iso2 = "XN"  if `match' == "VNM"
         replace incomelevel_iso2 = "XN"  if `match' == "VUT"
         replace incomelevel_iso2 = "NA"  if `match' == "WLD"
         replace incomelevel_iso2 = "XT"  if `match' == "WSM"
         replace incomelevel_iso2 = "XN"  if `match' == "XKX"
         replace incomelevel_iso2 = "NA"  if `match' == "XZN"
         replace incomelevel_iso2 = "XM"  if `match' == "YEM"
         replace incomelevel_iso2 = "XT"  if `match' == "ZAF"
         replace incomelevel_iso2 = "XN"  if `match' == "ZMB"
         replace incomelevel_iso2 = "XM"  if `match' == "ZWE"

*********************

 lab var incomelevel_iso2        "Income Level Code (ISO 2 digits)"

*********************

 end