Dear Statlisters,

I have retrospective questions about the employment status and the year of the start of this status for four previous jobs.
I am trying to create from these questions yearly data for each individual. Kindly find below an example of my data so you can have an impression of the variables.

After doing this, I will add other job characteristics for these four previous jobs and then, I will calculate the spell length and the failure variables. The event is the transition to non-employment.

Could you please help me on the code to create the yearly data on these retrospective questions? In addition, I would like to add the end date of the employment status in order to be able to calculate the spell length.

Thank you, Maye

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str11 indid int age float(year marriageage endage nchild) int q6104y byte q6104_01 int q6103y byte q6103_01 int q6102y byte q6102_01 int q6101y byte q6101_01
"12010001101" 15 1978 24 49 0 . . . . 1991 8 1982 1
"12010001101" 16 1979 24 49 0 . . . . 1991 8 1982 1
"12010001101" 17 1980 24 49 0 . . . . 1991 8 1982 1
"12010001101" 18 1981 24 49 0 . . . . 1991 8 1982 1
"12010001101" 19 1982 24 49 0 . . . . 1991 8 1982 1
"12010001101" 20 1983 24 49 0 . . . . 1991 8 1982 1
"12010001101" 21 1984 24 49 0 . . . . 1991 8 1982 1
"12010001101" 22 1985 24 49 0 . . . . 1991 8 1982 1
"12010001101" 23 1986 24 49 0 . . . . 1991 8 1982 1
"12010001101" 24 1987 24 49 0 . . . . 1991 8 1982 1
end
label values q6101_01 Lmempst
label values q6102_01 Lmempst
label values q6103_01 Lmempst
label values q6104_01 Lmempst
label def Lmempst 1 "1. Waged Employee", modify
label def Lmempst 8 "8. Housewife", modify