Hi,

I tracked executives across firms and retained those executives who were employed for at least three years in each of at least two different firms. In addition, I breakdown executives by their title (e.g. CEO, CFO, OTHER), however i want to include two variables which provide the current title (i.e. the last title listed for the executive in dataset) and their prior title. For instance (see dataset), execid 28 moved from company 9563 with title OTHER (= prior title) to 28349 with title CEO (=current title). I am searching for a code that track these executive changes from companies and provide their current en prior title.
gvkey execid fyear CEO CFO OTHER
1246 19 1992 1 0 0
1246 19 1993 1 0 0
1246 19 1994 1 0 0
64117 19 1996 1 0 0
64117 19 1997 1 0 0
64117 19 1998 1 0 0
9563 28 1992 0 0 1
9563 28 1993 0 0 1
9563 28 1994 0 0 1
28349 28 1992 1 0 0
28349 28 1993 1 0 0
28349 28 1994 1 0 0
13099 523 1992 0 0 1
13099 523 1993 0 0 1
13099 523 1994 0 0 1
113419 523 2003 0 1 0
113419 523 2004 0 1 0
113419 523 2005 0 1 0
113419 523 2006 0 1 0