Dear Statalist,

I have a dataset on CEO and firm characteristics. My question is how to find the years in which firms change their CEOs. It's a bit tricky for two reasons: 1. CEO names in the dataset are not consistent. 2. Firms can have multiple CEO turnovers during the sample period.

An example:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str12 tic str43 person long reportday
"A"     "Bill Sullivan"             20080814
"A"     "Bill Sullivan"             20081114
"A"     "Bill Sullivan"             20090217
"A"     "Bill Sullivan"             20091113
"A"     "Bill Sullivan"             20130814
"A"     "Michael McMullen"          20160516
"A"     "Michael McMullen"          20170522
"A"     "Michael McMullen"          20180514
"A"     "Michael R. McMullen"       20150519
"A"     "Michael R. McMullen"       20160216
"A"     "Mike McMullen"             20150217
"A"     "Mike McMullen"             20150529
"A"     "Mike McMullen"             20150817
"A"     "Mike McMullen"             20151117
"A"     "Mike McMullen"             20160817
"A"     "Mike McMullen"             20161115
"A"     "Mike McMullen"             20170816
"A"     "Mike McMullen"             20171120
"A"     "William P. Sullivan"       20060515
"A"     "William P. Sullivan"       20060814
"A"     "William P. Sullivan"       20090514
"A"     "William P. Sullivan"       20130514
"A"     "William Sullivan"          20100518
"AA"    "Alain Belda"               20070109
"AA"    "Alain Belda"               20070410
"AA"    "Alain Belda"               20070709
"AA"    "Alain Belda"               20080109
"AA"    "Alain Belda"               20080407
"AA"    "Klaus Kleinfeld"           20081007
"AA"    "Klaus Kleinfeld"           20100111
"AA"    "Klaus Kleinfeld"           20100713
"AA"    "Klaus Kleinfeld"           20101007
"AA"    "Klaus Kleinfeld"           20110110
"AA"    "Klaus Kleinfeld"           20110411
"AA"    "Klaus Kleinfeld"           20110711
"AA"    "Klaus Kleinfeld"           20111011
"AA"    "Klaus Kleinfeld"           20120109
"AA"    "Klaus Kleinfeld"           20120410
"AA"    "Klaus Kleinfeld"           20121009
"AA"    "Klaus Kleinfeld"           20130708
"AA"    "Klaus Kleinfeld"           20131008
"AA"    "Klaus Kleinfeld"           20140109
"AA"    "Klaus Kleinfeld"           20140409
"AA"    "Klaus Kleinfeld"           20140709
"AA"    "Klaus Kleinfeld"           20141008
"AA"    "Klaus Kleinfeld"           20150113
"AA"    "Klaus Kleinfeld"           20150409
"AA"    "Klaus Kleinfeld"           20150708
"AA"    "Klaus Kleinfeld"           20151009
"AA"    "Klaus Kleinfeld"           20160112
"AA"    "Klaus Kleinfeld"           20160411
"AA"    "Klaus Kleinfeld"           20160629
"AA"    "Klaus Kleinfeld"           20160711
"AA"    "Klaus Kleinfeld"           20161011
"AA"    "Klaus-Christian Kleinfeld" 20120709
"AA"    "Roy C. Harvey"             20170124
"AA"    "Roy Harvey"                20170516
"AA"    "Roy Harvey"                20180117
"AA"    "Roy Harvey"                20180418
"AA"    "Roy Harvey"                20180718
"AAALF" "Wolf Schumacher"           20141112
"AAAP"  "Stefano Buono"             20170323
"AABA"  "Carol Bartz"               20090127
"AABA"  "Carol Bartz"               20090422
"AABA"  "Carol Bartz"               20100421
"AABA"  "Carol Bartz"               20110126
"AABA"  "Carol Bartz"               20110420
"AABA"  "Carol Bartz"               20110719
"AABA"  "Jerry Yang"                20080129
"AABA"  "Jerry Yang"                20080422
"AABA"  "Jerry Yang"                20080722
"AABA"  "Marissa A. Mayer"          20130416
"AABA"  "Marissa A. Mayer"          20150722
"AABA"  "Marissa A. Mayer"          20151020
"AABA"  "Marissa A. Mayer"          20160203
"AABA"  "Marissa A. Mayer"          20160419
"AABA"  "Marissa Ann Mayer"         20150421
"AABA"  "Marissa Mayer"             20130716
"AABA"  "Marissa Mayer"             20131015
"AABA"  "Marissa Mayer"             20140128
"AABA"  "Marissa Mayer"             20140415
"AABA"  "Marissa Mayer"             20140716
"AABA"  "Marissa Mayer"             20141022
"AABA"  "Marissa Mayer"             20150128
"AABA"  "Marissa Mayer"             20160719
"AABA"  "Marissa Mayer"             20160726
"AABA"  "Scott Thompson"            20120124
"AABA"  "Terry Semel"               20070123
"AAC"   "Michael Cartwright"        20150801
"AAC"   "Michael Cartwright"        20151029
"AAC"   "Michael Cartwright"        20160223
"AAC"   "Michael Cartwright"        20160508
"AAC"   "Michael Cartwright"        20170504
"AAC"   "Michael Cartwright"        20170803
"AAC"   "Michael Cartwright"        20180222
"AAC"   "Michael Cartwright"        20180506
"AAC"   "Michael Cartwright"        20180803
"AAC"   "Michael T. Cartwright"     20161106
"AAIAF" "Ian Greenberg"             20071024
"AAIAF" "Ian Greenberg"             20080710
end

For the first point, I think I can figure it out using regular expressions. My question is, how to exactly find where the turnovers happen? I searched and saw some discussions on how to find where the first change in a variable happens, but as you can see here, turnovers can happen more thatn once.

Any help will be appreciated!