*! version 1.0  18jun2001
* Stata version June 18, 2001 by John Hendrickx <John_Hendrickx@yahoo.com>
/*
Transforms ISCO-68 (International Classification of Occupation)
4-digit occupational codes into
an ISEI scale (International Socio-Economic Index)

Source:
Ganzeboom, Harry B.G.;Treiman, Donald J.,
International Stratification and Mobility File: Conversion Tools.
Utrecht: Department of Sociologie,
http://www.fss.uu.nl/soc/hg/ismf.

ISCO-68 Reference:
ILO (International Labour Office). (1968).
International Standard Classification of Occupations, revised edition.
Geneva: International Labour Office.

ISEI Reference:
Ganzeboom, H.B.G. De Graaf, P.M. & D.J. Treiman. (1992).
"A Standard International Socio-Economic Index of Occupational Status"
Social Science Research 21: 1-56.

Later recodes are ignored in SPSS, leading to the following differences
between the SPSS and Stata versions. The Stata ISEI codes are correct according
to Ganzeboom et al. (1992: Appendix B).

isco   label                              SPSS      Stata
2033  'high civil servant dept head'        72         81
2035           'dephead loc govrnmt'        72         60
9830             'railw engn driver'        36         45
9831            'locomotive firemen'        36         45
9832     'oretrain moterman in mine'        36         45
9839           'locomotive engineer'        36         45

*/
program define iscoisei
	version 7
	syntax newvarname, isco(varname numeric)

	/* comments in the original SPSS version:
	Comment This recodes the Enhanced International Classification
	        of Occupations (ISCO) into the International Socio-
	        Economic Index of Occupational Status. The procedure is
	        documented in: Ganzeboom, De Graaf & Treiman, "A Standard
	        Socio-Economic Index of Occupational Status", Paper,
	        University of California at Los Angeles, revised version,
	        December 1990.

	        Last Revised: August 31 1993

	** Please cite use of our conversion tools as:
	** "Ganzeboom, Harry B.G.;Treiman, Donald J.,
	** International Stratification and Mobility
	** File: Conversion Tools. Utrecht: Department of Sociologie,
	** http://www.fss.uu.nl/soc/hg/ismf." Date of last revision.
	*/

	quietly {
	gen `varlist'=.
		replace `varlist'=62 if (`isco' == 0100)
		replace `varlist'=73 if (`isco' == 0110)
		replace `varlist'=79 if (`isco' == 0120)
		replace `varlist'=79 if (`isco' >= 0130 & `isco' <= 0139)
		replace `varlist'=47 if (`isco' == 0140)
		replace `varlist'=71 if (`isco' == 0200)
		replace `varlist'=77 if (`isco' == 0210)
		replace `varlist'=73 if (`isco' == 0220)
		replace `varlist'=69 if (`isco' == 0230)
		replace `varlist'=68 if (`isco' == 0240)
		replace `varlist'=73 if (`isco' == 0250)
		replace `varlist'=70 if (`isco' == 0260)
		replace `varlist'=65 if (`isco' == 0270)
		replace `varlist'=65 if (`isco' == 0280)
		replace `varlist'=76 if (`isco' == 0290)
		replace `varlist'=53 if (`isco' == 0300)
		replace `varlist'=58 if (`isco' == 0310)
		replace `varlist'=53 if (`isco' >= 0320 & `isco' <= 0329)
		replace `varlist'=50 if (`isco' >= 0330 & `isco' <= 0339)
		replace `varlist'=48 if (`isco' == 0340)
		replace `varlist'=52 if (`isco' == 0350)
		replace `varlist'=57 if (`isco' == 0360)
		replace `varlist'=56 if (`isco' == 0370)
		replace `varlist'=56 if (`isco' == 0380)
		replace `varlist'=56 if (`isco' == 0390)
		replace `varlist'=59 if (`isco' == 0400)
		replace `varlist'=71 if (`isco' >= 0410 & `isco' <= 0419)
		replace `varlist'=53 if (`isco' >= 0420 & `isco' <= 0429)
		replace `varlist'=53 if (`isco' == 0430)
		replace `varlist'=65 if (`isco' == 0500)
		replace `varlist'=77 if (`isco' == 0510)
		replace `varlist'=77 if (`isco' >= 0520 & `isco' <= 0529)
		replace `varlist'=77 if (`isco' >= 0530 & `isco' <= 0539)
		replace `varlist'=52 if (`isco' == 0540)
		replace `varlist'=59 if (`isco' == 0541)
		replace `varlist'=49 if (`isco' == 0549)
		replace `varlist'=85 if (`isco' == 0600)
		replace `varlist'=88 if (`isco' >= 0610 & `isco' <= 0619)
		replace `varlist'=86 if (`isco' == 0630)
		replace `varlist'=84 if (`isco' == 0650)
		replace `varlist'=81 if (`isco' == 0670)
		replace `varlist'=49 if (`isco' == 0700)
		replace `varlist'=42 if (`isco' >= 0710 & `isco' <= 0719)
		replace `varlist'=39 if (`isco' == 0720)
		replace `varlist'=51 if (`isco' == 0730)
		replace `varlist'=39 if (`isco' == 0740)
		replace `varlist'=58 if (`isco' == 0750)
		replace `varlist'=58 if (`isco' == 0751 | `isco' == 0759)
		replace `varlist'=58 if (`isco' >= 0760 & `isco' <= 0769)
		replace `varlist'=58 if (`isco' == 0770)
		replace `varlist'=52 if (`isco' == 0680 | `isco' == 0780)
		replace `varlist'=52 if (`isco' == 0620)
		replace `varlist'=52 if (`isco' == 0640)
		replace `varlist'=52 if (`isco' == 0660)
		replace `varlist'=52 if (`isco' == 0690)
		replace `varlist'=58 if (`isco' >= 0790 & `isco' <= 0799)
		replace `varlist'=67 if (`isco' == 0800)
		replace `varlist'=71 if (`isco' == 0810)
		replace `varlist'=71 if (`isco' == 0820)
		replace `varlist'=71 if (`isco' == 0830)
		replace `varlist'=64 if (`isco' >= 0840 & `isco' <= 0849)
		replace `varlist'=80 if (`isco' == 0900)
		replace `varlist'=69 if (`isco' == 1100)
		replace `varlist'=75 if (`isco' == 1101)
		replace `varlist'=68 if (`isco' == 1109)
		replace `varlist'=85 if (`isco' == 1200)
		replace `varlist'=85 if (`isco' >= 1210 & `isco' <= 1219)
		replace `varlist'=90 if (`isco' >= 1220 & `isco' <= 1229)
		replace `varlist'=82 if (`isco' == 1290)
		replace `varlist'=71 if (`isco' == 1300)
		replace `varlist'=78 if (`isco' >= 1310 & `isco' <= 1319)
		replace `varlist'=71 if (`isco' >= 1320 & `isco' <= 1329)
		replace `varlist'=69 if (`isco' == 1330)
		replace `varlist'=65 if (`isco' == 1340)
		replace `varlist'=65 if (`isco' == 1350)
		replace `varlist'=65 if (`isco' >= 1390 & `isco' <= 1399)
		replace `varlist'=55 if (`isco' == 1400)
		replace `varlist'=55 if (`isco' >= 1410 & `isco' <= 1419)
		replace `varlist'=55 if (`isco' >= 1490 & `isco' <= 1499)
		replace `varlist'=66 if (`isco' == 1500)
		replace `varlist'=66 if (`isco' >= 1510 & `isco' <= 1519)
		replace `varlist'=66 if (`isco' >= 1590 & `isco' <= 1599)
		replace `varlist'=55 if (`isco' == 1600)
		replace `varlist'=57 if (`isco' == 1610)
		replace `varlist'=55 if (`isco' == 1620)
		replace `varlist'=60 if (`isco' == 1621)
		replace `varlist'=44 if (`isco' == 1622 | `isco' == 1629)
		replace `varlist'=50 if (`isco' >= 1630 & `isco' <= 1639)
		replace `varlist'=59 if (`isco' == 1700)
		replace `varlist'=54 if (`isco' >= 1710 & `isco' <= 1719)
		replace `varlist'=64 if (`isco' >= 1720 & `isco' <= 1729)
		replace `varlist'=64 if (`isco' >= 1730 & `isco' <= 1739)
		replace `varlist'=64 if (`isco' >= 1740 & `isco' <= 1749)
		replace `varlist'=54 if (`isco' == 1750)
		replace `varlist'=64 if (`isco' >= 1790 & `isco' <= 1799)
		replace `varlist'=55 if (`isco' >= 1800 & `isco' <= 1809)
		replace `varlist'=65 if (`isco' == 1900)
		replace `varlist'=59 if (`isco' == 1910)
		replace `varlist'=72 if (`isco' >= 1920 & `isco' <= 1929)
		replace `varlist'=54 if (`isco' >= 1930 & `isco' <= 1939)
		replace `varlist'=59 if (`isco' >= 1940 & `isco' <= 1949)
		replace `varlist'=54 if (`isco' >= 1950 & `isco' <= 1959)
		replace `varlist'=82 if (`isco' == 1960)
		replace `varlist'=61 if (`isco' >= 1990 & `isco' <= 1999)
		replace `varlist'=72 if (`isco' == 2000)
		replace `varlist'=72 if (`isco' >= 2010 & `isco' <= 2019)
		replace `varlist'=73 if (`isco' >= 2020 & `isco' <= 2029)
		replace `varlist'=72 if (`isco' >= 2030 & `isco' <= 2039)
		replace `varlist'=81 if (`isco' == 2033)
		replace `varlist'=60 if (`isco' == 2035)
		replace `varlist'=67 if (`isco' == 2100)
		replace `varlist'=66 if (`isco' == 2110)
		replace `varlist'=69 if (`isco' == 2111 | `isco' == 2114 | `isco' == 2115 | `isco' == 2119)
		replace `varlist'=65 if (`isco' == 2112 | `isco' == 2113)
		replace `varlist'=47 if (`isco' == 2116)
		replace `varlist'=67 if (`isco' == 2120)
		replace `varlist'=67 if (`isco' == 2190)
		replace `varlist'=65 if (`isco' == 2191)
		replace `varlist'=67 if (`isco' == 2192 | `isco' == 2193)
		replace `varlist'=59 if (`isco' == 2195 | `isco' == 2196 | `isco' == 2197)
		replace `varlist'=67 if (`isco' == 2199 | `isco' == 2194)
		replace `varlist'=60 if (`isco' >= 3000 & `isco' <= 3009)
		replace `varlist'=58 if (`isco' == 3100)
		replace `varlist'=48 if (`isco' == 3102 | `isco' == 3103)
		replace `varlist'=53 if (`isco' == 3104)
		replace `varlist'=59 if (`isco' == 3101 | `isco' == 3109)
		replace `varlist'=54 if (`isco' == 3200)
		replace `varlist'=55 if (`isco' == 3210)
		replace `varlist'=58 if (`isco' == 3211)
		replace `varlist'=48 if (`isco' == 3219)
		replace `varlist'=48 if (`isco' == 3220)
		replace `varlist'=54 if (`isco' == 3300)
		replace `varlist'=54 if (`isco' == 3310)
		replace `varlist'=58 if (`isco' == 3312)
		replace `varlist'=47 if (`isco' == 3311 | `isco' == 3313 | `isco' == 3314)
		replace `varlist'=46 if (`isco' == 3315)
		replace `varlist'=56 if (`isco' == 3319)
		replace `varlist'=44 if (`isco' >= 3390 & `isco' <= 3399)
		replace `varlist'=51 if (`isco' == 3400)
		replace `varlist'=50 if (`isco' == 3410)
		replace `varlist'=54 if (`isco' == 3420)
		replace `varlist'=49 if (`isco' == 3500)
		replace `varlist'=56 if (`isco' == 3510)
		replace `varlist'=56 if (`isco' == 3520)
		replace `varlist'=48 if (`isco' == 3590)
		replace `varlist'=37 if (`isco' >= 3600 & `isco' <= 3609)
		replace `varlist'=36 if (`isco' == 3700)
		replace `varlist'=34 if (`isco' == 3701)
		replace `varlist'=37 if (`isco' == 3709)
		replace `varlist'=43 if (`isco' == 3800)
		replace `varlist'=63 if (`isco' == 3801 | `isco' == 3802)
		replace `varlist'=43 if (`isco' == 3809)
		replace `varlist'=48 if (`isco' == 3900)
		replace `varlist'=35 if (`isco' >= 3910 & `isco' <= 3919)
		replace `varlist'=45 if (`isco' == 3920)
		replace `varlist'=58 if (`isco' >= 3930 & `isco' <= 3939)
		replace `varlist'=51 if (`isco' >= 3940 & `isco' <= 3949)
		replace `varlist'=51 if (`isco' >= 3950 & `isco' <= 3959)
		replace `varlist'=45 if (`isco' >= 3990 & `isco' <= 3999)
		replace `varlist'=54 if (`isco' >= 4000 & `isco' <= 4009)
		replace `varlist'=53 if (`isco' == 4100)
		replace `varlist'=64 if (`isco' == 4101 | `isco' == 4104 | `isco' == 4105 | `isco' == 4108)
		replace `varlist'=35 if (`isco' == 4102 | `isco' == 4107)
		replace `varlist'=52 if (`isco' == 4103)
		replace `varlist'=60 if (`isco' == 4106)
		replace `varlist'=47 if (`isco' == 4109)
		replace `varlist'=54 if (`isco' == 4200)
		replace `varlist'=57 if (`isco' == 4210)
		replace `varlist'=52 if (`isco' >= 4220 & `isco' <= 4229)
		replace `varlist'=58 if (`isco' == 4300)
		replace `varlist'=55 if (`isco' >= 4310 & `isco' <= 4319)
		replace `varlist'=58 if (`isco' == 4320)
		replace `varlist'=59 if (`isco' == 4400)
		replace `varlist'=59 if (`isco' == 4410)
		replace `varlist'=61 if (`isco' == 4411)
		replace `varlist'=64 if (`isco' == 4412)
		replace `varlist'=58 if (`isco' == 4419)
		replace `varlist'=60 if (`isco' == 4420)
		replace `varlist'=56 if (`isco' >= 4430 & `isco' <= 4432)
		replace `varlist'=42 if (`isco' == 4500)
		replace `varlist'=45 if (`isco' == 4510)
		replace `varlist'=17 if (`isco' == 4512)
		replace `varlist'=41 if (`isco' == 4513 | `isco' == 4514)
		replace `varlist'=46 if (`isco' == 4511 | `isco' == 4519)
		replace `varlist'=35 if (`isco' >= 4520 & `isco' <= 4529)
		replace `varlist'=35 if (`isco' == 4900)
		replace `varlist'=41 if (`isco' >= 5000 & `isco' <= 5009)
		replace `varlist'=48 if (`isco' == 5100)
		replace `varlist'=48 if (`isco' >= 5101 & `isco' <= 5104)
		replace `varlist'=49 if (`isco' == 5109)
		replace `varlist'=33 if (`isco' >= 5200 & `isco' <= 5209)
		replace `varlist'=29 if (`isco' == 5300)
		replace `varlist'=27 if (`isco' == 5310)
		replace `varlist'=30 if (`isco' == 5311 | `isco' == 5319)
		replace `varlist'=10 if (`isco' == 5312)
		replace `varlist'=30 if (`isco' == 5320)
		replace `varlist'=28 if (`isco' == 5321 | `isco' == 5322)
		replace `varlist'=32 if (`isco' == 5329)
		replace `varlist'=24 if (`isco' >= 5400 & `isco' <= 5409)
		replace `varlist'=25 if (`isco' == 5500)
		replace `varlist'=26 if (`isco' >= 5510 & `isco' <= 5519)
		replace `varlist'=22 if (`isco' >= 5520 & `isco' <= 5529)
		replace `varlist'=24 if (`isco' == 5600)
		replace `varlist'=32 if (`isco' >= 5700 & `isco' <= 5709)
		replace `varlist'=48 if (`isco' == 5800)
		replace `varlist'=44 if (`isco' == 5810)
		replace `varlist'=54 if (`isco' == 5820)
		replace `varlist'=75 if (`isco' == 5821 | `isco' == 5822)
		replace `varlist'=53 if (`isco' == 5823 | `isco' == 5829)
		replace `varlist'=60 if (`isco' == 5830)
		replace `varlist'=83 if (`isco' == 5831)
		replace `varlist'=58 if (`isco' == 5832 | `isco' == 5833)
		replace `varlist'=35 if (`isco' >= 5890 & `isco' <= 5899)
		replace `varlist'=40 if (`isco' == 5900)
		replace `varlist'=39 if (`isco' == 5910)
		replace `varlist'=58 if (`isco' == 5920)
		replace `varlist'=39 if (`isco' == 5990)
		replace `varlist'=44 if (`isco' == 5991 | `isco' == 5997)
		replace `varlist'=37 if (`isco' == 5992 | `isco' == 5993 | `isco' == 5994 | `isco' == 5995 | `isco' == 5998)
		replace `varlist'=34 if (`isco' == 5996)
		replace `varlist'=28 if (`isco' == 5999)
		replace `varlist'=46 if (`isco' == 6000)
		replace `varlist'=32 if (`isco' == 6001)
		replace `varlist'=49 if (`isco' == 6009)
		replace `varlist'=26 if (`isco' == 6100)
		replace `varlist'=26 if (`isco' == 6110)
		replace `varlist'=49 if (`isco' == 6111)
		replace `varlist'=18 if (`isco' == 6112)
		replace `varlist'=27 if (`isco' == 6113 | `isco' == 6114 | `isco' == 6115)
		replace `varlist'=26 if (`isco' == 6116 | `isco' == 6119)
		replace `varlist'=29 if (`isco' == 6120)
		replace `varlist'=17 if (`isco' == 6200)
		replace `varlist'=16 if ((`isco' >= 6210 & `isco' <=  6219) | `isco' == 6117)
		replace `varlist'=16 if (`isco' == 6220)
		replace `varlist'=16 if (`isco' >= 6230 & `isco' <= 6239)
		replace `varlist'=20 if (`isco' == 6240)
		replace `varlist'=20 if (`isco' == 6250)
		replace `varlist'=20 if (`isco' == 6260)
		replace `varlist'=21 if (`isco' == 6270)
		replace `varlist'=28 if (`isco' == 6280)
		replace `varlist'=10 if (`isco' >= 6290 & `isco' <= 6299)
		replace `varlist'=25 if (`isco' == 6300)
		replace `varlist'=19 if (`isco' >= 6310 & `isco' <= 6319)
		replace `varlist'=32 if (`isco' >= 6320 & `isco' <= 6329)
		replace `varlist'=30 if (`isco' == 6400)
		replace `varlist'=30 if (`isco' >= 6410 & `isco' <= 6419)
		replace `varlist'=32 if (`isco' >= 6490 & `isco' <= 6499)
		replace `varlist'=44 if (`isco' >= 7000 & `isco' <= 7009)
		replace `varlist'=32 if (`isco' == 7100)
		replace `varlist'=32 if (`isco' == 7110)
		replace `varlist'=29 if (`isco' == 7112)
		replace `varlist'=32 if (`isco' == 7111 | `isco' == 7113 | `isco' == 7119)
		replace `varlist'=26 if (`isco' == 7120)
		replace `varlist'=31 if (`isco' >= 7130 & `isco' <= 7139)
		replace `varlist'=34 if (`isco' == 7200)
		replace `varlist'=34 if (`isco' == 7210)
		replace `varlist'=31 if (`isco' == 7220 | `isco' == 7329)
		replace `varlist'=31 if (`isco' == 7230)
		replace `varlist'=31 if (`isco' == 7240)
		replace `varlist'=34 if (`isco' == 7250)
		replace `varlist'=34 if (`isco' == 7260)
		replace `varlist'=34 if (`isco' == 7270)
		replace `varlist'=34 if (`isco' == 7280)
		replace `varlist'=37 if (`isco' == 7290)
		replace `varlist'=26 if (`isco' == 7300)
		replace `varlist'=24 if (`isco' == 7310)
		replace `varlist'=24 if (`isco' == 7320 | `isco' == 7321)
		replace `varlist'=36 if (`isco' == 7330)
		replace `varlist'=36 if (`isco' == 7340)
		replace `varlist'=36 if (`isco' == 7400)
		replace `varlist'=43 if (`isco' == 7410)
		replace `varlist'=43 if (`isco' == 7420)
		replace `varlist'=43 if (`isco' == 7430)
		replace `varlist'=43 if (`isco' == 7440)
		replace `varlist'=43 if (`isco' == 7450)
		replace `varlist'=29 if (`isco' == 7491)
		replace `varlist'=36 if (`isco' == 7490 | `isco' == 7499)
		replace `varlist'=34 if (`isco' == 7500)
		replace `varlist'=35 if (`isco' == 7510)
		replace `varlist'=35 if (`isco' == 7520)
		replace `varlist'=30 if (`isco' == 7530)
		replace `varlist'=34 if (`isco' >= 7540 & `isco' <= 7549)
		replace `varlist'=31 if (`isco' == 7550)
		replace `varlist'=31 if (`isco' == 7560)
		replace `varlist'=37 if (`isco' == 7590)
		replace `varlist'=38 if (`isco' == 7600)
		replace `varlist'=38 if (`isco' == 7610)
		replace `varlist'=38 if (`isco' == 7620)
		replace `varlist'=32 if (`isco' == 7700)
		replace `varlist'=22 if (`isco' >= 7710 & `isco' <= 7719)
		replace `varlist'=22 if (`isco' == 7720)
		replace `varlist'=32 if (`isco' >= 7730 & `isco' <= 7739)
		replace `varlist'=28 if (`isco' == 7740)
		replace `varlist'=33 if (`isco' == 7750)
		replace `varlist'=33 if (`isco' >= 7760 & `isco' <= 7769)
		replace `varlist'=33 if (`isco' == 7770)
		replace `varlist'=33 if (`isco' == 7780)
		replace `varlist'=36 if (`isco' >= 7790 & `isco' <= 7799)
		replace `varlist'=37 if (`isco' == 7800)
		replace `varlist'=37 if (`isco' == 7810)
		replace `varlist'=37 if (`isco' == 7820)
		replace `varlist'=37 if (`isco' == 7830)
		replace `varlist'=37 if (`isco' == 7890)
		replace `varlist'=40 if (`isco' == 7900)
		replace `varlist'=46 if (`isco' == 7910 | `isco' == 7919)
		replace `varlist'=43 if (`isco' == 7920)
		replace `varlist'=43 if (`isco' == 7930)
		replace `varlist'=43 if (`isco' == 7940)
		replace `varlist'=23 if (`isco' == 7950 | `isco' == 7911)
		replace `varlist'=30 if (`isco' == 7960)
		replace `varlist'=37 if (`isco' == 7990)
		replace `varlist'=33 if (`isco' == 8000)
		replace `varlist'=33 if (`isco' == 8010)
		replace `varlist'=32 if (`isco' == 8020)
		replace `varlist'=32 if (`isco' == 8030)
		replace `varlist'=35 if (`isco' == 8100)
		replace `varlist'=36 if (`isco' == 8110)
		replace `varlist'=32 if (`isco' == 8120)
		replace `varlist'=32 if (`isco' >= 8190 & `isco' <= 8199)
		replace `varlist'=29 if (`isco' == 8200)
		replace `varlist'=40 if (`isco' == 8300)
		replace `varlist'=37 if (`isco' == 8310)
		replace `varlist'=34 if (`isco' == 8311)
		replace `varlist'=45 if (`isco' == 8319)
		replace `varlist'=41 if (`isco' == 8320)
		replace `varlist'=44 if (`isco' == 8321)
		replace `varlist'=41 if (`isco' == 8329)
		replace `varlist'=36 if (`isco' == 8330)
		replace `varlist'=39 if (`isco' == 8331)
		replace `varlist'=35 if (`isco' == 8339)
		replace `varlist'=39 if (`isco' == 8340)
		replace `varlist'=28 if (`isco' >= 8350 & `isco' <= 8351)
		replace `varlist'=43 if (`isco' == 8390)
		replace `varlist'=35 if (`isco' == 8400)
		replace `varlist'=36 if (`isco' >= 8410 & `isco' <= 8419)
		replace `varlist'=39 if (`isco' >= 8420 & `isco' <= 8429)
		replace `varlist'=31 if (`isco' == 8430 | `isco' == 8439)
		replace `varlist'=52 if (`isco' == 8431)
		replace `varlist'=44 if (`isco' == 8440)
		replace `varlist'=36 if (`isco' == 8490)
		replace `varlist'=26 if (`isco' == 8491 | `isco' == 8492 | `isco' == 8494)
		replace `varlist'=28 if (`isco' == 8493)
		replace `varlist'=37 if (`isco' == 8499)
		replace `varlist'=41 if (`isco' == 8500)
		replace `varlist'=39 if (`isco' == 8510)
		replace `varlist'=41 if (`isco' == 8520)
		replace `varlist'=40 if (`isco' == 8530)
		replace `varlist'=43 if (`isco' == 8540)
		replace `varlist'=40 if (`isco' >= 8550 & `isco' <= 8559)
		replace `varlist'=43 if (`isco' == 8560)
		replace `varlist'=41 if (`isco' == 8570)
		replace `varlist'=46 if (`isco' == 8590)
		replace `varlist'=46 if (`isco' == 8600)
		replace `varlist'=46 if (`isco' == 8610)
		replace `varlist'=46 if (`isco' == 8620)
		replace `varlist'=35 if (`isco' == 8700)
		replace `varlist'=36 if (`isco' >= 8710 & `isco' <= 8719)
		replace `varlist'=33 if (`isco' == 8720)
		replace `varlist'=36 if (`isco' == 8730)
		replace `varlist'=32 if (`isco' == 8731)
		replace `varlist'=37 if (`isco' == 8732)
		replace `varlist'=41 if (`isco' == 8733)
		replace `varlist'=37 if (`isco' == 8739)
		replace `varlist'=33 if (`isco' == 8740)
		replace `varlist'=43 if (`isco' >= 8800 & `isco' <= 8809)
		replace `varlist'=29 if (`isco' == 8900)
		replace `varlist'=33 if (`isco' >= 8910 & `isco' <= 8919)
		replace `varlist'=27 if (`isco' == 8920)
		replace `varlist'=25 if (`isco' == 8930)
		replace `varlist'=25 if (`isco' == 8940)
		replace `varlist'=25 if (`isco' == 8950)
		replace `varlist'=25 if (`isco' == 8990)
		replace `varlist'=33 if (`isco' == 9000)
		replace `varlist'=33 if (`isco' == 9010)
		replace `varlist'=33 if (`isco' == 9020)
		replace `varlist'=34 if (`isco' == 9100)
		replace `varlist'=42 if (`isco' == 9200)
		replace `varlist'=41 if (`isco' >= 9210 & `isco' <= 9219)
		replace `varlist'=41 if (`isco' == 9220)
		replace `varlist'=43 if (`isco' == 9230)
		replace `varlist'=43 if (`isco' == 9240)
		replace `varlist'=43 if (`isco' == 9250)
		replace `varlist'=39 if (`isco' == 9260)
		replace `varlist'=43 if (`isco' == 9270)
		replace `varlist'=46 if (`isco' == 9290)
		replace `varlist'=32 if (`isco' == 9300)
		replace `varlist'=32 if (`isco' >= 9310 & `isco' <= 9319)
		replace `varlist'=30 if (`isco' == 9390)
		replace `varlist'=29 if (`isco' == 9400)
		replace `varlist'=29 if (`isco' == 9410)
		replace `varlist'=29 if (`isco' == 9420)
		replace `varlist'=29 if (`isco' == 9430)
		replace `varlist'=29 if (`isco' == 9490)
		replace `varlist'=29 if (`isco' >= 9491 & `isco' <= 9493)
		replace `varlist'=39 if (`isco' == 9499)
		replace `varlist'=32 if (`isco' == 9500)
		replace `varlist'=32 if (`isco' == 9510)
		replace `varlist'=29 if (`isco' == 9520)
		replace `varlist'=22 if (`isco' == 9530)
		replace `varlist'=31 if (`isco' >= 9540 & `isco' <= 9549)
		replace `varlist'=33 if (`isco' >= 9550 & `isco' <= 9559)
		replace `varlist'=36 if (`isco' == 9560)
		replace `varlist'=30 if (`isco' == 9570)
		replace `varlist'=31 if (`isco' == 9590)
		replace `varlist'=39 if (`isco' == 9591 | `isco' == 9592 | `isco' == 9593 | `isco' == 9594 | `isco' == 9596 | `isco' == 9599)
		replace `varlist'=24 if (`isco' == 9595)
		replace `varlist'=33 if (`isco' == 9600)
		replace `varlist'=34 if (`isco' == 9610)
		replace `varlist'=33 if (`isco' == 9690)
		replace `varlist'=31 if (`isco' == 9700)
		replace `varlist'=31 if (`isco' == 9710)
		replace `varlist'=32 if (`isco' == 9711)
		replace `varlist'=21 if (`isco' == 9712 | `isco' == 9713)
		replace `varlist'=27 if (`isco' == 9714)
		replace `varlist'=34 if (`isco' == 9719)
		replace `varlist'=28 if (`isco' == 9720)
		replace `varlist'=29 if (`isco' >= 9730 & `isco' <= 9739)
		replace `varlist'=30 if (`isco' == 9740)
		replace `varlist'=30 if (`isco' == 9790)
		replace `varlist'=36 if (`isco' == 9800)
		replace `varlist'=36 if (`isco' >= 9810 & `isco' <= 9839)
		replace `varlist'=36 if (`isco' == 9820)
		replace `varlist'=45 if (`isco' >= 9830 & `isco' <= 9839)
		replace `varlist'=35 if (`isco' == 9840)
		replace `varlist'=37 if (`isco' == 9850)
		replace `varlist'=33 if (`isco' == 9851)
		replace `varlist'=37 if (`isco' == 9852 | `isco' == 9853 | `isco' == 9855)
		replace `varlist'=18 if (`isco' == 9854)
		replace `varlist'=33 if (`isco' == 9859)
		replace `varlist'=20 if (`isco' == 9860 | `isco' == 9861)
		replace `varlist'=35 if (`isco' >= 9890 & `isco' <= 9899)
		replace `varlist'=25 if (`isco' == 9900)
		replace `varlist'=43 if (`isco' >= 9950 & `isco' <= 9959)
		replace `varlist'=28 if (`isco' >= 9970 & `isco' <= 9979)
		replace `varlist'=23 if (`isco' == 9990)
		replace `varlist'=24 if (`isco' == 9991)
		replace `varlist'=28 if (`isco' == 9994)
		replace `varlist'=26 if (`isco' == 9995 | `isco' == 9996)
		replace `varlist'=28 if (`isco' == 9997)
		replace `varlist'=22 if (`isco' == 9992 | `isco' == 9993 | `isco' == 9999)
	}
end