Appendix 2: Employment Variable Creation

Main Employment Program, Current Round Variable Creation Section

Return to Appendix 2 main file


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

  **  Number of weeks worked at any job during 19##                  **

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

  **  This variable is created for each individual for each year of  **

  **  potential work activity (1980-2003). respondents not working   **

  **  in a given year are given a default value of zero (0) weeks    **

  **  worked. Otherwise, the variable is the actual cumulative weeks **

  **  worked on all jobs in that year.                               **

  **                                                                 **

  **  Variables created:  r7wks80-r7wks04                            **

  **                     r7swks80-r7swks04                           **

  **                     r7ewks80-r7ewks04                           **

  *********************************************************************;

 

  array job1wks  (i) w1_1-w1_1280;

  array job2wks  (i) w2_1-w2_1280;

  array job3wks  (i) w3_1-w3_1280;

  array job4wks  (i) w4_1-w4_1280;

  array job5wks  (i) w5_1-w5_1280;

  array job6wks  (i) w6_1-w6_1280;

  array job7wks  (i) w7_1-w7_1280;

  array job8wks  (i) w8_1-w8_1280;

  array job9wks  (i) w9_1-w9_1280;

  array job10wks (i) w10_1-w10_1280;

  array alljobs  (i) wks1-wks1280;

  array selfjobs (i) swks1-swks1280;

  array empjobs  (i) ewks1-ewks1280;

 

  array starw  (i) starw01-starw10;

  array stopw  (i) stopw01-stopw10;

  array uid    (i) uid01-uid10;

  array self   (i) self01-self10;

  array smof   (i) smof01-smof10;

  array emof   (i) emof01-emof10;

  array stary  (i) stary01-stary10;

  array stopy  (i) stopy01-stopy10;

 

  array r7wks  (i) r7wks80-r7wks99 r7wks00-r7wks04;

  array r7swks (i) r7swks80-r7swks99 r7swks00-r7swks04;

  array r7ewks (i) r7ewks80-r7ewks99 r7ewks00-r7ewks04;

 

  do over alljobs;

     alljobs=0;

     selfjobs=0;

     empjobs=0;

  end;

 

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

  ** Overlay multiple jobs over JOB 1 work weeks       **

  *******************************************************;

 

  do over job1wks;

     alljobs=job1wks;

     if self01=1 then do;

        selfjobs=job1wks;

     end;

     if self01=0 then do;

        empjobs=job1wks;

     end;

  end;

 

  do over alljobs;

     if job2wks=1 then do;

        alljobs=job2wks;

     end;

     if job2wks=1 and self02=1 then do;

        selfjobs=job2wks;

     end;

     if job2wks=1 and self02=0 then do;

        empjobs=job2wks;

     end;

 

     if job2wks=-3 and alljobs=0 then do;

        alljobs=job2wks;

     end;

     if job2wks=-3 and selfjobs=0 and self02=1 then do;

        selfjobs=job2wks;

     end;

     if job2wks=-3 and empjobs=0 and self02=0 then do;

        empjobs=job2wks;

     end;

  end;

 

 

  do over alljobs;

     if job3wks=1 then do;

        alljobs=job3wks;

     end;

     if job3wks=1 and self03=1 then do;

        selfjobs=job3wks;

     end;

     if job3wks=1 and self03=0 then do;

        empjobs=job3wks;

     end;

 

     if job3wks=-3 and alljobs=0 then do;

        alljobs=job3wks;

     end;

     if job3wks=-3 and selfjobs=0 and self03=1 then do;

        selfjobs=job3wks;

     end;

     if job3wks=-3 and empjobs=0 and self03=0 then do;

        empjobs=job3wks;

     end;

  end;

 

  do over alljobs;

     if job4wks=1 then do;

        alljobs=job4wks;

     end;

     if job4wks=1 and self04=1 then do;

        selfjobs=job4wks;

     end;

     if job4wks=1 and self04=0 then do;

        empjobs=job4wks;

     end;

 

     if job4wks=-3 and alljobs=0 then do;

        alljobs=job4wks;

     end;

     if job4wks=-3 and selfjobs=0 and self04=1 then do;

        selfjobs=job4wks;

     end;

     if job4wks=-3 and empjobs=0 and self04=0 then do;

        empjobs=job4wks;

     end;

  end;

 

  do over alljobs;

     if job5wks=1 then do;

        alljobs=job5wks;

     end;

     if job5wks=1 and self05=1 then do;

        selfjobs=job5wks;

     end;

     if job5wks=1 and self05=0 then do;

        empjobs=job5wks;

     end;

 

     if job5wks=-3 and alljobs=0 then do;

        alljobs=job5wks;

     end;

     if job5wks=-3 and selfjobs=0 and self05=1 then do;

        selfjobs=job5wks;

     end;

     if job5wks=-3 and empjobs=0 and self05=0 then do;

        empjobs=job5wks;

     end;

  end;

 

  do over alljobs;

     if job6wks=1 then do;

        alljobs=job6wks;

     end;

     if job6wks=1 and self06=1 then do;

        selfjobs=job6wks;

     end;

     if job6wks=1 and self06=0 then do;

        empjobs=job6wks;

     end;

 

     if job6wks=-3 and alljobs=0 then do;

        alljobs=job6wks;

     end;

     if job6wks=-3 and selfjobs=0 and self06=1 then do;

        selfjobs=job6wks;

     end;

     if job6wks=-3 and empjobs=0 and self06=0 then do;

        empjobs=job6wks;

     end;

  end;

 

  do over alljobs;

     if job7wks=1 then do;

        alljobs=job7wks;

     end;

     if job7wks=1 and self07=1 then do;

        selfjobs=job7wks;

     end;

     if job7wks=1 and self07=0 then do;

        empjobs=job7wks;

     end;

 

     if job7wks=-3 and alljobs=0 then do;

        alljobs=job7wks;

     end;

     if job7wks=-3 and selfjobs=0 and self07=1 then do;

        selfjobs=job7wks;

     end;

     if job7wks=-3 and empjobs=0 and self07=0 then do;

        empjobs=job7wks;

     end;

  end;

 

  do over alljobs;

     if job8wks=1 then do;

        alljobs=job8wks;

     end;

     if job8wks=1 and self08=1 then do;

        selfjobs=job8wks;

     end;

     if job8wks=1 and self08=0 then do;

        empjobs=job8wks;

     end;

     if job8wks=-3 and alljobs=0 then do;

        alljobs=job8wks;

     end;

     if job8wks=-3 and selfjobs=0 and self08=1 then do;

        selfjobs=job8wks;

     end;

     if job8wks=-3 and empjobs=0 and self08=0 then do;

        empjobs=job8wks;

     end;

  end;

 

  do over alljobs;

     if job9wks=1 then do;

        alljobs=job9wks;

     end;

     if job9wks=1 and self09=1 then do;

        selfjobs=job9wks;

     end;

     if job9wks=1 and self09=0 then do;

        empjobs=job9wks;

     end;

     if job9wks=-3 and alljobs=0 then do;

        alljobs=job9wks;

     end;

     if job9wks=-3 and selfjobs=0 and self09=1 then do;

        selfjobs=job9wks;

     end;

     if job9wks=-3 and empjobs=0 and self09=0 then do;

        empjobs=job9wks;

     end;

  end;

 

  do over alljobs;

     if job10wks=1 then do;

        alljobs=job10wks;

     end;

     if job10wks=1 and self10=1 then do;

        selfjobs=job10wks;

     end;

     if job10wks=1 and self10=0 then do;

        empjobs=job10wks;

     end;

     if job10wks=-3 and alljobs=0 then do;

        alljobs=job10wks;

     end;

     if job10wks=-3 and selfjobs=0 and self10=1 then do;

        selfjobs=job10wks;

     end;

     if job10wks=-3 and empjobs=0 and self10=0 then do;

        empjobs=job10wks;

     end;

  end;

 

 

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

  ** Calculate cumulative weeks on all jobs for each year **

  **********************************************************;

 

  /* Initialize each annual c.v. */

  do over r7wks;

     r7wks=0;

     r7swks=0;

     r7ewks=0;

  end;

 

  /* 1980 */

 

  do i=1 to 52;

     if alljobs=1 then do;

        r7wks80=r7wks80+1;

     end;

     if selfjobs=1 then do;

        r7swks80=r7swks80+1;

     end;

     if empjobs=1 then do;

        r7ewks80=r7ewks80+1;

     end;

  end;

  do i=1 to 52;

     if alljobs=-3 then do;

        r7wks80=-3;

     end;

     if selfjobs=-3 then do;

        r7swks80=-3;

     end;

     if empjobs=-3 then do;

        r7ewks80=-3;

     end;

  end;

 

  /* 1981 */

 

  do i=53 to 104;

     if alljobs=1 then do;

        r7wks81=r7wks81+1;

     end;

     if selfjobs=1 then do;

        r7swks81=r7swks81+1;

     end;

     if empjobs=1 then do;

        r7ewks81=r7ewks81+1;

     end;

  end;

 

  do i=53 to 104;

     if alljobs=-3 then do;

        r7wks81=-3;

     end;

     if selfjobs=-3 then do;

        r7swks81=-3;

     end;

     if empjobs=-3 then do;

        r7ewks81=-3;

     end;

  end;

 

  /* 1982 */

 

  do i=105 to 156;

     if alljobs=1 then do;

        r7wks82=r7wks82+1;

     end;

     if selfjobs=1 then do;

        r7swks82=r7swks82+1;

     end;

     if empjobs=1 then do;

        r7ewks82=r7ewks82+1;

     end;

  end;

 

  do i=105 to 156;

     if alljobs=-3 then do;

        r7wks82=-3;

     end;

     if selfjobs=-3 then do;

        r7swks82=-3;

     end;

     if empjobs=-3 then do;

        r7ewks82=-3;

     end;

  end;

 

  /* 1983 */

 

  do i=157 to 209;

     if alljobs=1 then do;

        r7wks83=r7wks83+1;

     end;

     if selfjobs=1 then do;

        r7swks83=r7swks83+1;

     end;

     if empjobs=1 then do;

        r7ewks83=r7ewks83+1;

     end;

  end;

 

  do i=157 to 209;

     if alljobs=-3 then do;

        r7wks83=-3;

     end;

     if selfjobs=-3 then do;

        r7swks83=-3;

     end;

     if empjobs=-3 then do;

        r7ewks83=-3;

     end;

  end;

 

  /* 1984 */

 

  do i=210 to 261;

     if alljobs=1 then do;

        r7wks84=r7wks84+1;

     end;

     if selfjobs=1 then do;

        r7swks84=r7swks84+1;

     end;

     if empjobs=1 then do;

        r7ewks84=r7ewks84+1;

     end;

  end;

 

  do i=210 to 261;

     if alljobs=-3 then do;

        r7wks84=-3;

     end;

     if selfjobs=-3 then do;

        r7swks84=-3;

     end;

     if empjobs=-3 then do;

        r7ewks84=-3;

     end;

  end;

 

  /* 1985 */

 

  do i=262 to 313;

     if alljobs=1 then do;

        r7wks85=r7wks85+1;

     end;

     if selfjobs=1 then do;

        r7swks85=r7swks85+1;

     end;

     if empjobs=1 then do;

        r7ewks85=r7ewks85+1;

     end;

  end;

 

  do i=262 to 313;

     if alljobs=-3 then do;

        r7wks85=-3;

     end;

     if selfjobs=-3 then do;

        r7swks85=-3;

     end;

     if empjobs=-3 then do;

        r7ewks85=-3;

     end;

  end;

 

  /* 1986 */

 

  do i=314 to 365;

     if alljobs=1 then do;

        r7wks86=r7wks86+1;

     end;

     if selfjobs=1 then do;

        r7swks86=r7swks86+1;

     end;

     if empjobs=1 then do;

        r7ewks86=r7ewks86+1;

     end;

  end;

 

  do i=314 to 365;

     if alljobs=-3 then do;

        r7wks86=-3;

     end;

     if selfjobs=-3 then do;

        r7swks86=-3;

     end;

     if empjobs=-3 then do;

        r7ewks86=-3;

     end;

  end;

 

  /* 1987 */

 

  do i=366 to 417;

     if alljobs=1 then do;

        r7wks87=r7wks87+1;

     end;

     if selfjobs=1 then do;

        r7swks87=r7swks87+1;

     end;

     if empjobs=1 then do;

        r7ewks87=r7ewks87+1;

     end;

  end;

 

  do i=366 to 417;

     if alljobs=-3 then do;

        r7wks87=-3;

     end;

     if selfjobs=-3 then do;

        r7swks87=-3;

     end;

     if empjobs=-3 then do;

        r7ewks87=-3;

     end;

  end;

 

  /* 1988 */

 

  do i=418 to 470;

     if alljobs=1 then do;

        r7wks88=r7wks88+1;

     end;

     if selfjobs=1 then do;

        r7swks88=r7swks88+1;

     end;

     if empjobs=1 then do;

        r7ewks88=r7ewks88+1;

     end;

  end;

 

  do i=418 to 470;

     if alljobs=-3 then do;

        r7wks88=-3;

     end;

     if selfjobs=-3 then do;

        r7swks88=-3;

     end;

     if empjobs=-3 then do;

        r7ewks88=-3;

     end;

  end;

 

  /* 1989 */

 

  do i=471 to 522;

     if alljobs=1 then do;

        r7wks89=r7wks89+1;

     end;

     if selfjobs=1 then do;

        r7swks89=r7swks89+1;

     end;

     if empjobs=1 then do;

        r7ewks89=r7ewks89+1;

     end;

  end;

 

  do i=471 to 522;

     if alljobs=-3 then do;

        r7wks89=-3;

     end;

     if selfjobs=-3 then do;

        r7swks89=-3;

     end;

     if empjobs=-3 then do;

        r7ewks89=-3;

     end;

  end;

 

  /* 1990 */

 

  do i=523 to 574;

     if alljobs=1 then do;

        r7wks90=r7wks90+1;

     end;

     if selfjobs=1 then do;

        r7swks90=r7swks90+1;

     end;

     if empjobs=1 then do;

        r7ewks90=r7ewks90+1;

     end;

  end;

 

  do i=523 to 574;

     if alljobs=-3 then do;

        r7wks90=-3;

     end;

     if selfjobs=-3 then do;

        r7swks90=-3;

     end;

     if empjobs=-3 then do;

        r7ewks90=-3;

     end;

  end;

 

  /* 1991 */

 

  do i=575 to 626;

     if alljobs=1 then do;

        r7wks91=r7wks91+1;

     end;

     if selfjobs=1 then do;

        r7swks91=r7swks91+1;

     end;

     if empjobs=1 then do;

        r7ewks91=r7ewks91+1;

     end;

  end;

 

  do i=575 to 626;

     if alljobs=-3 then do;

        r7wks91=-3;

     end;

     if selfjobs=-3 then do;

        r7swks91=-3;

     end;

     if empjobs=-3 then do;

        r7ewks91=-3;

     end;

  end;

 

  /* 1992 */

 

  do i=627 to 678;

     if alljobs=1 then do;

        r7wks92=r7wks92+1;

     end;

     if selfjobs=1 then do;

        r7swks92=r7swks92+1;

     end;

     if empjobs=1 then do;

        r7ewks92=r7ewks92+1;

     end;

  end;

 

  do i=627 to 678;

     if alljobs=-3 then do;

        r7wks92=-3;

     end;

     if selfjobs=-3 then do;

        r7swks92=-3;

     end;

     if empjobs=-3 then do;

        r7ewks92=-3;

     end;

  end;

 

  /* 1993 */

 

  do i=679 to 730;

     if alljobs=1 then do;

        r7wks93=r7wks93+1;

     end;

     if selfjobs=1 then do;

        r7swks93=r7swks93+1;

     end;

     if empjobs=1 then do;

        r7ewks93=r7ewks93+1;

     end;

  end;

 

  do i=679 to 730;

     if alljobs=-3 then do;

        r7wks93=-3;

     end;

     if selfjobs=-3 then do;

        r7swks93=-3;

     end;

     if empjobs=-3 then do;

        r7ewks93=-3;

     end;

  end;

 

  /* 1994 */

 

  do i=731 to 783;

     if alljobs=1 then do;

        r7wks94=r7wks94+1;

     end;

     if selfjobs=1 then do;

        r7swks94=r7swks94+1;

     end;

     if empjobs=1 then do;

        r7ewks94=r7ewks94+1;

     end;

  end;

 

  do i=731 to 783;

     if alljobs=-3 then do;

        r7wks94=-3;

     end;

     if selfjobs=-3 then do;

        r7swks94=-3;

     end;

     if empjobs=-3 then do;

        r7ewks94=-3;

     end;

  end;

 

  /* 1995 */

 

  do i=784 to 835;

     if alljobs=1 then do;

        r7wks95=r7wks95+1;

     end;

     if selfjobs=1 then do;

        r7swks95=r7swks95+1;

     end;

     if empjobs=1 then do;

        r7ewks95=r7ewks95+1;

     end;

  end;

 

  do i=784 to 835;

     if alljobs=-3 then do;

        r7wks95=-3;

     end;

     if selfjobs=-3 then do;

        r7swks95=-3;

     end;

     if empjobs=-3 then do;

        r7ewks95=-3;

     end;

  end;

 

  /* 1996 */

 

  do i=836 to 887;

     if alljobs=1 then do;

        r7wks96=r7wks96+1;

     end;

     if selfjobs=1 then do;

        r7swks96=r7swks96+1;

     end;

     if empjobs=1 then do;

        r7ewks96=r7ewks96+1;

     end;

  end;

 

  do i=836 to 887;

     if alljobs=-3 then do;

        r7wks96=-3;

     end;

     if selfjobs=-3 then do;

        r7swks96=-3;

     end;

     if empjobs=-3 then do;

        r7ewks96=-3;

     end;

  end;

 

  /* 1997 */

 

  do i=888 to 939;

     if alljobs=1 then do;

        r7wks97=r7wks97+1;

     end;

     if selfjobs=1 then do;

        r7swks97=r7swks97+1;

     end;

     if empjobs=1 then do;

        r7ewks97=r7ewks97+1;

     end;

  end;

 

  do i=888 to 939;

     if alljobs=-3 then do;

        r7wks97=-3;

     end;

     if selfjobs=-3 then do;

        r7swks97=-3;

     end;

     if empjobs=-3 then do;

        r7ewks97=-3;

     end;

  end;

 

  /* 1998 */

 

  do i=940 to 991;

     if alljobs=1 then do;

        r7wks98=r7wks98+1;

     end;

     if selfjobs=1 then do;

        r7swks98=r7swks98+1;

     end;

     if empjobs=1 then do;

        r7ewks98=r7ewks98+1;

     end;

  end;

 

  do i=940 to 991;

     if alljobs=-3 then do;

        r7wks98=-3;

     end;

     if selfjobs=-3 then do;

        r7swks98=-3;

     end;

     if empjobs=-3 then do;

        r7ewks98=-3;

     end;

  end;

 

  /* 1999 */

 

  do i=992 to 1043;

     if alljobs=1 then do;

        r7wks99=r7wks99+1;

     end;

     if selfjobs=1 then do;

        r7swks99=r7swks99+1;

     end;

     if empjobs=1 then do;

        r7ewks99=r7ewks99+1;

     end;

  end;

 

  do i=992 to 1043;

     if alljobs=-3 then do;

        r7wks99=-3;

     end;

     if selfjobs=-3 then do;

        r7swks99=-3;

     end;

     if empjobs=-3 then do;

        r7ewks99=-3;

     end;

  end;

 

  /* 2000 */

 

  do i=1044 to 1096;

     if alljobs=1 then do;

        r7wks00=r7wks00+1;

     end;

     if selfjobs=1 then do;

        r7swks00=r7swks00+1;

     end;

     if empjobs=1 then do;

        r7ewks00=r7ewks00+1;

     end;

  end;

 

  do i=1044 to 1096;

     if alljobs=-3 then do;

        r7wks00=-3;

     end;

     if selfjobs=-3 then do;

        r7swks00=-3;

     end;

     if empjobs=-3 then do;

        r7ewks00=-3;

     end;

  end;

 

  /* 2001 */

 

  do i=1097 to 1148;

     if alljobs=1 then do;

        r7wks01=r7wks01+1;

     end;

     if selfjobs=1 then do;

        r7swks01=r7swks01+1;

     end;

     if empjobs=1 then do;

        r7ewks01=r7ewks01+1;

     end;

  end;

 

  do i=1097 to 1148;

     if alljobs=-3 then do;

        r7wks01=-3;

     end;

     if selfjobs=-3 then do;

        r7swks01=-3;

     end;

     if empjobs=-3 then do;

        r7ewks01=-3;

     end;

  end;

 

  /* 2002 */

 

  do i=1149 to 1200;

     if alljobs=1 then do;

        r7wks02=r7wks02+1;

     end;

     if selfjobs=1 then do;

        r7swks02=r7swks02+1;

     end;

     if empjobs=1 then do;

        r7ewks02=r7ewks02+1;

     end;

  end;

 

  do i=1149 to 1200;

     if alljobs=-3 then do;

        r7wks02=-3;

     end;

     if selfjobs=-3 then do;

        r7swks02=-3;

     end;

     if empjobs=-3 then do;

        r7ewks02=-3;

     end;

  end;

 

  /* 2003 */

 

  do i=1201 to 1252;

     if alljobs=1 then do;

        r7wks03=r7wks03+1;

     end;

     if selfjobs=1 then do;

        r7swks03=r7swks03+1;

     end;

     if empjobs=1 then do;

        r7ewks03=r7ewks03+1;

     end;

  end;

 

  do i=1201 to 1252;

     if alljobs=-3 then do;

        r7wks03=-3;

     end;

     if selfjobs=-3 then do;

        r7swks03=-3;

     end;

     if empjobs=-3 then do;

        r7ewks03=-3;

     end;

  end;

 

  /* 2004 */

 

  do i=1253 to 1280;

     if alljobs=1 then do;

        r7wks04=r7wks04+1;

     end;

     if selfjobs=1 then do;

        r7swks04=r7swks04+1;

     end;

     if empjobs=1 then do;

        r7ewks04=r7ewks04+1;

     end;

  end;

 

  do i=1253 to 1280;

     if alljobs=-3 then do;

        r7wks04=-3;

     end;

     if selfjobs=-3 then do;

        r7swks04=-3;

     end;

     if empjobs=-3 then do;

        r7ewks04=-3;

     end;

  end;

 

 

  *** Include valid skips;

 

  do over r7wks;

     if r7int=-5 then do;

        r7wks=-5;

        r7swks=-5;

        r7ewks=-5;

     end;

  end;

 

Return to top


 

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

  **  Number of weeks worked at any job since last interview date                **

  **  Variables created: allwks, empwks, selfwks                                 **

  *********************************************************************************;

 

 

 

 

  array alljobs (i) wks1-wks1280;

  array selfjobs (i) swks1-swks1280;

  array empjobs (i) ewks1-ewks1280;

 

  array starw (i) starw01-starw10;

  array stopw (i) stopw01-stopw10;

  array self (i) self01-self10;

 

 

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

  ** Calculate cumulative weeks on all jobs since dli **

  ******************************************************;

 

  allwks=0;

  selfwks=0;

  empwks=0;

 

  if dliwk>0 then do;

     if dliwk=>age14wk then do;

        do i=dliwk to 1280;

           if alljobs=1 then do;

              allwks=allwks+1;

           end;

           if selfjobs=1 then do;

              selfwks=selfwks+1;

           end;

           if empjobs=1 then do;

              empwks=empwks+1;

           end;

        end;

        do i=dliwk to 1280;

           if alljobs=-3 then do;

              allwks=-3;

           end;

           if selfjobs=-3 then do;

              selfwks=-3;

           end;

           if empjobs=-3 then do;

              empwks=-3;

           end;

        end;

     end;

     if age14wk>dliwk then do;

        do i=age14wk to 1280;

           if alljobs=1 then do;

              allwks=allwks+1;

           end;

           if selfjobs=1 then do;

              selfwks=selfwks+1;

           end;

           if empjobs=1 then do;

              empwks=empwks+1;

           end;

        end;

        do i=age14wk to 1280;

           if alljobs=-3 then do;

              allwks=-3;

           end;

           if selfjobs=-3 then do;

              selfwks=-3;

           end;

           if empjobs=-3 then do;

              empwks=-3;

           end;

        end;

     end;

  end;

 

 

  if r7int=-5 then do;

     allwks=-5;

     selfwks=-5;

     empwks=-5;

  end;

 

Return to top


 

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

  **  Number of weeks worked at job # during each year                              **

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

  **  This program creates yearly variables for each potential job (10) relating    **

  **  the number of weeks worked. A variable is created for each potential job      **

  **  even if the respondent has worked no jobs in a given year with the default    **

  **  value set to zero (0).                                                        **

  **                                                                                **

  **  Variables created:  r7w80_1-r7w80_10 r7w81_1-r7w81_10 r7w82_1-r7w82_10        **

  **                      r7w83_1-r7w83_10 r7w84_1-r7w84_10 r7w85_1-r7w85_10        **

  **                      r7w86_1-r7w86_10 r7w87_1-r7w87_10 r7w88_1-r7w88_10        **

  **                      r7w89_1-r7w89_10 r7w90_1-r7w90_10 r7w91_1-r7w91_10        **

  **                      r7w92_1-r7w92_10 r7w93_1-r7w93_10 r7w94_1-r7w94_10        **

  **                      r7w95_1-r7w95_10 r7w96_1-r7w96_10 r7w97_1-r7w97_10        **

  **                      r7w98_1-r7w98_10 r7w99_1-r7w99_10 r7w00_1-r7w00_10        **

  **          r7w01_1-r7w01_10 r7w02_1-r7w02_10 r7w03_1-r7w03_10        **

  **  For example:  r7w93_3 gives the number of weeks worked in 1993 on (potential) **

  **                job number 3.                                                   **

  **                                                                                **

  ************************************************************************************;

 

  array job1wks  (i) w1_1-w1_1280;

  array job2wks  (i) w2_1-w2_1280;

  array job3wks  (i) w3_1-w3_1280;

  array job4wks  (i) w4_1-w4_1280;

  array job5wks  (i) w5_1-w5_1280;

  array job6wks  (i) w6_1-w6_1280;

  array job7wks  (i) w7_1-w7_1280;

  array job8wks  (i) w8_1-w8_1280;

  array job9wks  (i) w9_1-w9_1280;

  array job10wks (i) w10_1-w10_1280;

 

 

  array starw (i) starw01-starw10;

  array stopw (i) stopw01-stopw10;

  array starfl (i) starf_1-starf_10;

  array stopfl (i) stopf_1-stopf_10;

  array smof (i) smof01-smof10;

  array emof (i) emof01-emof10;

  array stary (i) stary01-stary10;

  array stopy (i) stopy01-stopy10;

 

  array r7wks80 (i) r7w80_1-r7w80_10;

  array r7wks81 (i) r7w81_1-r7w81_10;

  array r7wks82 (i) r7w82_1-r7w82_10;

  array r7wks83 (i) r7w83_1-r7w83_10;

  array r7wks84 (i) r7w84_1-r7w84_10;

  array r7wks85 (i) r7w85_1-r7w85_10;

  array r7wks86 (i) r7w86_1-r7w86_10;

  array r7wks87 (i) r7w87_1-r7w87_10;

  array r7wks88 (i) r7w88_1-r7w88_10;

  array r7wks89 (i) r7w89_1-r7w89_10;

  array r7wks90 (i) r7w90_1-r7w90_10;

  array r7wks91 (i) r7w91_1-r7w91_10;

  array r7wks92 (i) r7w92_1-r7w92_10;

  array r7wks93 (i) r7w93_1-r7w93_10;

  array r7wks94 (i) r7w94_1-r7w94_10;

  array r7wks95 (i) r7w95_1-r7w95_10;

  array r7wks96 (i) r7w96_1-r7w96_10;

  array r7wks97 (i) r7w97_1-r7w97_10;

  array r7wks98 (i) r7w98_1-r7w98_10;

  array r7wks99 (i) r7w99_1-r7w99_10;

  array r7wks00 (i) r7w00_1-r7w00_10;

  array r7wks01 (i) r7w01_1-r7w01_10;

  array r7wks02 (i) r7w02_1-r7w02_10;

  array r7wks03 (i) r7w03_1-r7w03_10;

  array r7wks04 (i) r7w04_1-r7w04_10;

 

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

  ** Calculate cumulative weeks on individual jobs for each year **

  *****************************************************************;

 

  /* 1980 */

 

  do over r7wks80;

   r7wks80=0;

  end;

 

  do i=1 to 52;

     if job1wks=1 then do;

        r7w80_1=r7w80_1+1;

     end;

     if job2wks=1 then do;

        r7w80_2=r7w80_2+1;

     end;

     if job3wks=1 then do;

        r7w80_3=r7w80_3+1;

     end;

     if job4wks=1 then do;

        r7w80_4=r7w80_4+1;

     end;

     if job5wks=1 then do;

        r7w80_5=r7w80_5+1;

     end;

     if job6wks=1 then do;

        r7w80_6=r7w80_6+1;

     end;

     if job7wks=1 then do;

        r7w80_7=r7w80_7+1;

     end;

     if job8wks=1 then do;

        r7w80_8=r7w80_8+1;

     end;

     if job9wks=1 then do;

        r7w80_9=r7w80_9+1;

     end;

     if job10wks=1 then do;

        r7w80_10=r7w80_10+1;

     end;

 

  end;

 

  do i=1 to 52;

     if job1wks=-3  then do;

        r7w80_1=-3;

     end;

     if job2wks=-3 then do;

        r7w80_2=-3;

     end;

     if job3wks=-3 then do;

        r7w80_3=-3;

     end;

     if job4wks=-3 then do;

        r7w80_4=-3;

     end;

     if job5wks=-3 then do;

        r7w80_5=-3;

     end;

     if job6wks=-3 then do;

        r7w80_6=-3;

     end;

     if job7wks=-3 then do;

        r7w80_7=-3;

     end;

     if job8wks=-3 then do;

        r7w80_8=-3;

     end;

     if job9wks=-3 then do;

        r7w80_9=-3;

     end;

     if job10wks=-3 then do;

        r7w80_10=-3;

     end;

 

  end;

 

  /* 1981 */

 

  do over r7wks81;

   r7wks81=0;

  end;

 

  do i=53 to 104;

     if job1wks=1 then do;

        r7w81_1=r7w81_1+1;

     end;

     if job2wks=1 then do;

        r7w81_2=r7w81_2+1;

     end;

     if job3wks=1 then do;

        r7w81_3=r7w81_3+1;

     end;

     if job4wks=1 then do;

        r7w81_4=r7w81_4+1;

     end;

     if job5wks=1 then do;

        r7w81_5=r7w81_5+1;

     end;

     if job6wks=1 then do;

        r7w81_6=r7w81_6+1;

     end;

     if job7wks=1 then do;

        r7w81_7=r7w81_7+1;

     end;

     if job8wks=1 then do;

        r7w81_8=r7w81_8+1;

     end;

     if job9wks=1 then do;

        r7w81_9=r7w81_9+1;

     end;

     if job10wks=1 then do;

        r7w81_10=r7w81_10+1;

     end;

 

  end;

 

  do i=53 to 104;

     if job1wks=-3  then do;

        r7w81_1=-3;

     end;

     if job2wks=-3 then do;

        r7w81_2=-3;

     end;

     if job3wks=-3 then do;

        r7w81_3=-3;

     end;

     if job4wks=-3 then do;

        r7w81_4=-3;

     end;

     if job5wks=-3 then do;

        r7w81_5=-3;

     end;

     if job6wks=-3 then do;

        r7w81_6=-3;

     end;

     if job7wks=-3 then do;

        r7w81_7=-3;

     end;

     if job8wks=-3 then do;

        r7w81_8=-3;

     end;

     if job9wks=-3 then do;

        r7w81_9=-3;

     end;

     if job10wks=-3 then do;

        r7w81_10=-3;

     end;

 

  end;

 

  /* 1982 */

 

  do over r7wks82;

   r7wks82=0;

  end;

 

  do i=105 to 156;

     if job1wks=1 then do;

        r7w82_1=r7w82_1+1;

     end;

     if job2wks=1 then do;

        r7w82_2=r7w82_2+1;

     end;

     if job3wks=1 then do;

        r7w82_3=r7w82_3+1;

     end;

     if job4wks=1 then do;

        r7w82_4=r7w82_4+1;

     end;

     if job5wks=1 then do;

        r7w82_5=r7w82_5+1;

     end;

     if job6wks=1 then do;

        r7w82_6=r7w82_6+1;

     end;

     if job7wks=1 then do;

        r7w82_7=r7w82_7+1;

     end;

     if job8wks=1 then do;

        r7w82_8=r7w82_8+1;

     end;

     if job9wks=1 then do;

        r7w82_9=r7w82_9+1;

     end;

     if job10wks=1 then do;

        r7w82_10=r7w82_10+1;

     end;

 

  end;

 

  do i=105 to 156;

     if job1wks=-3  then do;

        r7w82_1=-3;

     end;

     if job2wks=-3 then do;

        r7w82_2=-3;

     end;

     if job3wks=-3 then do;

        r7w82_3=-3;

     end;

     if job4wks=-3 then do;

        r7w82_4=-3;

     end;

     if job5wks=-3 then do;

        r7w82_5=-3;

     end;

     if job6wks=-3 then do;

        r7w82_6=-3;

     end;

     if job7wks=-3 then do;

        r7w82_7=-3;

     end;

     if job8wks=-3 then do;

        r7w82_8=-3;

     end;

     if job9wks=-3 then do;

        r7w82_9=-3;

     end;

     if job10wks=-3 then do;

        r7w82_10=-3;

     end;

   end;

 

  /* 1983 */

 

  do over r7wks83;

   r7wks83=0;

  end;

 

  do i=157 to 209;

     if job1wks=1 then do;

        r7w83_1=r7w83_1+1;

     end;

     if job2wks=1 then do;

        r7w83_2=r7w83_2+1;

     end;

     if job3wks=1 then do;

        r7w83_3=r7w83_3+1;

     end;

     if job4wks=1 then do;

        r7w83_4=r7w83_4+1;

     end;

     if job5wks=1 then do;

        r7w83_5=r7w83_5+1;

     end;

     if job6wks=1 then do;

        r7w83_6=r7w83_6+1;

     end;

     if job7wks=1 then do;

        r7w83_7=r7w83_7+1;

     end;

     if job8wks=1 then do;

        r7w83_8=r7w83_8+1;

     end;

     if job9wks=1 then do;

        r7w83_9=r7w83_9+1;

     end;

     if job10wks=1 then do;

        r7w83_10=r7w83_10+1;

     end;

 

  end;

 

  do i=157 to 209;

     if job1wks=-3  then do;

        r7w83_1=-3;

     end;

     if job2wks=-3 then do;

        r7w83_2=-3;

     end;

     if job3wks=-3 then do;

        r7w83_3=-3;

     end;

     if job4wks=-3 then do;

        r7w83_4=-3;

     end;

     if job5wks=-3 then do;

        r7w83_5=-3;

     end;

     if job6wks=-3 then do;

        r7w83_6=-3;

     end;

     if job7wks=-3 then do;

        r7w83_7=-3;

     end;

     if job8wks=-3 then do;

        r7w83_8=-3;

     end;

     if job9wks=-3 then do;

        r7w83_9=-3;

     end;

     if job10wks=-3 then do;

        r7w83_10=-3;

     end;

 

  end;

 

 

  /* 1984 */

 

  do over r7wks84;

   r7wks84=0;

  end;

 

  do i=210 to 261;

     if job1wks=1 then do;

        r7w84_1=r7w84_1+1;

     end;

     if job2wks=1 then do;

        r7w84_2=r7w84_2+1;

     end;

     if job3wks=1 then do;

        r7w84_3=r7w84_3+1;

     end;

     if job4wks=1 then do;

        r7w84_4=r7w84_4+1;

     end;

     if job5wks=1 then do;

        r7w84_5=r7w84_5+1;

     end;

     if job6wks=1 then do;

        r7w84_6=r7w84_6+1;

     end;

     if job7wks=1 then do;

        r7w84_7=r7w84_7+1;

     end;

     if job8wks=1 then do;

        r7w84_8=r7w84_8+1;

     end;

     if job9wks=1 then do;

        r7w84_9=r7w84_9+1;

     end;

     if job10wks=1 then do;

        r7w84_10=r7w84_10+1;

     end;

 

  end;

 

  do i=210 to 261;

     if job1wks=-3  then do;

        r7w84_1=-3;

     end;

     if job2wks=-3 then do;

        r7w84_2=-3;

     end;

     if job3wks=-3 then do;

        r7w84_3=-3;

     end;

     if job4wks=-3 then do;

        r7w84_4=-3;

     end;

     if job5wks=-3 then do;

        r7w84_5=-3;

     end;

     if job6wks=-3 then do;

        r7w84_6=-3;

     end;

     if job7wks=-3 then do;

        r7w84_7=-3;

     end;

     if job8wks=-3 then do;

        r7w84_8=-3;

     end;

     if job9wks=-3 then do;

        r7w84_9=-3;

     end;

     if job10wks=-3 then do;

        r7w84_10=-3;

     end;

 

  end;

 

  /* 1985 */

 

  do over r7wks85;

   r7wks85=0;

  end;

 

  do i=262 to 313;

     if job1wks=1 then do;

        r7w85_1=r7w85_1+1;

     end;

     if job2wks=1 then do;

        r7w85_2=r7w85_2+1;

     end;

     if job3wks=1 then do;

        r7w85_3=r7w85_3+1;

     end;

     if job4wks=1 then do;

        r7w85_4=r7w85_4+1;

     end;

     if job5wks=1 then do;

        r7w85_5=r7w85_5+1;

     end;

     if job6wks=1 then do;

        r7w85_6=r7w85_6+1;

     end;

     if job7wks=1 then do;

        r7w85_7=r7w85_7+1;

     end;

     if job8wks=1 then do;

        r7w85_8=r7w85_8+1;

     end;

     if job9wks=1 then do;

        r7w85_9=r7w85_9+1;

     end;

     if job10wks=1 then do;

        r7w85_10=r7w85_10+1;

     end;

 

  end;

 

  do i=262 to 313;

     if job1wks=-3  then do;

        r7w85_1=-3;

     end;

     if job2wks=-3 then do;

        r7w85_2=-3;

     end;

     if job3wks=-3 then do;

        r7w85_3=-3;

     end;

     if job4wks=-3 then do;

        r7w85_4=-3;

     end;

     if job5wks=-3 then do;

        r7w85_5=-3;

     end;

     if job6wks=-3 then do;

        r7w85_6=-3;

     end;

     if job7wks=-3 then do;

        r7w85_7=-3;

     end;

     if job8wks=-3 then do;

        r7w85_8=-3;

     end;

     if job9wks=-3 then do;

        r7w85_9=-3;

     end;

     if job10wks=-3 then do;

        r7w85_10=-3;

     end;

 

  end;

 

  /* 1986 */

 

  do over r7wks86;

   r7wks86=0;

  end;

 

  do i=314 to 365;

     if job1wks=1 then do;

        r7w86_1=r7w86_1+1;

     end;

     if job2wks=1 then do;

        r7w86_2=r7w86_2+1;

     end;

     if job3wks=1 then do;

        r7w86_3=r7w86_3+1;

     end;

     if job4wks=1 then do;

        r7w86_4=r7w86_4+1;

     end;

     if job5wks=1 then do;

        r7w86_5=r7w86_5+1;

     end;

     if job6wks=1 then do;

        r7w86_6=r7w86_6+1;

     end;

     if job7wks=1 then do;

        r7w86_7=r7w86_7+1;

     end;

     if job8wks=1 then do;

        r7w86_8=r7w86_8+1;

     end;

     if job9wks=1 then do;

        r7w86_9=r7w86_9+1;

     end;

     if job10wks=1 then do;

        r7w86_10=r7w86_10+1;

     end;

 

  end;

 

  do i=314 to 365;

     if job1wks=-3  then do;

        r7w86_1=-3;

     end;

     if job2wks=-3 then do;

        r7w86_2=-3;

     end;

     if job3wks=-3 then do;

        r7w86_3=-3;

     end;

     if job4wks=-3 then do;

        r7w86_4=-3;

     end;

     if job5wks=-3 then do;

        r7w86_5=-3;

     end;

     if job6wks=-3 then do;

        r7w86_6=-3;

     end;

     if job7wks=-3 then do;

        r7w86_7=-3;

     end;

     if job8wks=-3 then do;

        r7w86_8=-3;

     end;

     if job9wks=-3 then do;

        r7w86_9=-3;

     end;

     if job10wks=-3 then do;

        r7w86_10=-3;

     end;

 

  end;

 

  /* 1987 */

 

  do over r7wks87;

   r7wks87=0;

  end;

 

  do i=366 to 417;

     if job1wks=1 then do;

        r7w87_1=r7w87_1+1;

     end;

     if job2wks=1 then do;

        r7w87_2=r7w87_2+1;

     end;

     if job3wks=1 then do;

        r7w87_3=r7w87_3+1;

     end;

     if job4wks=1 then do;

        r7w87_4=r7w87_4+1;

     end;

     if job5wks=1 then do;

        r7w87_5=r7w87_5+1;

     end;

     if job6wks=1 then do;

        r7w87_6=r7w87_6+1;

     end;

     if job7wks=1 then do;

        r7w87_7=r7w87_7+1;

     end;

     if job8wks=1 then do;

        r7w87_8=r7w87_8+1;

     end;

     if job9wks=1 then do;

        r7w87_9=r7w87_9+1;

     end;

     if job10wks=1 then do;

        r7w87_10=r7w87_10+1;

     end;

 

  end;

 

  do i=366 to 417;

     if job1wks=-3  then do;

        r7w87_1=-3;

     end;

     if job2wks=-3 then do;

        r7w87_2=-3;

     end;

     if job3wks=-3 then do;

        r7w87_3=-3;

     end;

     if job4wks=-3 then do;

        r7w87_4=-3;

     end;

     if job5wks=-3 then do;

        r7w87_5=-3;

     end;

     if job6wks=-3 then do;

        r7w87_6=-3;

     end;

     if job7wks=-3 then do;

        r7w87_7=-3;

     end;

     if job8wks=-3 then do;

        r7w87_8=-3;

     end;

     if job9wks=-3 then do;

        r7w87_9=-3;

     end;

     if job10wks=-3 then do;

        r7w87_10=-3;

     end;

 

  end;

 

  /* 1988 */

 

  do over r7wks88;

   r7wks88=0;

  end;

 

  do i=418 to 470;

     if job1wks=1 then do;

        r7w88_1=r7w88_1+1;

     end;

     if job2wks=1 then do;

        r7w88_2=r7w88_2+1;

     end;

     if job3wks=1 then do;

        r7w88_3=r7w88_3+1;

     end;

     if job4wks=1 then do;

        r7w88_4=r7w88_4+1;

     end;

     if job5wks=1 then do;

        r7w88_5=r7w88_5+1;

     end;

     if job6wks=1 then do;

        r7w88_6=r7w88_6+1;

     end;

     if job7wks=1 then do;

        r7w88_7=r7w88_7+1;

     end;

     if job8wks=1 then do;

        r7w88_8=r7w88_8+1;

     end;

     if job9wks=1 then do;

        r7w88_9=r7w88_9+1;

     end;

     if job10wks=1 then do;

        r7w88_10=r7w88_10+1;

     end;

 

  end;

 

  do i=418 to 470;

     if job1wks=-3  then do;

        r7w88_1=-3;

     end;

     if job2wks=-3 then do;

        r7w88_2=-3;

     end;

     if job3wks=-3 then do;

        r7w88_3=-3;

     end;

     if job4wks=-3 then do;

        r7w88_4=-3;

     end;

     if job5wks=-3 then do;

        r7w88_5=-3;

     end;

     if job6wks=-3 then do;

        r7w88_6=-3;

     end;

     if job7wks=-3 then do;

        r7w88_7=-3;

     end;

     if job8wks=-3 then do;

        r7w88_8=-3;

     end;

     if job9wks=-3 then do;

        r7w88_9=-3;

     end;

     if job10wks=-3 then do;

        r7w88_10=-3;

     end;

 

  end;

 

  /* 1989 */

 

  do over r7wks89;

   r7wks89=0;

  end;

 

  do i=471 to 522;

     if job1wks=1 then do;

        r7w89_1=r7w89_1+1;

     end;

     if job2wks=1 then do;

        r7w89_2=r7w89_2+1;

     end;

     if job3wks=1 then do;

        r7w89_3=r7w89_3+1;

     end;

     if job4wks=1 then do;

        r7w89_4=r7w89_4+1;

     end;

     if job5wks=1 then do;

        r7w89_5=r7w89_5+1;

     end;

     if job6wks=1 then do;

        r7w89_6=r7w89_6+1;

     end;

     if job7wks=1 then do;

        r7w89_7=r7w89_7+1;

     end;

     if job8wks=1 then do;

        r7w89_8=r7w89_8+1;

     end;

     if job9wks=1 then do;

        r7w89_9=r7w89_9+1;

     end;

     if job10wks=1 then do;

        r7w89_10=r7w89_10+1;

     end;

 

  end;

 

  do i=471 to 522;

     if job1wks=-3  then do;

        r7w89_1=-3;

     end;

     if job2wks=-3 then do;

        r7w89_2=-3;

     end;

     if job3wks=-3 then do;

        r7w89_3=-3;

     end;

     if job4wks=-3 then do;

        r7w89_4=-3;

     end;

     if job5wks=-3 then do;

        r7w89_5=-3;

     end;

     if job6wks=-3 then do;

        r7w89_6=-3;

     end;

     if job7wks=-3 then do;

        r7w89_7=-3;

     end;

     if job8wks=-3 then do;

        r7w89_8=-3;

     end;

     if job9wks=-3 then do;

        r7w89_9=-3;

     end;

     if job10wks=-3 then do;

        r7w89_10=-3;

     end;

 

  end;

 

  /* 1990 */

 

  do over r7wks90;

   r7wks90=0;

  end;

 

  do i=523 to 574;

     if job1wks=1 then do;

        r7w90_1=r7w90_1+1;

     end;

     if job2wks=1 then do;

        r7w90_2=r7w90_2+1;

     end;

     if job3wks=1 then do;

        r7w90_3=r7w90_3+1;

     end;

     if job4wks=1 then do;

        r7w90_4=r7w90_4+1;

     end;

     if job5wks=1 then do;

        r7w90_5=r7w90_5+1;

     end;

     if job6wks=1 then do;

        r7w90_6=r7w90_6+1;

     end;

     if job7wks=1 then do;

        r7w90_7=r7w90_7+1;

     end;

     if job8wks=1 then do;

        r7w90_8=r7w90_8+1;

     end;

     if job9wks=1 then do;

        r7w90_9=r7w90_9+1;

     end;

     if job10wks=1 then do;

        r7w90_10=r7w90_10+1;

     end;

 

  end;

 

  do i=523 to 574;

     if job1wks=-3  then do;

        r7w90_1=-3;

     end;

     if job2wks=-3 then do;

        r7w90_2=-3;

     end;

     if job3wks=-3 then do;

        r7w90_3=-3;

     end;

     if job4wks=-3 then do;

        r7w90_4=-3;

     end;

     if job5wks=-3 then do;

        r7w90_5=-3;

     end;

     if job6wks=-3 then do;

        r7w90_6=-3;

     end;

     if job7wks=-3 then do;

        r7w90_7=-3;

     end;

     if job8wks=-3 then do;

        r7w90_8=-3;

     end;

     if job9wks=-3 then do;

        r7w90_9=-3;

     end;

     if job10wks=-3 then do;

        r7w90_10=-3;

     end;

 

  end;

 

 

  /* 1991 */

 

  do over r7wks91;

   r7wks91=0;

  end;

 

  do i=575 to 626;

     if job1wks=1 then do;

        r7w91_1=r7w91_1+1;

     end;

     if job2wks=1 then do;

        r7w91_2=r7w91_2+1;

     end;

     if job3wks=1 then do;

        r7w91_3=r7w91_3+1;

     end;

     if job4wks=1 then do;

        r7w91_4=r7w91_4+1;

     end;

     if job5wks=1 then do;

        r7w91_5=r7w91_5+1;

     end;

     if job6wks=1 then do;

        r7w91_6=r7w91_6+1;

     end;

     if job7wks=1 then do;

        r7w91_7=r7w91_7+1;

     end;

     if job8wks=1 then do;

        r7w91_8=r7w91_8+1;

     end;

     if job9wks=1 then do;

        r7w91_9=r7w91_9+1;

     end;

     if job10wks=1 then do;

        r7w91_10=r7w91_10+1;

     end;

 

  end;

 

  do i=575 to 626;

     if job1wks=-3  then do;

        r7w91_1=-3;

     end;

     if job2wks=-3 then do;

        r7w91_2=-3;

     end;

     if job3wks=-3 then do;

        r7w91_3=-3;

     end;

     if job4wks=-3 then do;

        r7w91_4=-3;

     end;

     if job5wks=-3 then do;

        r7w91_5=-3;

     end;

     if job6wks=-3 then do;

        r7w91_6=-3;

     end;

     if job7wks=-3 then do;

        r7w91_7=-3;

     end;

     if job8wks=-3 then do;

        r7w91_8=-3;

     end;

     if job9wks=-3 then do;

        r7w91_9=-3;

     end;

     if job10wks=-3 then do;

        r7w91_10=-3;

     end;

 

  end;

 

  /* 1992 */

 

  do over r7wks92;

   r7wks92=0;

  end;

 

  do i=627 to 678;

     if job1wks=1 then do;

        r7w92_1=r7w92_1+1;

     end;

     if job2wks=1 then do;

        r7w92_2=r7w92_2+1;

     end;

     if job3wks=1 then do;

        r7w92_3=r7w92_3+1;

     end;

     if job4wks=1 then do;

        r7w92_4=r7w92_4+1;

     end;

     if job5wks=1 then do;

        r7w92_5=r7w92_5+1;

     end;

     if job6wks=1 then do;

        r7w92_6=r7w92_6+1;

     end;

     if job7wks=1 then do;

        r7w92_7=r7w92_7+1;

     end;

     if job8wks=1 then do;

        r7w92_8=r7w92_8+1;

     end;

     if job9wks=1 then do;

        r7w92_9=r7w92_9+1;

     end;

     if job10wks=1 then do;

        r7w92_10=r7w92_10+1;

     end;

 

  end;

 

  do i=627 to 678;

     if job1wks=-3  then do;

        r7w92_1=-3;

     end;

     if job2wks=-3 then do;

        r7w92_2=-3;

     end;

     if job3wks=-3 then do;

        r7w92_3=-3;

     end;

     if job4wks=-3 then do;

        r7w92_4=-3;

     end;

     if job5wks=-3 then do;

        r7w92_5=-3;

     end;

     if job6wks=-3 then do;

        r7w92_6=-3;

     end;

     if job7wks=-3 then do;

        r7w92_7=-3;

     end;

     if job8wks=-3 then do;

        r7w92_8=-3;

     end;

     if job9wks=-3 then do;

        r7w92_9=-3;

     end;

     if job10wks=-3 then do;

        r7w92_10=-3;

     end;

 

  end;

 

  /* 1993 */

 

  do over r7wks93;

   r7wks93=0;

  end;

 

  do i=679 to 730;

     if job1wks=1 then do;

        r7w93_1=r7w93_1+1;

     end;

     if job2wks=1 then do;

        r7w93_2=r7w93_2+1;

     end;

     if job3wks=1 then do;

        r7w93_3=r7w93_3+1;

     end;

     if job4wks=1 then do;

        r7w93_4=r7w93_4+1;

     end;

     if job5wks=1 then do;

        r7w93_5=r7w93_5+1;

     end;

     if job6wks=1 then do;

        r7w93_6=r7w93_6+1;

     end;

     if job7wks=1 then do;

        r7w93_7=r7w93_7+1;

     end;

     if job8wks=1 then do;

        r7w93_8=r7w93_8+1;

     end;

     if job9wks=1 then do;

        r7w93_9=r7w93_9+1;

     end;

     if job10wks=1 then do;

        r7w93_10=r7w93_10+1;

     end;

 

  end;

 

  do i=679 to 730;

     if job1wks=-3  then do;

        r7w93_1=-3;

     end;

     if job2wks=-3 then do;

        r7w93_2=-3;

     end;

     if job3wks=-3 then do;

        r7w93_3=-3;

     end;

     if job4wks=-3 then do;

        r7w93_4=-3;

     end;

     if job5wks=-3 then do;

        r7w93_5=-3;

     end;

     if job6wks=-3 then do;

        r7w93_6=-3;

     end;

     if job7wks=-3 then do;

        r7w93_7=-3;

     end;

     if job8wks=-3 then do;

        r7w93_8=-3;

     end;

     if job9wks=-3 then do;

        r7w93_9=-3;

     end;

     if job10wks=-3 then do;

        r7w93_10=-3;

     end;

 

  end;

 

  /* 1994 */

 

  do over r7wks94;

   r7wks94=0;

  end;

 

  do i=731 to 783;

     if job1wks=1 then do;

        r7w94_1=r7w94_1+1;

     end;

     if job2wks=1 then do;

        r7w94_2=r7w94_2+1;

     end;

     if job3wks=1 then do;

        r7w94_3=r7w94_3+1;

     end;

     if job4wks=1 then do;

        r7w94_4=r7w94_4+1;

     end;

     if job5wks=1 then do;

        r7w94_5=r7w94_5+1;

     end;

     if job6wks=1 then do;

        r7w94_6=r7w94_6+1;

     end;

     if job7wks=1 then do;

        r7w94_7=r7w94_7+1;

     end;

     if job8wks=1 then do;

        r7w94_8=r7w94_8+1;

     end;

     if job9wks=1 then do;

        r7w94_9=r7w94_9+1;

     end;

     if job10wks=1 then do;

        r7w94_10=r7w94_10+1;

     end;

 

  end;

 

  do i=731 to 783;

     if job1wks=-3  then do;

        r7w94_1=-3;

     end;

     if job2wks=-3 then do;

        r7w94_2=-3;

     end;

     if job3wks=-3 then do;

        r7w94_3=-3;

     end;

     if job4wks=-3 then do;

        r7w94_4=-3;

     end;

     if job5wks=-3 then do;

        r7w94_5=-3;

     end;

     if job6wks=-3 then do;

        r7w94_6=-3;

     end;

     if job7wks=-3 then do;

        r7w94_7=-3;

     end;

     if job8wks=-3 then do;

        r7w94_8=-3;

     end;

     if job9wks=-3 then do;

        r7w94_9=-3;

     end;

     if job10wks=-3 then do;

        r7w94_10=-3;

     end;

 

  end;

 

  /* 1995 */

 

  do over r7wks95;

   r7wks95=0;

  end;

 

  do i=784 to 835;

     if job1wks=1 then do;

        r7w95_1=r7w95_1+1;

     end;

     if job2wks=1 then do;

        r7w95_2=r7w95_2+1;

     end;

     if job3wks=1 then do;

        r7w95_3=r7w95_3+1;

     end;

     if job4wks=1 then do;

        r7w95_4=r7w95_4+1;

     end;

     if job5wks=1 then do;

        r7w95_5=r7w95_5+1;

     end;

     if job6wks=1 then do;

        r7w95_6=r7w95_6+1;

     end;

     if job7wks=1 then do;

        r7w95_7=r7w95_7+1;

     end;

     if job8wks=1 then do;

        r7w95_8=r7w95_8+1;

     end;

     if job9wks=1 then do;

        r7w95_9=r7w95_9+1;

     end;

     if job10wks=1 then do;

        r7w95_10=r7w95_10+1;

     end;

 

  end;

 

  do i=784 to 835;

     if job1wks=-3  then do;

        r7w95_1=-3;

     end;

     if job2wks=-3 then do;

        r7w95_2=-3;

     end;

     if job3wks=-3 then do;

        r7w95_3=-3;

     end;

     if job4wks=-3 then do;

        r7w95_4=-3;

     end;

     if job5wks=-3 then do;

        r7w95_5=-3;

     end;

     if job6wks=-3 then do;

        r7w95_6=-3;

     end;

     if job7wks=-3 then do;

        r7w95_7=-3;

     end;

     if job8wks=-3 then do;

        r7w95_8=-3;

     end;

     if job9wks=-3 then do;

        r7w95_9=-3;

     end;

     if job10wks=-3 then do;

        r7w95_10=-3;

     end;

 

  end;

 

  /* 1996 */

 

  do over r7wks96;

   r7wks96=0;

  end;

 

  do i=836 to 887;

     if job1wks=1 then do;

        r7w96_1=r7w96_1+1;

     end;

     if job2wks=1 then do;

        r7w96_2=r7w96_2+1;

     end;

     if job3wks=1 then do;

        r7w96_3=r7w96_3+1;

     end;

     if job4wks=1 then do;

        r7w96_4=r7w96_4+1;

     end;

     if job5wks=1 then do;

        r7w96_5=r7w96_5+1;

     end;

     if job6wks=1 then do;

        r7w96_6=r7w96_6+1;

     end;

     if job7wks=1 then do;

        r7w96_7=r7w96_7+1;

     end;

     if job8wks=1 then do;

        r7w96_8=r7w96_8+1;

     end;

     if job9wks=1 then do;

        r7w96_9=r7w96_9+1;

     end;

     if job10wks=1 then do;

        r7w96_10=r7w96_10+1;

     end;

 

  end;

 

  do i=836 to 887;

     if job1wks=-3  then do;

        r7w96_1=-3;

     end;

     if job2wks=-3 then do;

        r7w96_2=-3;

     end;

     if job3wks=-3 then do;

        r7w96_3=-3;

     end;

     if job4wks=-3 then do;

        r7w96_4=-3;

     end;

     if job5wks=-3 then do;

        r7w96_5=-3;

     end;

     if job6wks=-3 then do;

        r7w96_6=-3;

     end;

     if job7wks=-3 then do;

        r7w96_7=-3;

     end;

     if job8wks=-3 then do;

        r7w96_8=-3;

     end;

     if job9wks=-3 then do;

        r7w96_9=-3;

     end;

     if job10wks=-3 then do;

        r7w96_10=-3;

     end;

 

  end;

 

  /* 1997 */

 

  do over r7wks97;

   r7wks97=0;

  end;

 

  do i=888 to 939;

     if job1wks=1 then do;

        r7w97_1=r7w97_1+1;

     end;

     if job2wks=1 then do;

        r7w97_2=r7w97_2+1;

     end;

     if job3wks=1 then do;

        r7w97_3=r7w97_3+1;

     end;

     if job4wks=1 then do;

        r7w97_4=r7w97_4+1;

     end;

     if job5wks=1 then do;

        r7w97_5=r7w97_5+1;

     end;

     if job6wks=1 then do;

        r7w97_6=r7w97_6+1;

     end;

     if job7wks=1 then do;

        r7w97_7=r7w97_7+1;

     end;

     if job8wks=1 then do;

        r7w97_8=r7w97_8+1;

     end;

     if job9wks=1 then do;

        r7w97_9=r7w97_9+1;

     end;

     if job10wks=1 then do;

        r7w97_10=r7w97_10+1;

     end;

 

  end;

 

  do i=888 to 939;

     if job1wks=-3  then do;

        r7w97_1=-3;

     end;

     if job2wks=-3 then do;

        r7w97_2=-3;

     end;

     if job3wks=-3 then do;

        r7w97_3=-3;

     end;

     if job4wks=-3 then do;

        r7w97_4=-3;

     end;

     if job5wks=-3 then do;

        r7w97_5=-3;

     end;

     if job6wks=-3 then do;

        r7w97_6=-3;

     end;

     if job7wks=-3 then do;

        r7w97_7=-3;

     end;

     if job8wks=-3 then do;

        r7w97_8=-3;

     end;

     if job9wks=-3 then do;

        r7w97_9=-3;

     end;

     if job10wks=-3 then do;

        r7w97_10=-3;

     end;

 

  end;

 

  /* 1998 */

 

  do over r7wks98;

   r7wks98=0;

  end;

 

  do i=940 to 991;

     if job1wks=1 then do;

        r7w98_1=r7w98_1+1;

     end;

     if job2wks=1 then do;

        r7w98_2=r7w98_2+1;

     end;

     if job3wks=1 then do;

        r7w98_3=r7w98_3+1;

     end;

     if job4wks=1 then do;

        r7w98_4=r7w98_4+1;

     end;

     if job5wks=1 then do;

        r7w98_5=r7w98_5+1;

     end;

     if job6wks=1 then do;

        r7w98_6=r7w98_6+1;

     end;

     if job7wks=1 then do;

        r7w98_7=r7w98_7+1;

     end;

     if job8wks=1 then do;

        r7w98_8=r7w98_8+1;

     end;

     if job9wks=1 then do;

        r7w98_9=r7w98_9+1;

     end;

     if job10wks=1 then do;

        r7w98_10=r7w98_10+1;

     end;

 

  end;

 

  do i=940 to 991;

     if job1wks=-3  then do;

        r7w98_1=-3;

     end;

     if job2wks=-3 then do;

        r7w98_2=-3;

     end;

     if job3wks=-3 then do;

        r7w98_3=-3;

     end;

     if job4wks=-3 then do;

        r7w98_4=-3;

     end;

     if job5wks=-3 then do;

        r7w98_5=-3;

     end;

     if job6wks=-3 then do;

        r7w98_6=-3;

     end;

     if job7wks=-3 then do;

        r7w98_7=-3;

     end;

     if job8wks=-3 then do;

        r7w98_8=-3;

     end;

     if job9wks=-3 then do;

        r7w98_9=-3;

     end;

     if job10wks=-3 then do;

        r7w98_10=-3;

     end;

 

  end;

 

  /* 1999 */

 

  do over r7wks99;

   r7wks99=0;

  end;

 

  do i=992 to 1043;

     if job1wks=1 then do;

        r7w99_1=r7w99_1+1;

     end;

     if job2wks=1 then do;

        r7w99_2=r7w99_2+1;

     end;

     if job3wks=1 then do;

        r7w99_3=r7w99_3+1;

     end;

     if job4wks=1 then do;

        r7w99_4=r7w99_4+1;

     end;

     if job5wks=1 then do;

        r7w99_5=r7w99_5+1;

     end;

     if job6wks=1 then do;

        r7w99_6=r7w99_6+1;

     end;

     if job7wks=1 then do;

        r7w99_7=r7w99_7+1;

     end;

     if job8wks=1 then do;

        r7w99_8=r7w99_8+1;

     end;

     if job9wks=1 then do;

        r7w99_9=r7w99_9+1;

     end;

     if job10wks=1 then do;

        r7w99_10=r7w99_10+1;

     end;

 

  end;

 

  do i=992 to 1043;

     if job1wks=-3  then do;

        r7w99_1=-3;

     end;

     if job2wks=-3 then do;

        r7w99_2=-3;

     end;

     if job3wks=-3 then do;

        r7w99_3=-3;

     end;

     if job4wks=-3 then do;

        r7w99_4=-3;

     end;

     if job5wks=-3 then do;

        r7w99_5=-3;

     end;

     if job6wks=-3 then do;

        r7w99_6=-3;

     end;

     if job7wks=-3 then do;

        r7w99_7=-3;

     end;

     if job8wks=-3 then do;

        r7w99_8=-3;

     end;

     if job9wks=-3 then do;

        r7w99_9=-3;

     end;

     if job10wks=-3 then do;

        r7w99_10=-3;

     end;

 

  end;

 

  /* 2000 */

 

  do over r7wks00;

   r7wks00=0;

  end;

 

  do i=1044 to 1096;

     if job1wks=1 then do;

        r7w00_1=r7w00_1+1;

     end;

     if job2wks=1 then do;

        r7w00_2=r7w00_2+1;

     end;

     if job3wks=1 then do;

        r7w00_3=r7w00_3+1;

     end;

     if job4wks=1 then do;

        r7w00_4=r7w00_4+1;

     end;

     if job5wks=1 then do;

        r7w00_5=r7w00_5+1;

     end;

     if job6wks=1 then do;

        r7w00_6=r7w00_6+1;

     end;

     if job7wks=1 then do;

        r7w00_7=r7w00_7+1;

     end;

     if job8wks=1 then do;

        r7w00_8=r7w00_8+1;

     end;

     if job9wks=1 then do;

        r7w00_9=r7w00_9+1;

     end;

     if job10wks=1 then do;

        r7w00_10=r7w00_10+1;

     end;

 

  end;

 

  do i=1044 to 1096;

     if job1wks=-3  then do;

        r7w00_1=-3;

     end;

     if job2wks=-3 then do;

        r7w00_2=-3;

     end;

     if job3wks=-3 then do;

        r7w00_3=-3;

     end;

     if job4wks=-3 then do;

        r7w00_4=-3;

     end;

     if job5wks=-3 then do;

        r7w00_5=-3;

     end;

     if job6wks=-3 then do;

        r7w00_6=-3;

     end;

     if job7wks=-3 then do;

        r7w00_7=-3;

     end;

     if job8wks=-3 then do;

        r7w00_8=-3;

     end;

     if job9wks=-3 then do;

        r7w00_9=-3;

     end;

     if job10wks=-3 then do;

        r7w00_10=-3;

     end;

 

  end;

 

  /* 2001 */

 

  do over r7wks01;

   r7wks01=0;

  end;

 

  do i=1097 to 1148;

     if job1wks=1 then do;

        r7w01_1=r7w01_1+1;

     end;

     if job2wks=1 then do;

        r7w01_2=r7w01_2+1;

     end;

     if job3wks=1 then do;

        r7w01_3=r7w01_3+1;

     end;

     if job4wks=1 then do;

        r7w01_4=r7w01_4+1;

     end;

     if job5wks=1 then do;

        r7w01_5=r7w01_5+1;

     end;

     if job6wks=1 then do;

        r7w01_6=r7w01_6+1;

     end;

     if job7wks=1 then do;

        r7w01_7=r7w01_7+1;

     end;

     if job8wks=1 then do;

        r7w01_8=r7w01_8+1;

     end;

     if job9wks=1 then do;

        r7w01_9=r7w01_9+1;

     end;

     if job10wks=1 then do;

        r7w01_10=r7w01_10+1;

     end;

 

  end;

 

  do i=1097 to 1148;

     if job1wks=-3  then do;

        r7w01_1=-3;

     end;

     if job2wks=-3 then do;

        r7w01_2=-3;

     end;

     if job3wks=-3 then do;

        r7w01_3=-3;

     end;

     if job4wks=-3 then do;

        r7w01_4=-3;

     end;

     if job5wks=-3 then do;

        r7w01_5=-3;

     end;

     if job6wks=-3 then do;

        r7w01_6=-3;

     end;

     if job7wks=-3 then do;

        r7w01_7=-3;

     end;

     if job8wks=-3 then do;

        r7w01_8=-3;

     end;

     if job9wks=-3 then do;

        r7w01_9=-3;

     end;

     if job10wks=-3 then do;

        r7w01_10=-3;

     end;

 

  end;

 

  /* 2002 */

 

  do over r7wks02;

   r7wks02=0;

  end;

 

  do i=1149 to 1200;

     if job1wks=1 then do;

        r7w02_1=r7w02_1+1;

     end;

     if job2wks=1 then do;

        r7w02_2=r7w02_2+1;

     end;

     if job3wks=1 then do;

        r7w02_3=r7w02_3+1;

     end;

     if job4wks=1 then do;

        r7w02_4=r7w02_4+1;

     end;

     if job5wks=1 then do;

        r7w02_5=r7w02_5+1;

     end;

     if job6wks=1 then do;

        r7w02_6=r7w02_6+1;

     end;

     if job7wks=1 then do;

        r7w02_7=r7w02_7+1;

     end;

     if job8wks=1 then do;

        r7w02_8=r7w02_8+1;

     end;

     if job9wks=1 then do;

        r7w02_9=r7w02_9+1;

     end;

     if job10wks=1 then do;

        r7w02_10=r7w02_10+1;

     end;

 

  end;

 

  do i=1149 to 1200;

     if job1wks=-3  then do;

        r7w02_1=-3;

     end;

     if job2wks=-3 then do;

        r7w02_2=-3;

     end;

     if job3wks=-3 then do;

        r7w02_3=-3;

     end;

     if job4wks=-3 then do;

        r7w02_4=-3;

     end;

     if job5wks=-3 then do;

        r7w02_5=-3;

     end;

     if job6wks=-3 then do;

        r7w02_6=-3;

     end;

     if job7wks=-3 then do;

        r7w02_7=-3;

     end;

     if job8wks=-3 then do;

        r7w02_8=-3;

     end;

     if job9wks=-3 then do;

        r7w02_9=-3;

     end;

     if job10wks=-3 then do;

        r7w02_10=-3;

     end;

 

  end;

 

  /* 2003 */

  do over r7wks03;

   r7wks03=0;

  end;

 

  do i=1201 to 1252;

     if job1wks=1 then do;

        r7w03_1=r7w03_1+1;

     end;

     if job2wks=1 then do;

        r7w03_2=r7w03_2+1;

     end;

     if job3wks=1 then do;

        r7w03_3=r7w03_3+1;

     end;

     if job4wks=1 then do;

        r7w03_4=r7w03_4+1;

     end;

     if job5wks=1 then do;

        r7w03_5=r7w03_5+1;

     end;

     if job6wks=1 then do;

        r7w03_6=r7w03_6+1;

     end;

     if job7wks=1 then do;

        r7w03_7=r7w03_7+1;

     end;

     if job8wks=1 then do;

        r7w03_8=r7w03_8+1;

     end;

     if job9wks=1 then do;

        r7w03_9=r7w03_9+1;

     end;

     if job10wks=1 then do;

        r7w03_10=r7w03_10+1;

     end;

 

  end;

 

  do i=1201 to 1252;

     if job1wks=-3  then do;

        r7w03_1=-3;

     end;

     if job2wks=-3 then do;

        r7w03_2=-3;

     end;

     if job3wks=-3 then do;

        r7w03_3=-3;

     end;

     if job4wks=-3 then do;

        r7w03_4=-3;

     end;

     if job5wks=-3 then do;

        r7w03_5=-3;

     end;

     if job6wks=-3 then do;

        r7w03_6=-3;

     end;

     if job7wks=-3 then do;

        r7w03_7=-3;

     end;

     if job8wks=-3 then do;

        r7w03_8=-3;

     end;

     if job9wks=-3 then do;

        r7w03_9=-3;

     end;

     if job10wks=-3 then do;

        r7w03_10=-3;

     end;

 

  end;

 

  /* 2004 */

  do over r7wks04;

   r7wks04=0;

  end;

 

  do i=1253 to 1280;

     if job1wks=1 then do;

        r7w04_1=r7w04_1+1;

     end;

     if job2wks=1 then do;

        r7w04_2=r7w04_2+1;

     end;

     if job3wks=1 then do;

        r7w04_3=r7w04_3+1;

     end;

     if job4wks=1 then do;

        r7w04_4=r7w04_4+1;

     end;

     if job5wks=1 then do;

        r7w04_5=r7w04_5+1;

     end;

     if job6wks=1 then do;

        r7w04_6=r7w04_6+1;

     end;

     if job7wks=1 then do;

        r7w04_7=r7w04_7+1;

     end;

     if job8wks=1 then do;

        r7w04_8=r7w04_8+1;

     end;

     if job9wks=1 then do;

        r7w04_9=r7w04_9+1;

     end;

     if job10wks=1 then do;

        r7w04_10=r7w04_10+1;

     end;

 

  end;

 

  do i=1253 to 1280;

     if job1wks=-3  then do;

        r7w04_1=-3;

     end;

     if job2wks=-3 then do;

        r7w04_2=-3;

     end;

     if job3wks=-3 then do;

        r7w04_3=-3;

     end;

     if job4wks=-3 then do;

        r7w04_4=-3;

     end;

     if job5wks=-3 then do;

        r7w04_5=-3;

     end;

     if job6wks=-3 then do;

        r7w04_6=-3;

     end;

     if job7wks=-3 then do;

        r7w04_7=-3;

     end;

     if job8wks=-3 then do;

        r7w04_8=-3;

     end;

     if job9wks=-3 then do;

        r7w04_9=-3;

     end;

     if job10wks=-3 then do;

        r7w04_10=-3;

     end;

 

  end;

 

  do i=1 to 10;

     if r7int=-5 then do;

       r7wks80=-5;         r7wks92=-5;

       r7wks81=-5;             r7wks93=-5;

       r7wks82=-5;             r7wks94=-5;

       r7wks83=-5;             r7wks95=-5;

       r7wks84=-5;             r7wks96=-5;

       r7wks85=-5;             r7wks97=-5;

       r7wks86=-5;             r7wks98=-5;

       r7wks87=-5;             r7wks99=-5;

       r7wks88=-5;             r7wks00=-5;

       r7wks89=-5;             r7wks01=-5;

       r7wks90=-5;             r7wks02=-5;

       r7wks91=-5;             r7wks03=-5;

                               r7wks04=-5;

     end;

  end;

 

Return to top


 

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

  **  Total tenure at job # as of survey date                             **

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

  **  This program creates a variable for each potential job (10) relating**

  **  the total length of job tenure in weeks excluding within-job gaps.  **

  **  The default value is set to zero for non-existent jobs.             **

  **  Created variables: r7ten1-r7ten10

  **************************************************************************;

 

 

 

  array job1wks  (i) w1_1-w1_1280;

  array job2wks  (i) w2_1-w2_1280;

  array job3wks  (i) w3_1-w3_1280;

  array job4wks  (i) w4_1-w4_1280;

  array job5wks  (i) w5_1-w5_1280;

  array job6wks  (i) w6_1-w6_1280;

  array job7wks  (i) w7_1-w7_1280;

  array job8wks  (i) w8_1-w8_1280;

  array job9wks  (i) w9_1-w9_1280;

  array job10wks (i) w10_1-w10_1280;

 

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

  ** Calculate cumulative weeks on individual jobs for all years **

  *****************************************************************;

 

  r7ten1=0;

  r7ten2=0;

  r7ten3=0;

  r7ten4=0;

  r7ten5=0;

  r7ten6=0;

  r7ten7=0;

  r7ten8=0;

  r7ten9=0;

  r7ten10=0;

 

 

  do i=1 to 1280;

     if job1wks=1 then do;

        r7ten1=r7ten1+1;

     end;

     if job2wks=1 then do;

        r7ten2=r7ten2+1;

     end;

     if job3wks=1 then do;

        r7ten3=r7ten3+1;

     end;

     if job4wks=1 then do;

        r7ten4=r7ten4+1;

     end;

     if job5wks=1 then do;

        r7ten5=r7ten5+1;

     end;

     if job6wks=1 then do;

        r7ten6=r7ten6+1;

     end;

     if job7wks=1 then do;

        r7ten7=r7ten7+1;

     end;

     if job8wks=1 then do;

        r7ten8=r7ten8+1;

     end;

     if job9wks=1 then do;

        r7ten9=r7ten9+1;

     end;

     if job10wks=1 then do;

        r7ten10=r7ten10+1;

     end;

 

  end;

 

  flag=0;

 

  do i=1 to 1280;

     if job1wks=-3 then do;

        r7ten1=-3;

        flag=1;

     end;

     if job2wks=-3 then do;

        r7ten2=-3;

        flag=2;

     end;

     if job3wks=-3 then do;

        r7ten3=-3;

        flag=3;

     end;

     if job4wks=-3 then do;

        r7ten4=-3;

        flag=4;

     end;

     if job5wks=-3 then do;

        r7ten5=-3;

        flag=5;

     end;

     if job6wks=-3 then do;

        r7ten6=-3;

        flag=6;

     end;

     if job7wks=-3 then do;

        r7ten7=-3;

        flag=7;

     end;

     if job8wks=-3 then do;

        r7ten8=-3;

        flag=8;

     end;

     if job9wks=-3 then do;

        r7ten9=-3;

        flag=9;

     end;

     if job10wks=-3 then do;

        r7ten10=-3;

        flag=10;

     end;

 

  end;

 

 

  if r7int=-5 then do;

     r7ten1=-5; r7ten2=-5; r7ten3=-5; r7ten4=-5; r7ten5=-5; r7ten6=-5; r7ten7=-5; r7ten8=-5; r7ten9=-5;

     r7ten10=-5;

  end;

 

Return to top


 

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

  **  Total annual hours worked at employee-type jobs during 19##                   **

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

  **  This program creates yearly variables aggregated across jobs relating the     **

  **  total number of hours worked. A variable is created for each respondent       **

  **  even if the respondent has worked no jobs in a given year with the default    **

  **  value set to zero (0).                                                        **

  **                                                                                **

  **  There are (potentially) four hours variables used to create this variable.    **

  **  When both "starting hours" and "current hours" are reported, I use the        **

  **  latter to construct the annual hours measure.                                 **

  **                                                                                **

  **  Variables created:  r7hrs80-r7hrs99 r7hrs00-r7hrs04                           **

  **                      r7shrs80-r7shrs99 r7shrs00-r7shrs04                       **

  **                      r7ehrs80-r7ehrs99 r7ehrs00-r7ehrs04                       **

  **                                                                                **

  **  For example:  r7hrs93 gives the total hours worked on all jobs in 1993.       **

  **                                                                                **

  ************************************************************************************;

 

 

 

  *** Organize hours for each job;

 

  array starw    (k)  starw01-  starw10;

  array stopw    (k)  stopw01-  stopw10;

  array rghrsb   (k) rghrsb01- rghrsb10;

  array rghrs    (k)  rghrs01-  rghrs10;

  array othrs    (k)  othrs01-  othrs10;

  array hours    (k)  hours01-  hours10;

  array e23901   (k) e2390101- e2390110;

  array e24501   (k) e2450101- e2450110;

  array e34402   (k) e3440201- e3440210;

  array e34403   (k) e3440301- e3440310;

  array e34428   (k) e3442801- e3442810;

  array e37904   (k) e3790401- e3790410;

  array e38000b (k) e38000b01-e38000b10;

  array e38000f (k) e38000f01-e38000f10;

  array e38002   (k) e3800201- e3800210;

  array e38102   (k) e3810201- e3810210;

  array e38103   (k) e3810301- e3810310;

  array e38105   (k) e3810501- e3810510;

  array e59901   (k) e5990101- e5990110;

  array e88000   (k) e8800001- e8800010;

  array e88501   (k) e8850101- e8850110;

  array e98402   (k) e9840201- e9840210;

  array e98403   (k) e9840301- e9840310;

  array e98429   (k) e9842901- e9842910;

  array e1002252 (k) e100225012 e100225022 e100225032 e100225042 e100225052 e100225062 e100225072 e100225082 e100225092

                     e100225102;

  array e100231  (k) e10023101-e10023110;

  array e1002253 (k) e100225013 e100225023 e100225033 e100225043 e100225053 e100225063 e100225073 e100225083 e100225093

                     e100225103;

  array e100232  (k) e10023201-e10023210;

  array e226042  (k) e22604012 e22604022 e22604032 e22604042 e22604052 e22604062 e22604072 e22604082 e22604092

                     e22604102;

  array e22610   (k) e2261001-e2261010;

  array e226043  (k) e22604013 e22604023 e22604033 e22604043 e22604053 e22604063 e22604073 e22604083 e22604093

                     e22604103;

  array e22611   (k) e2261101-e2261110;

 

  array starfl   (k) starfl_1-starfl_10;

  array stopfl   (k) stopfl_1-stopfl_10;

 

  ***** Initialize the number of hours per week to 0;

 

  do k=1 to 10;

     rghrsb =0;

     rghrs=0;

     othrs=0;

     hours=0;

  end;

 

  ***** Regular rghrs Per Week;

 

  do k=1 to 10;

   if e23901 not in (.,-4,-5) then rghrsb=e23901;

   if e34402 not in (.,-4,-5) then rghrsb=e34402;

   if e34428 not in (.,-4,-5) then rghrsb=e34428;

 

   if e22610 not in (.,-4,-5) then rghrsb=e22610;

   else if e226042 lt 0 and e226042 not in (.,-4,-5) then rghrsb=-3;

 

   if e88000 not in (.,-4,-5) then rghrsb=e88000;

   if e98402 not in (.,-4,-5) then rghrsb=e98402;

   if e98429 not in (.,-4,-5) then rghrsb=e98429;

 

   if e100231 not in (.,-4,-5) then rghrsb=e100231;

   else if e1002252 lt 0 and e1002252 not in (.,-4,-5) then rghrsb=-3;

 

   if e38000f not in (.,-4,-5) then rghrsb=e38000f;

 

   if e38002 in (.,-4,0) then rghrs=rghrsb;

   else if e38002 lt 0 and e38002 ne -5 then rghrs=-3;

   else if e38002 gt 0 then do;

    if rghrsb gt 0 then rghrs=rghrsb-e38002;

    else rghrs=-3;

   end;

 

   if e38000b lt 0 and e38000b not in (-4,-5,.) then rghrs=-3;

 

   if e38102 in (1,3) and e38103 not in (.,-4,-5) then rghrs=e38103;

   if e38102 lt 0 and e38102 not in (-4,-5, .) then rghrs=-3;

   if e37904 > -4 then rghrs=e37904;

   if e59901 > -4 then rghrs=e59901;

  end;

 

  ***** Overtime Hours Per Week;

 

  do k=1 to 10;

   if e24501 not in (.,-4,-5) then othrs=e24501;

   if e34403 not in (.,-4,-5) then othrs=e34403;

   if e22611 not in (.,-4,-5) then othrs=e22611;

   else if e226043 lt 0 and e226043 not in (.,-4,-5) then othrs=-3;

   if e88501 not in (.,-4,-5) then othrs=e88501;

   if e98403 not in (.,-4,-5) then othrs=e98403;

   if e100232 not in (.,-4,-5) then othrs=e100232;

   else if e1002253 lt 0 and e1002253 not in (.,-4,-5) then othrs=-3;

   if e38002 not in (.,-4,-5) then othrs=e38002;

   if e38105 not in (.,-4,-5) then othrs=e38105;

   else if e38102 lt 0 and e38102 not in (.,-4,-5) then othrs=-3;

  end;

 

  ***** Total Hours Per Week;

 

  do k=1 to 10;

    if rghrs in (-1,-2,-3) or othrs in (-1,-2,-3) then hours=-3;

    else if rghrs ge 0 and othrs ge 0 then hours=rghrs + othrs;

  end;

 

 

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

  ** Calculate cumulative weeks on individual jobs for each year **

  *****************************************************************;

 

 

  array self (k) self01-self10;

 

  /* 1980 */

  * created no. of weeks worked on each job;

  array wks80 (k) r7w80_1-r7w80_10;

  * hours worked on each job;

  array ah80 (k) ah80_1-ah80_10;

  array sah80 (k) sah80_1-sah80_10;

  array eah80 (k) eah80_1-eah80_10;

 

  do k=1 to 10;

    ah80=0;

    sah80=0;

    eah80=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks80 ge 0 then ah80=hours*wks80;

    else if wks80=-3 or (hours in (-1,-2,-3) and wks80 ne 0) then ah80=-3;

    if self=1 then sah80=ah80;

    if self=0 then eah80=ah80;

  end;

 

  * total hours worked in the year;

  r7hrs80=0;

  r7shrs80=0;

  r7ehrs80=0;

 

  do k=1 to 10;

    if ah80 ge 0 then r7hrs80 = r7hrs80 + ah80;

    if sah80 ge 0 then r7shrs80 = r7shrs80 + sah80;

    if eah80 ge 0 then r7ehrs80 = r7ehrs80 + eah80;

  end;

 

  do k=1 to 10;

    if ah80=-3 then r7hrs80 = -3;

    if sah80=-3 then r7shrs80 = -3;

    if eah80=-3 then r7ehrs80 = -3;

  end;

 

  /* 1981 */

  * created no. of weeks worked on each job;

  array wks81 (k) r7w81_1-r7w81_10;

  * hours worked on each job;

  array ah81 (k) ah81_1-ah81_10;

  array sah81 (k) sah81_1-sah81_10;

  array eah81 (k) eah81_1-eah81_10;

 

  do k=1 to 10;

    ah81=0;

    sah81=0;

    eah81=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks81 ge 0 then ah81=hours*wks81;

    else if wks81=-3 or (hours in (-1,-2,-3) and wks81 ne 0) then ah81=-3;

    if self=1 then sah81=ah81;

    if self=0 then eah81=ah81;

  end;

 

  * total hours worked in the year;

  r7hrs81=0;

  r7shrs81=0;

  r7ehrs81=0;

 

  do k=1 to 10;

    if ah81 ge 0 then r7hrs81 = r7hrs81 + ah81;

    if sah81 ge 0 then r7shrs81 = r7shrs81 + sah81;

    if eah81 ge 0 then r7ehrs81 = r7ehrs81 + eah81;

  end;

 

  do k=1 to 10;

    if ah81=-3 then r7hrs81 = -3;

    if sah81=-3 then r7shrs81 = -3;

    if eah81=-3 then r7ehrs81 = -3;

  end;

 

  /* 1982 */

  * created no. of weeks worked on each job;

  array wks82 (k) r7w82_1-r7w82_10;

  * hours worked on each job;

  array ah82 (k) ah82_1-ah82_10;

  array sah82 (k) sah82_1-sah82_10;

  array eah82 (k) eah82_1-eah82_10;

 

  do k=1 to 10;

    ah82=0;

    sah82=0;

    eah82=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks82 ge 0 then ah82=hours*wks82;

    else if wks82=-3 or (hours in (-1,-2,-3) and wks82 ne 0) then ah82=-3;

    if self=1 then sah82=ah82;

    if self=0 then eah82=ah82;

  end;

 

  * total hours worked in the year;

  r7hrs82=0;

  r7shrs82=0;

  r7ehrs82=0;

 

  do k=1 to 10;

    if ah82 ge 0 then r7hrs82 = r7hrs82 + ah82;

    if sah82 ge 0 then r7shrs82 = r7shrs82 + sah82;

    if eah82 ge 0 then r7ehrs82 = r7ehrs82 + eah82;

  end;

 

  do k=1 to 10;

    if ah82=-3 then r7hrs82 = -3;

    if sah82=-3 then r7shrs82 = -3;

    if eah82=-3 then r7ehrs82 = -3;

  end;

 

  /* 1983 */

  * created no. of weeks worked on each job;

  array wks83 (k) r7w83_1-r7w83_10;

  * hours worked on each job;

  array ah83 (k) ah83_1-ah83_10;

  array sah83 (k) sah83_1-sah83_10;

  array eah83 (k) eah83_1-eah83_10;

 

  do k=1 to 10;

    ah83=0;

    sah83=0;

    eah83=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks83 ge 0 then ah83=hours*wks83;

    else if wks83=-3 or (hours in (-1,-2,-3) and wks83 ne 0) then ah83=-3;

    if self=1 then sah83=ah83;

    if self=0 then eah83=ah83;

  end;

 

  * total hours worked in the year;

  r7hrs83=0;

  r7shrs83=0;

  r7ehrs83=0;

 

  do k=1 to 10;

    if ah83 ge 0 then r7hrs83 = r7hrs83 + ah83;

    if sah83 ge 0 then r7shrs83 = r7shrs83 + sah83;

    if eah83 ge 0 then r7ehrs83 = r7ehrs83 + eah83;

  end;

 

  do k=1 to 10;

    if ah83=-3 then r7hrs83 = -3;

    if sah83=-3 then r7shrs83 = -3;

    if eah83=-3 then r7ehrs83 = -3;

  end;

 

  /* 1984 */

  * created no. of weeks worked on each job;

  array wks84 (k) r7w84_1-r7w84_10;

  * hours worked on each job;

  array ah84 (k) ah84_1-ah84_10;

  array sah84 (k) sah84_1-sah84_10;

  array eah84 (k) eah84_1-eah84_10;

 

  do k=1 to 10;

    ah84=0;

    sah84=0;

    eah84=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks84 ge 0 then ah84=hours*wks84;

    else if wks84=-3 or (hours in (-1,-2,-3) and wks84 ne 0) then ah84=-3;

    if self=1 then sah84=ah84;

    if self=0 then eah84=ah84;

  end;

 

  * total hours worked in the year;

  r7hrs84=0;

  r7shrs84=0;

  r7ehrs84=0;

 

  do k=1 to 10;

    if ah84 ge 0 then r7hrs84 = r7hrs84 + ah84;

    if sah84 ge 0 then r7shrs84 = r7shrs84 + sah84;

    if eah84 ge 0 then r7ehrs84 = r7ehrs84 + eah84;

  end;

 

  do k=1 to 10;

    if ah84=-3 then r7hrs84 = -3;

    if sah84=-3 then r7shrs84 = -3;

    if eah84=-3 then r7ehrs84 = -3;

  end;

 

  /* 1985 */

  * created no. of weeks worked on each job;

  array wks85 (k) r7w85_1-r7w85_10;

  * hours worked on each job;

  array ah85 (k) ah85_1-ah85_10;

  array sah85 (k) sah85_1-sah85_10;

  array eah85 (k) eah85_1-eah85_10;

 

  do k=1 to 10;

    ah85=0;

    sah85=0;

    eah85=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks85 ge 0 then ah85=hours*wks85;

    else if wks85=-3 or (hours in (-1,-2,-3) and wks85 ne 0) then ah85=-3;

    if self=1 then sah85=ah85;

    if self=0 then eah85=ah85;

  end;

 

  * total hours worked in the year;

  r7hrs85=0;

  r7shrs85=0;

  r7ehrs85=0;

 

  do k=1 to 10;

    if ah85 ge 0 then r7hrs85 = r7hrs85 + ah85;

    if sah85 ge 0 then r7shrs85 = r7shrs85 + sah85;

    if eah85 ge 0 then r7ehrs85 = r7ehrs85 + eah85;

  end;

 

  do k=1 to 10;

    if ah85=-3 then r7hrs85 = -3;

    if sah85=-3 then r7shrs85 = -3;

    if eah85=-3 then r7ehrs85 = -3;

  end;

 

  /* 1986 */

  * created no. of weeks worked on each job;

  array wks86 (k) r7w86_1-r7w86_10;

  * hours worked on each job;

  array ah86 (k) ah86_1-ah86_10;

  array sah86 (k) sah86_1-sah86_10;

  array eah86 (k) eah86_1-eah86_10;

 

  do k=1 to 10;

    ah86=0;

    sah86=0;

    eah86=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks86 ge 0 then ah86=hours*wks86;

    else if wks86=-3 or (hours in (-1,-2,-3) and wks86 ne 0) then ah86=-3;

    if self=1 then sah86=ah86;

    if self=0 then eah86=ah86;

  end;

 

  * total hours worked in the year;

  r7hrs86=0;

  r7shrs86=0;

  r7ehrs86=0;

 

  do k=1 to 10;

    if ah86 ge 0 then r7hrs86 = r7hrs86 + ah86;

    if sah86 ge 0 then r7shrs86 = r7shrs86 + sah86;

    if eah86 ge 0 then r7ehrs86 = r7ehrs86 + eah86;

  end;

 

  do k=1 to 10;

    if ah86=-3 then r7hrs86 = -3;

    if sah86=-3 then r7shrs86 = -3;

    if eah86=-3 then r7ehrs86 = -3;

  end;

 

  /* 1987 */

  * created no. of weeks worked on each job;

  array wks87 (k) r7w87_1-r7w87_10;

  * hours worked on each job;

  array ah87 (k) ah87_1-ah87_10;

  array sah87 (k) sah87_1-sah87_10;

  array eah87 (k) eah87_1-eah87_10;

 

  do k=1 to 10;

    ah87=0;

    sah87=0;

    eah87=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks87 ge 0 then ah87=hours*wks87;

    else if wks87=-3 or (hours in (-1,-2,-3) and wks87 ne 0) then ah87=-3;

    if self=1 then sah87=ah87;

    if self=0 then eah87=ah87;

  end;

 

  * total hours worked in the year;

  r7hrs87=0;

  r7shrs87=0;

  r7ehrs87=0;

 

  do k=1 to 10;

    if ah87 ge 0 then r7hrs87 = r7hrs87 + ah87;

    if sah87 ge 0 then r7shrs87 = r7shrs87 + sah87;

    if eah87 ge 0 then r7ehrs87 = r7ehrs87 + eah87;

  end;

 

  do k=1 to 10;

    if ah87=-3 then r7hrs87 = -3;

    if sah87=-3 then r7shrs87 = -3;

    if eah87=-3 then r7ehrs87 = -3;

  end;

 

  /* 1988 */

  * created no. of weeks worked on each job;

  array wks88 (k) r7w88_1-r7w88_10;

  * hours worked on each job;

  array ah88 (k) ah88_1-ah88_10;

  array sah88 (k) sah88_1-sah88_10;

  array eah88 (k) eah88_1-eah88_10;

 

  do k=1 to 10;

    ah88=0;

    sah88=0;

    eah88=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks88 ge 0 then ah88=hours*wks88;

    else if wks88=-3 or (hours in (-1,-2,-3) and wks88 ne 0) then ah88=-3;

    if self=1 then sah88=ah88;

    if self=0 then eah88=ah88;

  end;

 

  * total hours worked in the year;

  r7hrs88=0;

  r7shrs88=0;

  r7ehrs88=0;

 

  do k=1 to 10;

    if ah88 ge 0 then r7hrs88 = r7hrs88 + ah88;

    if sah88 ge 0 then r7shrs88 = r7shrs88 + sah88;

    if eah88 ge 0 then r7ehrs88 = r7ehrs88 + eah88;

  end;

 

  do k=1 to 10;

    if ah88=-3 then r7hrs88 = -3;

    if sah88=-3 then r7shrs88 = -3;

    if eah88=-3 then r7ehrs88 = -3;

  end;

 

  /* 1989 */

  * created no. of weeks worked on each job;

  array wks89 (k) r7w89_1-r7w89_10;

  * hours worked on each job;

  array ah89 (k) ah89_1-ah89_10;

  array sah89 (k) sah89_1-sah89_10;

  array eah89 (k) eah89_1-eah89_10;

 

  do k=1 to 10;

    ah89=0;

    sah89=0;

    eah89=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks89 ge 0 then ah89=hours*wks89;

    else if wks89=-3 or (hours in (-1,-2,-3) and wks89 ne 0) then ah89=-3;

    if self=1 then sah89=ah89;

    if self=0 then eah89=ah89;

  end;

 

  * total hours worked in the year;

  r7hrs89=0;

  r7shrs89=0;

  r7ehrs89=0;

 

  do k=1 to 10;

    if ah89 ge 0 then r7hrs89 = r7hrs89 + ah89;

    if sah89 ge 0 then r7shrs89 = r7shrs89 + sah89;

    if eah89 ge 0 then r7ehrs89 = r7ehrs89 + eah89;

  end;

 

  do k=1 to 10;

    if ah89=-3 then r7hrs89 = -3;

    if sah89=-3 then r7shrs89 = -3;

    if eah89=-3 then r7ehrs89 = -3;

  end;

 

  /* 1990 */

  * created no. of weeks worked on each job;

  array wks90 (k) r7w90_1-r7w90_10;

  * hours worked on each job;

  array ah90 (k) ah90_1-ah90_10;

  array sah90 (k) sah90_1-sah90_10;

  array eah90 (k) eah90_1-eah90_10;

 

  do k=1 to 10;

    ah90=0;

    sah90=0;

    eah90=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks90 ge 0 then ah90=hours*wks90;

    else if wks90=-3 or (hours in (-1,-2,-3) and wks90 ne 0) then ah90=-3;

    if self=1 then sah90=ah90;

    if self=0 then eah90=ah90;

  end;

 

  * total hours worked in the year;

  r7hrs90=0;

  r7shrs90=0;

  r7ehrs90=0;

 

  do k=1 to 10;

    if ah90 ge 0 then r7hrs90 = r7hrs90 + ah90;

    if sah90 ge 0 then r7shrs90 = r7shrs90 + sah90;

    if eah90 ge 0 then r7ehrs90 = r7ehrs90 + eah90;

  end;

 

  do k=1 to 10;

    if ah90=-3 then r7hrs90 = -3;

    if sah90=-3 then r7shrs90 = -3;

    if eah90=-3 then r7ehrs90 = -3;

  end;

 

  /* 1991 */

  * created no. of weeks worked on each job;

  array wks91 (k) r7w91_1-r7w91_10;

  * hours worked on each job;

  array ah91 (k) ah91_1-ah91_10;

  array sah91 (k) sah91_1-sah91_10;

  array eah91 (k) eah91_1-eah91_10;

 

  do k=1 to 10;

    ah91=0;

    sah91=0;

    eah91=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks91 ge 0 then ah91=hours*wks91;

    else if wks91=-3 or (hours in (-1,-2,-3) and wks91 ne 0) then ah91=-3;

    if self=1 then sah91=ah91;

    if self=0 then eah91=ah91;

  end;

 

  * total hours worked in the year;

  r7hrs91=0;

  r7shrs91=0;

  r7ehrs91=0;

 

  do k=1 to 10;

    if ah91 ge 0 then r7hrs91 = r7hrs91 + ah91;

    if sah91 ge 0 then r7shrs91 = r7shrs91 + sah91;

    if eah91 ge 0 then r7ehrs91 = r7ehrs91 + eah91;

  end;

 

  do k=1 to 10;

    if ah91=-3 then r7hrs91 = -3;

    if sah91=-3 then r7shrs91 = -3;

    if eah91=-3 then r7ehrs91 = -3;

  end;

 

  /* 1992 */

  * created no. of weeks worked on each job;

  array wks92 (k) r7w92_1-r7w92_10;

  * hours worked on each job;

  array ah92 (k) ah92_1-ah92_10;

  array sah92 (k) sah92_1-sah92_10;

  array eah92 (k) eah92_1-eah92_10;

 

  do k=1 to 10;

    ah92=0;

    sah92=0;

    eah92=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks92 ge 0 then ah92=hours*wks92;

    else if wks92=-3 or (hours in (-1,-2,-3) and wks92 ne 0) then ah92=-3;

    if self=1 then sah92=ah92;

    if self=0 then eah92=ah92;

  end;

 

  * total hours worked in the year;

  r7hrs92=0;

  r7shrs92=0;

  r7ehrs92=0;

 

  do k=1 to 10;

    if ah92 ge 0 then r7hrs92 = r7hrs92 + ah92;

    if sah92 ge 0 then r7shrs92 = r7shrs92 + sah92;

    if eah92 ge 0 then r7ehrs92 = r7ehrs92 + eah92;

  end;

 

  do k=1 to 10;

    if ah92=-3 then r7hrs92 = -3;

    if sah92=-3 then r7shrs92 = -3;

    if eah92=-3 then r7ehrs92 = -3;

  end;

 

  /* 1993 */

  * created no. of weeks worked on each job;

  array wks93 (k) r7w93_1-r7w93_10;

  * hours worked on each job;

  array ah93 (k) ah93_1-ah93_10;

  array sah93 (k) sah93_1-sah93_10;

  array eah93 (k) eah93_1-eah93_10;

 

  do k=1 to 10;

    ah93=0;

    sah93=0;

    eah93=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks93 ge 0 then ah93=hours*wks93;

    else if wks93=-3 or (hours in (-1,-2,-3) and wks93 ne 0) then ah93=-3;

    if self=1 then sah93=ah93;

    if self=0 then eah93=ah93;

  end;

 

  * total hours worked in the year;

  r7hrs93=0;

  r7shrs93=0;

  r7ehrs93=0;

 

  do k=1 to 10;

    if ah93 ge 0 then r7hrs93 = r7hrs93 + ah93;

    if sah93 ge 0 then r7shrs93 = r7shrs93 + sah93;

    if eah93 ge 0 then r7ehrs93 = r7ehrs93 + eah93;

  end;

 

  do k=1 to 10;

    if ah93=-3 then r7hrs93 = -3;

    if sah93=-3 then r7shrs93 = -3;

    if eah93=-3 then r7ehrs93 = -3;

  end;

 

  /* 1994 */

  * created no. of weeks worked on each job;

  array wks94 (k) r7w94_1-r7w94_10;

  * hours worked on each job;

  array ah94 (k) ah94_1-ah94_10;

  array sah94 (k) sah94_1-sah94_10;

  array eah94 (k) eah94_1-eah94_10;

 

  do k=1 to 10;

    ah94=0;

    sah94=0;

    eah94=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks94 ge 0 then ah94=hours*wks94;

    else if wks94=-3 or (hours in (-1,-2,-3) and wks94 ne 0) then ah94=-3;

    if self=1 then sah94=ah94;

    if self=0 then eah94=ah94;

  end;

 

  * total hours worked in the year;

  r7hrs94=0;

  r7shrs94=0;

  r7ehrs94=0;

 

  do k=1 to 10;

    if ah94 ge 0 then r7hrs94 = r7hrs94 + ah94;

    if sah94 ge 0 then r7shrs94 = r7shrs94 + sah94;

    if eah94 ge 0 then r7ehrs94 = r7ehrs94 + eah94;

  end;

 

  do k=1 to 10;

    if ah94=-3 then r7hrs94 = -3;

    if sah94=-3 then r7shrs94 = -3;

    if eah94=-3 then r7ehrs94 = -3;

  end;

 

  /* 1995 */

  * created no. of weeks worked on each job;

  array wks95 (k) r7w95_1-r7w95_10;

  * hours worked on each job;

  array ah95 (k) ah95_1-ah95_10;

  array sah95 (k) sah95_1-sah95_10;

  array eah95 (k) eah95_1-eah95_10;

 

  do k=1 to 10;

    ah95=0;

    sah95=0;

    eah95=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks95 ge 0 then ah95=hours*wks95;

    else if wks95=-3 or (hours in (-1,-2,-3) and wks95 ne 0) then ah95=-3;

    if self=1 then sah95=ah95;

    if self=0 then eah95=ah95;

  end;

 

  * total hours worked in the year;

  r7hrs95=0;

  r7shrs95=0;

  r7ehrs95=0;

 

  do k=1 to 10;

    if ah95 ge 0 then r7hrs95 = r7hrs95 + ah95;

    if sah95 ge 0 then r7shrs95 = r7shrs95 + sah95;

    if eah95 ge 0 then r7ehrs95 = r7ehrs95 + eah95;

  end;

 

  do k=1 to 10;

    if ah95=-3 then r7hrs95 = -3;

    if sah95=-3 then r7shrs95 = -3;

    if eah95=-3 then r7ehrs95 = -3;

  end;

 

  /* 1996 */

  * created no. of weeks worked on each job;

  array wks96 (k) r7w96_1-r7w96_10;

  * hours worked on each job;

  array ah96 (k) ah96_1-ah96_10;

  array sah96 (k) sah96_1-sah96_10;

  array eah96 (k) eah96_1-eah96_10;

 

  do k=1 to 10;

    ah96=0;

    sah96=0;

    eah96=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks96 ge 0 then ah96=hours*wks96;

    else if wks96=-3 or (hours in (-1,-2,-3) and wks96 ne 0) then ah96=-3;

    if self=1 then sah96=ah96;

    if self=0 then eah96=ah96;

  end;

 

  * total hours worked in the year;

  r7hrs96=0;

  r7shrs96=0;

  r7ehrs96=0;

 

  do k=1 to 10;

    if ah96 ge 0 then r7hrs96 = r7hrs96 + ah96;

    if sah96 ge 0 then r7shrs96 = r7shrs96 + sah96;

    if eah96 ge 0 then r7ehrs96 = r7ehrs96 + eah96;

  end;

 

  do k=1 to 10;

    if ah96=-3 then r7hrs96 = -3;

    if sah96=-3 then r7shrs96 = -3;

    if eah96=-3 then r7ehrs96 = -3;

  end;

 

  /* 1997 */

  * created no. of weeks worked on each job;

  array wks97 (k) r7w97_1-r7w97_10;

  * hours worked on each job;

  array ah97 (k) ah97_1-ah97_10;

  array sah97 (k) sah97_1-sah97_10;

  array eah97 (k) eah97_1-eah97_10;

 

  do k=1 to 10;

    ah97=0;

    sah97=0;

    eah97=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks97 ge 0 then ah97=hours*wks97;

    else if wks97=-3 or (hours in (-1,-2,-3) and wks97 ne 0) then ah97=-3;

    if self=1 then sah97=ah97;

    if self=0 then eah97=ah97;

  end;

 

  * total hours worked in the year;

  r7hrs97=0;

  r7shrs97=0;

  r7ehrs97=0;

 

  do k=1 to 10;

    if ah97 ge 0 then r7hrs97 = r7hrs97 + ah97;

    if sah97 ge 0 then r7shrs97 = r7shrs97 + sah97;

    if eah97 ge 0 then r7ehrs97 = r7ehrs97 + eah97;

  end;

 

  do k=1 to 10;

    if ah97=-3 then r7hrs97 = -3;

    if sah97=-3 then r7shrs97 = -3;

    if eah97=-3 then r7ehrs97 = -3;

  end;

 

  /* 1998 */

  * created no. of weeks worked on each job;

  array wks98 (k) r7w98_1-r7w98_10;

  * hours worked on each job;

  array ah98 (k) ah98_1-ah98_10;

  array sah98 (k) sah98_1-sah98_10;

  array eah98 (k) eah98_1-eah98_10;

 

  do k=1 to 10;

    ah98=0;

    sah98=0;

    eah98=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks98 ge 0 then ah98=hours*wks98;

    else if wks98=-3 or (hours in (-1,-2,-3) and wks98 ne 0) then ah98=-3;

    if self=1 then sah98=ah98;

    if self=0 then eah98=ah98;

  end;

 

  * total hours worked in the year;

  r7hrs98=0;

  r7shrs98=0;

  r7ehrs98=0;

 

  do k=1 to 10;

    if ah98 ge 0 then r7hrs98 = r7hrs98 + ah98;

    if sah98 ge 0 then r7shrs98 = r7shrs98 + sah98;

    if eah98 ge 0 then r7ehrs98 = r7ehrs98 + eah98;

  end;

 

  do k=1 to 10;

    if ah98=-3 then r7hrs98 = -3;

    if sah98=-3 then r7shrs98 = -3;

    if eah98=-3 then r7ehrs98 = -3;

  end;

 

  /* 1999 */

  * created no. of weeks worked on each job;

  array wks99 (k) r7w99_1-r7w99_10;

  * hours worked on each job;

  array ah99 (k) ah99_1-ah99_10;

  array sah99 (k) sah99_1-sah99_10;

  array eah99 (k) eah99_1-eah99_10;

 

  do k=1 to 10;

    ah99=0;

    sah99=0;

    eah99=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks99 ge 0 then ah99=hours*wks99;

    else if wks99=-3 or (hours in (-1,-2,-3) and wks99 ne 0) then ah99=-3;

    if self=1 then sah99=ah99;

    if self=0 then eah99=ah99;

  end;

 

  * total hours worked in the year;

  r7hrs99=0;

  r7shrs99=0;

  r7ehrs99=0;

 

  do k=1 to 10;

    if ah99 ge 0 then r7hrs99 = r7hrs99 + ah99;

    if sah99 ge 0 then r7shrs99 = r7shrs99 + sah99;

    if eah99 ge 0 then r7ehrs99 = r7ehrs99 + eah99;

  end;

 

  do k=1 to 10;

    if ah99=-3 then r7hrs99 = -3;

    if sah99=-3 then r7shrs99 = -3;

    if eah99=-3 then r7ehrs99 = -3;

  end;

 

  /* 2000 */

  * created no. of weeks worked on each job;

  array wks00 (k) r7w00_1-r7w00_10;

  * hours worked on each job;

  array ah00 (k) ah00_1-ah00_10;

  array sah00 (k) sah00_1-sah00_10;

  array eah00 (k) eah00_1-eah00_10;

 

  do k=1 to 10;

    ah00=0;

    sah00=0;

    eah00=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks00 ge 0 then ah00=hours*wks00;

    else if wks00=-3 or (hours in (-1,-2,-3) and wks00 ne 0) then ah00=-3;

    if self=1 then sah00=ah00;

    if self=0 then eah00=ah00;

  end;

 

  * total hours worked in the year;

  r7hrs00=0;

  r7shrs00=0;

  r7ehrs00=0;

 

  do k=1 to 10;

    if ah00 ge 0 then r7hrs00 = r7hrs00 + ah00;

    if sah00 ge 0 then r7shrs00 = r7shrs00 + sah00;

    if eah00 ge 0 then r7ehrs00 = r7ehrs00 + eah00;

  end;

 

  do k=1 to 10;

    if ah00=-3 then r7hrs00 = -3;

    if sah00=-3 then r7shrs00 = -3;

    if eah00=-3 then r7ehrs00 = -3;

  end;

 

  /* 2001 */

  * created no. of weeks worked on each job;

  array wks01 (k) r7w01_1-r7w01_10;

  * hours worked on each job;

  array ah01 (k) ah01_1-ah01_10;

  array sah01 (k) sah01_1-sah01_10;

  array eah01 (k) eah01_1-eah01_10;

 

  do k=1 to 10;

    ah01=0;

    sah01=0;

    eah01=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks01 ge 0 then ah01=hours*wks01;

    else if wks01=-3 or (hours in (-1,-2,-3) and wks01 ne 0) then ah01=-3;

    if self=1 then sah01=ah01;

    if self=0 then eah01=ah01;

  end;

 

  * total hours worked in the year;

  r7hrs01=0;

  r7shrs01=0;

  r7ehrs01=0;

 

  do k=1 to 10;

    if ah01 ge 0 then r7hrs01 = r7hrs01 + ah01;

    if sah01 ge 0 then r7shrs01 = r7shrs01 + sah01;

    if eah01 ge 0 then r7ehrs01 = r7ehrs01 + eah01;

  end;

 

  do k=1 to 10;

    if ah01=-3 then r7hrs01 = -3;

    if sah01=-3 then r7shrs01 = -3;

    if eah01=-3 then r7ehrs01 = -3;

  end;

 

  /* 2002 */

  * created no. of weeks worked on each job;

  array wks02 (k) r7w02_1-r7w02_10;

  * hours worked on each job;

  array ah02 (k) ah02_1-ah02_10;

  array sah02 (k) sah02_1-sah02_10;

  array eah02 (k) eah02_1-eah02_10;

 

  do k=1 to 10;

    ah02=0;

    sah02=0;

    eah02=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks02 ge 0 then ah02=hours*wks02;

    else if wks02=-3 or (hours in (-1,-2,-3) and wks02 ne 0) then ah02=-3;

    if self=1 then sah02=ah02;

    if self=0 then eah02=ah02;

  end;

 

  * total hours worked in the year;

  r7hrs02=0;

  r7shrs02=0;

  r7ehrs02=0;

 

  do k=1 to 10;

    if ah02 ge 0 then r7hrs02 = r7hrs02 + ah02;

    if sah02 ge 0 then r7shrs02 = r7shrs02 + sah02;

    if eah02 ge 0 then r7ehrs02 = r7ehrs02 + eah02;

  end;

 

  do k=1 to 10;

    if ah02=-3 then r7hrs02 = -3;

    if sah02=-3 then r7shrs02 = -3;

    if eah02=-3 then r7ehrs02 = -3;

  end;

 

  /* 2003 */

  * created no. of weeks worked on each job;

  array wks03 (k) r7w03_1-r7w03_10;

  * hours worked on each job;

  array ah03 (k) ah03_1-ah03_10;

  array sah03 (k) sah03_1-sah03_10;

  array eah03 (k) eah03_1-eah03_10;

 

  do k=1 to 10;

    ah03=0;

    sah03=0;

    eah03=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks03 ge 0 then ah03=hours*wks03;

    else if wks03=-3 or (hours in (-1,-2,-3) and wks03 ne 0) then ah03=-3;

    if self=1 then sah03=ah03;

    if self=0 then eah03=ah03;

  end;

 

  * total hours worked in the year;

  r7hrs03=0;

  r7shrs03=0;

  r7ehrs03=0;

 

  do k=1 to 10;

    if ah03 ge 0 then r7hrs03 = r7hrs03 + ah03;

    if sah03 ge 0 then r7shrs03 = r7shrs03 + sah03;

    if eah03 ge 0 then r7ehrs03 = r7ehrs03 + eah03;

  end;

 

  do k=1 to 10;

    if ah03=-3 then r7hrs03 = -3;

    if sah03=-3 then r7shrs03 = -3;

    if eah03=-3 then r7ehrs03 = -3;

  end;

 

  /* 2004 */

  * created no. of weeks worked on each job;

  array wks04 (k) r7w04_1-r7w04_10;

  * hours worked on each job;

  array ah04 (k) ah04_1-ah04_10;

  array sah04 (k) sah04_1-sah04_10;

  array eah04 (k) eah04_1-eah04_10;

 

  do k=1 to 10;

    ah04=0;

    sah04=0;

    eah04=0;

  end;

 

  do k=1 to 10;

    if hours ge 0 and wks04 ge 0 then ah04=hours*wks04;

    else if wks04=-3 or (hours in (-1,-2,-3) and wks04 ne 0) then ah04=-3;

    if self=1 then sah04=ah04;

    if self=0 then eah04=ah04;

  end;

 

  * total hours worked in the year;

  r7hrs04=0;

  r7shrs04=0;

  r7ehrs04=0;

 

  do k=1 to 10;

    if ah04 ge 0 then r7hrs04 = r7hrs04 + ah04;

    if sah04 ge 0 then r7shrs04 = r7shrs04 + sah04;

    if eah04 ge 0 then r7ehrs04 = r7ehrs04 + eah04;

  end;

 

  do k=1 to 10;

    if ah04=-3 then r7hrs04 = -3;

    if sah04=-3 then r7shrs04 = -3;

    if eah04=-3 then r7ehrs04 = -3;

  end;

 

  if r7int in (-5) then do;

     r7hrs80=-5; r7hrs81=-5; r7hrs82=-5; r7hrs83=-5; r7hrs84=-5; r7hrs85=-5;

     r7hrs86=-5; r7hrs87=-5; r7hrs88=-5; r7hrs89=-5; r7hrs90=-5; r7hrs91=-5;

     r7hrs92=-5; r7hrs93=-5; r7hrs94=-5; r7hrs95=-5; r7hrs96=-5; r7hrs97=-5;

     r7hrs98=-5; r7hrs99=-5; r7hrs00=-5; r7hrs01=-5; r7hrs02=-5; r7hrs03=-5;

     r7hrs04=-5;

     r7shrs80=-5; r7shrs81=-5; r7shrs82=-5; r7shrs83=-5; r7shrs84=-5; r7shrs85=-5;

     r7shrs86=-5; r7shrs87=-5; r7shrs88=-5; r7shrs89=-5; r7shrs90=-5; r7shrs91=-5;

     r7shrs92=-5; r7shrs93=-5; r7shrs94=-5; r7shrs95=-5; r7shrs96=-5; r7shrs97=-5;

     r7shrs98=-5; r7shrs99=-5; r7shrs00=-5; r7shrs01=-5; r7shrs02=-5; r7shrs03=-5;

     r7shrs04=-5;

     r7ehrs80=-5; r7ehrs81=-5; r7ehrs82=-5; r7ehrs83=-5; r7ehrs84=-5; r7ehrs85=-5;

     r7ehrs86=-5; r7ehrs87=-5; r7ehrs88=-5; r7ehrs89=-5; r7ehrs90=-5; r7ehrs91=-5;

     r7ehrs92=-5; r7ehrs93=-5; r7ehrs94=-5; r7ehrs95=-5; r7ehrs96=-5; r7ehrs97=-5;

     r7ehrs98=-5; r7ehrs99=-5; r7ehrs00=-5; r7ehrs01=-5; r7ehrs02=-5; r7ehrs03=-5;

     r7ehrs04=-5;

  end;

 

Return to top


 

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

  **  Number of weeks worked at employee-type job                   **

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

  **  Variables created: r7ewks14 r7wks14 r7ewks20 r7wks20.         **

  ********************************************************************;

 

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

  **  Number of weeks worked at employee-type job since AGE 14      **

  ********************************************************************;

 

 

  array job1wks  (i) w1_1-w1_1280;

  array job2wks  (i) w2_1-w2_1280;

  array job3wks  (i) w3_1-w3_1280;

  array job4wks  (i) w4_1-w4_1280;

  array job5wks  (i) w5_1-w5_1280;

  array job6wks  (i) w6_1-w6_1280;

  array job7wks  (i) w7_1-w7_1280;

  array job8wks  (i) w8_1-w8_1280;

  array job9wks  (i) w9_1-w9_1280;

  array job10wks (i) w10_1-w10_1280;

 

  array alljobs (i) wks1-wks1280;

  array empjobs (i) ewks1-ewks1280;

 

  do over alljobs;

     alljobs=0;

     empjobs=0;

  end;

 

 

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

  ** Overlay multiple jobs over JOB 1 work weeks       **

  *******************************************************;

 

  do over job1wks;

     alljobs=job1wks;

     if self01=0 then do;

        empjobs=job1wks;

     end;

  end;

 

  do over alljobs;

     if job2wks=1 then do;

        alljobs=job2wks;

     end;

     if job2wks=1 and self02=0 then do;

        empjobs=job2wks;

     end;

 

     if job2wks=-3 and alljobs=0 then do;

        alljobs=job2wks;

     end;

     if job2wks=-3 and empjobs=0 and self02=0 then do;

        empjobs=job2wks;

     end;

  end;

 

 

  do over alljobs;

     if job3wks=1 then do;

        alljobs=job3wks;

     end;

     if job3wks=1 and self03=0 then do;

        empjobs=job3wks;

     end;

 

     if job3wks=-3 and alljobs=0 then do;

        alljobs=job3wks;

     end;

     if job3wks=-3 and empjobs=0 and self03=0 then do;

        empjobs=job3wks;

     end;

  end;

 

  do over alljobs;

     if job4wks=1 then do;

        alljobs=job4wks;

     end;

     if job4wks=1 and self04=0 then do;

        empjobs=job4wks;

     end;

 

     if job4wks=-3 and alljobs=0 then do;

        alljobs=job4wks;

     end;

     if job4wks=-3 and empjobs=0 and self04=0 then do;

        empjobs=job4wks;

     end;

  end;

 

  do over alljobs;

     if job5wks=1 then do;

        alljobs=job5wks;

     end;

     if job5wks=1 and self05=0 then do;

        empjobs=job5wks;

     end;

 

     if job5wks=-3 and alljobs=0 then do;

        alljobs=job5wks;

     end;

     if job5wks=-3 and empjobs=0 and self05=0 then do;

        empjobs=job5wks;

     end;

  end;

 

  do over alljobs;

     if job6wks=1 then do;

        alljobs=job6wks;

     end;

     if job6wks=1 and self06=0 then do;

        empjobs=job6wks;

     end;

 

     if job6wks=-3 and alljobs=0 then do;

        alljobs=job6wks;

     end;

     if job6wks=-3 and empjobs=0 and self06=0 then do;

        empjobs=job6wks;

     end;

  end;

 

  do over alljobs;

     if job7wks=1 then do;

        alljobs=job7wks;

     end;

     if job7wks=1 and self07=0 then do;

        empjobs=job7wks;

     end;

 

     if job7wks=-3 and alljobs=0 then do;

        alljobs=job7wks;

     end;

     if job7wks=-3 and empjobs=0 and self07=0 then do;

        empjobs=job7wks;

     end;

  end;

 

  do over alljobs;

     if job8wks=1 then do;

        alljobs=job8wks;

     end;

     if job8wks=1 and self08=0 then do;

        empjobs=job8wks;

     end;

     if job8wks=-3 and alljobs=0 then do;

        alljobs=job8wks;

     end;

     if job8wks=-3 and empjobs=0 and self08=0 then do;

        empjobs=job8wks;

     end;

  end;

 

  do over alljobs;

     if job9wks=1 then do;

        alljobs=job9wks;

     end;

     if job9wks=1 and self09=0 then do;

        empjobs=job9wks;

     end;

     if job9wks=-3 and alljobs=0 then do;

        alljobs=job9wks;

     end;

     if job9wks=-3 and empjobs=0 and self09=0 then do;

        empjobs=job9wks;

     end;

  end;

 

  do over alljobs;

     if job10wks=1 then do;

        alljobs=job10wks;

     end;

     if job10wks=1 and self10=0 then do;

        empjobs=job10wks;

     end;

     if job10wks=-3 and alljobs=0 then do;

        alljobs=job10wks;

     end;

     if job10wks=-3 and empjobs=0 and self10=0 then do;

        empjobs=job10wks;

     end;

  end;

 

 

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

  ** Calculate cumulative weeks on all jobs since age 14 **

  *********************************************************;

 

  r7ewks14=0;

  r7wks14=0;

  r7ewks20=0;

  r7wks20=0;

 

  /* The min. of age14wk (age20wk) is 731 (1044). The max. of age14wk (age20wk) is 992 (1305).

  All values of age14wk (age20wk) are positive. */

 

 

  /* r7wks14 */

  if age14wk>0 and (age20wk-1)<=1280 then do;

     do i=age14wk to (age20wk-1);

        if alljobs=1 then do;

           r7wks14=r7wks14+1;

        end;

     end;

     do i=age14wk to (age20wk-1);

        if alljobs=-3 then do;

           r7wks14=-3;

        end;

     end;

  end;

 

  if age14wk>0 and (age20wk-1)>1280 then do;

     do i=age14wk to 1280;

        if alljobs=1 then do;

           r7wks14=r7wks14+1;

        end;

     end;

     do i=age14wk to 1280;

        if alljobs=-3 then do;

           r7wks14=-3;

        end;

     end;

  end;

 

 

  /* r7ewks14 */

  if age14wk>0 and (age20wk-1)<=1280 then do;

     do i=age14wk to (age20wk-1);

        if empjobs=1 then do;

           r7ewks14=r7ewks14+1;

        end;

     end;

     do i=age14wk to (age20wk-1);

        if empjobs=-3 then do;

           r7ewks14=-3;

        end;

     end;

  end;

 

  if age14wk>0 and (age20wk-1)>1280 then do;

     do i=age14wk to 1280;

        if empjobs=1 then do;

           r7ewks14=r7ewks14+1;

        end;

     end;

     do i=age14wk to 1280;

        if empjobs=-3 then do;

           r7ewks14=-3;

        end;

     end;

  end;

 

  /* r7wks20 */

  if age14wk>0 and age20wk<=1280 then do;

     do i=age20wk to 1280;

        if alljobs=1 then do;

           r7wks20=r7wks20+1;

        end;

     end;

     do i=age20wk to 1280;

        if alljobs=-3 then do;

           r7wks20=-3;

        end;

     end;

  end;

 

  /* r7ewks20 */

  if age14wk>0 and age20wk<=1280 then do;

     do i=age20wk to 1280;

        if empjobs=1 then do;

           r7ewks20=r7ewks20+1;

        end;

     end;

     do i=age20wk to 1280;

        if empjobs=-3 then do;

           r7ewks20=-3;

        end;

     end;

  end;

 

 

  *** Include valid skips;

 

  if r7int=-5 then do;

     r7wks14=-5;

     r7ewks14=-5;

     r7wks20=-5;

     r7ewks20=-5;

  end;

 

Return to top


 

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

  **  Cumulative hours worked since age 14/20 as of the interview date              **

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

  **  This program creates a variable aggregated across jobs relating the total     **

  **  number of hours worked since turning age 14 & 20. A variable is created for   **

  **  each respondent even if the respondent has never worked with the default      **

  **  value set to zero (0).                            **

  **                                                                                **

  **  Variables created: r7hrs14 r7ehrs14 r7hrs20 r7ehrs20                          **

  **                                                                                **

  **  r6hrs14 (r6ehrs14) is the number of hours (employee-type job hours) worked    **

  **                     between age 14 and 20.                                     **

  **  r6hrs20 (r6ehrs20) is the number of hours (employee-type job hours) worked    **

  **                     since age 20.

  ************************************************************************************;

 

 

  *** Organize hours for each job;

 

  array rghrsb (k) rghrsb01-rghrsb10;

  array rghrs (k) rghrs01-rghrs10;

  array othrs (k) othrs01-othrs10;

  array hours (k) hours01-hours10;

 

  array e23901 (k) e2390101-e2390110;

  array e24501 (k) e2450101-e2450110;

  array e34402 (k) e3440201-e3440210;

  array e34403 (k) e3440301-e3440310;

  array e34428 (k) e3442801-e3442810;

  array e37904 (k) e3790401-e3790410;

  array e38000b (k) e38000b01-e38000b10;

  array e38000f (k) e38000f01-e38000f10;

  array e38002 (k) e3800201-e3800210;

  array e38102 (k) e3810201-e3810210;

  array e38103 (k) e3810301-e3810310;

  array e38105 (k) e3810501-e3810510;

  array e59901 (k) e5990101-e5990110;

  array e88000 (k) e8800001-e8800010;

  array e88501 (k) e8850101-e8850110;

  array e98402 (k) e9840201-e9842010;

  array e98403 (k) e9840301-e9840310;

  array e98429 (k) e9842901-e9842910;

  array e1002252 (k) e100225012 e100225022 e100225032 e100225042 e100225052 e100225062 e100225072 e100225082 e100225092

                     e100225102;

  array e100231 (k) e10023101-e10023110;

  array e1002253 (k) e100225013 e100225023 e100225033 e100225043 e100225053 e100225063 e100225073 e100225083 e100225093

                     e100225103;

  array e100232 (k) e10023201-e10023210;

  array e226042 (k) e22604012 e22604022 e22604032 e22604042 e22604052 e22604062 e22604072 e22604082 e22604092

                    e22604102;

  array e22610 (k) e2261001-e2261010;

  array e226043 (k) e22604013 e22604023 e22604033 e22604043 e22604053 e22604063 e22604073 e22604083 e22604093

                     e22604103;

  array e22611 (k) e2261101-e2261110;

  array starfl (k) starfl_1-starfl_10;

  array stopfl (k) stopfl_1-stopfl_10;

 

  ***** Initialize the number of hours per week to 0;

 

  do k=1 to 10;

     rghrsb =0;

     rghrs=0;

     othrs=0;

     hours=0;

  end;

 

  ***** Regular rghrs Per Week;

 

  do k=1 to 10;

   if e23901 not in (.,-4,-5) then rghrsb=e23901;

   if e34402 not in (.,-4,-5) then rghrsb=e34402;

   if e34428 not in (.,-4,-5) then rghrsb=e34428;

 

   if e22610 not in (.,-4,-5) then rghrsb=e22610;

   else if e226042 lt 0 and e226042 not in (.,-4,-5) then rghrsb=-3;

 

   if e88000 not in (.,-4,-5) then rghrsb=e88000;

   if e98402 not in (.,-4,-5) then rghrsb=e98402;

   if e98429 not in (.,-4,-5) then rghrsb=e98429;

 

   if e100231 not in (.,-4,-5) then rghrsb=e100231;

   else if e1002252 lt 0 and e1002252 not in (.,-4,-5) then rghrsb=-3;

 

   if e38000f not in (.,-4,-5) then rghrsb=e38000f;

 

   if e38002 in (.,-4,0) then rghrs=rghrsb;

   else if e38002 lt 0 and e38002 ne -5 then rghrs=-3;

   else if e38002 gt 0 then do;

    if rghrsb gt 0 then rghrs=rghrsb-e38002;

    else rghrs=-3;

   end;

 

   if e38000b lt 0 and e38000b not in (-4,-5,.) then rghrs=-3;

 

   if e38102 in (1,3) and e38103 not in (.,-4,-5) then rghrs=e38103;

   if e38102 lt 0 and e38102 not in (-4,-5, .) then rghrs=-3;

   if e37904 > -4 then rghrs=e37904;

   if e59901 > -4 then rghrs=e59901;

  end;

 

  ***** Overtime Hours Per Week;

 

  do k=1 to 10;

   if e24501 not in (.,-4,-5) then othrs=e24501;

   if e34403 not in (.,-4,-5) then othrs=e34403;

   if e22611 not in (.,-4,-5) then othrs=e22611;

   else if e226043 lt 0 and e226043 not in (.,-4,-5) then othrs=-3;

   if e88501 not in (.,-4,-5) then othrs=e88501;

   if e98403 not in (.,-4,-5) then othrs=e98403;

   if e100232 not in (.,-4,-5) then othrs=e100232;

   else if e1002253 lt 0 and e1002253 not in (.,-4,-5) then othrs=-3;

   if e38002 not in (.,-4,-5) then othrs=e38002;

   if e38105 not in (.,-4,-5) then othrs=e38105;

   else if e38102 lt 0 and e38102 not in (.,-4,-5) then othrs=-3;

  end;

 

  ***** Total Hours Per Week;

 

  do k=1 to 10;

    if rghrs in (-1,-2,-3) or othrs in (-1,-2,-3) then hours=-3;

    else if rghrs ge 0 and othrs ge 0 then hours=rghrs + othrs;

  end;

 

 

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

  **     Calculate cumulative weeks on each job since age 14/20     **

  ********************************************************************;

 

  array job1wks  (i) w1_1-w1_1280;

  array job2wks  (i) w2_1-w2_1280;

  array job3wks  (i) w3_1-w3_1280;

  array job4wks  (i) w4_1-w4_1280;

  array job5wks  (i) w5_1-w5_1280;

  array job6wks  (i) w6_1-w6_1280;

  array job7wks  (i) w7_1-w7_1280;

  array job8wks  (i) w8_1-w8_1280;

  array job9wks  (i) w9_1-w9_1280;

  array job10wks (i) w10_1-w10_1280;

 

 

 

  /* Initialize created variables */

  r7hrs14=0;

  r7ehrs14=0;

  r7hrs20=0;

  r7ehrs20=0;

 

  /* Read "wks1405" as the number of weeks worked between the ages of 14 and 19, for job  5 only.

     Read "hrs1405" as the number of hours worked between the ages of 14 and 19, for job  5 only.

     Read "ehrs1405" as the number of employee-type job hours worked between the ages of  14 and 19, for job 5 only.

     Read "wks2005" as the number of weeks worked since age 20, for job 5 only.

     Read "hrs2005" as the number of hours worked since age 20, for job 5 only.

     Read "ehrs2005" as the number of employee-type job hours worked since age 20, for job 5 only. */

 

 

  array self (k) self01-self10;

  array wks14 (k) wks1401-wks1410;

  array hrs14 (k) hrs1401-hrs1410;

  array ehrs14 (k) ehrs1401-ehrs1410;

  array wks20 (k) wks2001-wks2010;

  array hrs20 (k) hrs2001-hrs2010;

  array ehrs20 (k) ehrs2001-ehrs2010;

 

  do k=1 to 10;

    wks14=0;

    hrs14=0;

    ehrs14=0;

    wks20=0;

    hrs20=0;

    ehrs20=0;

  end;

 

  *********************** the created variable for "since age 14";

 

  /* The ending week number for the count of "age14-age19" depending on whether respondents turn to age 20 or not. */

  end14wk=min(age20wk-1, 1280);

 

  /* The number of weeks worked on each job since age 14 */

 

   do i=age14wk to end14wk;

     if job1wks=1 then do;

        wks1401=wks1401+1;

     end;

     if job2wks=1 then do;

        wks1402=wks1402+1;

     end;

     if job3wks=1 then do;

        wks1403=wks1403+1;

     end;

     if job4wks=1 then do;

        wks1404=wks1404+1;

     end;

     if job5wks=1 then do;

        wks1405=wks1405+1;

     end;

     if job6wks=1 then do;

        wks1406=wks1406+1;

     end;

     if job7wks=1 then do;

        wks1407=wks1407+1;

     end;

     if job8wks=1 then do;

        wks1408=wks1408+1;

     end;

     if job9wks=1 then do;

        wks1409=wks1409+1;

     end;

     if job10wks=1 then do;

        wks1410=wks1410+1;

     end;

   end;

 

   do i=age14wk to end14wk;

     if job1wks=-3 then do;

        wks1401=-3;

     end;

     if job2wks=-3 then do;

        wks1402=-3;

     end;

     if job3wks=-3 then do;

        wks1403=-3;

     end;

     if job4wks=-3 then do;

        wks1404=-3;

     end;

     if job5wks=-3 then do;

        wks1405=-3;

     end;

     if job6wks=-3 then do;

        wks1406=-3;

     end;

     if job7wks=-3 then do;

        wks1407=-3;

     end;

     if job8wks=-3 then do;

        wks1408=-3;

     end;

     if job9wks=-3 then do;

        wks1409=-3;

     end;

     if job10wks=-3 then do;

        wks1410=-3;

     end;

 

   end;

 

  * The number of hours worked on each job since age 14;

 

  do k=1 to 10;

    if hours ge 0 and wks14 ge 0 then hrs14=hours*wks14;

    else if wks14=-3 or (hours in (-1,-2,-3) and wks14 ne 0) then hrs14=-3;

    if self=0 then ehrs14=hrs14;

  end;

 

  * The total number of hours worked since age 14;

 

  do k=1 to 10;

    if hrs14 ge 0 then r7hrs14 = r7hrs14 + hrs14;

    if ehrs14 ge 0 then r7ehrs14 = r7ehrs14 + ehrs14;

  end;

 

  do k=1 to 10;

    if hrs14=-3 then r7hrs14=-3;

    if ehrs14=-3 then r7ehrs14=-3;

  end;

 

 

  ***************** The created variable for "since age 20";

 

  if age14wk>0 and age20wk<=1280 then do;

 

  * The number of weeks worked since age 20 for the respondents who have turned 20 by Round 7;

 

   do i=age20wk to 1280;

     if job1wks=1 then do;

        wks2001=wks2001+1;

     end;

     if job2wks=1 then do;

        wks2002=wks2002+1;

     end;

     if job3wks=1 then do;

        wks2003=wks2003+1;

     end;

     if job4wks=1 then do;

        wks2004=wks2004+1;

     end;

     if job5wks=1 then do;

        wks2005=wks2005+1;

     end;

     if job6wks=1 then do;

        wks2006=wks2006+1;

     end;

     if job7wks=1 then do;

        wks2007=wks2007+1;

     end;

     if job8wks=1 then do;

        wks2008=wks2008+1;

     end;

     if job9wks=1 then do;

        wks2009=wks2009+1;

     end;

     if job10wks=1 then do;

        wks2010=wks2010+1;

     end;

   end;

 

   do i=age20wk to 1280;

     if job1wks=-3 then do;

        wks2001=-3;

     end;

     if job2wks=-3 then do;

        wks2002=-3;

     end;

     if job3wks=-3 then do;

        wks2003=-3;

     end;

     if job4wks=-3 then do;

        wks2004=-3;

     end;

     if job5wks=-3 then do;

        wks2005=-3;

     end;

     if job6wks=-3 then do;

        wks2006=-3;

     end;

     if job7wks=-3 then do;

        wks2007=-3;

     end;

     if job8wks=-3 then do;

        wks2008=-3;

     end;

     if job9wks=-3 then do;

        wks2009=-3;

     end;

     if job10wks=-3 then do;

        wks2010=-3;

     end;

   end;

   end;

 

  * The number of hours worked since age 20 for the respondents who have turned 20 by Round 6;

 

  do k=1 to 10;

    if hours ge 0 and wks20 ge 0 then hrs20=hours*wks20;

    else if wks20=-3 or (hours in (-1,-2,-3) and wks20 ne 0) then hrs20=-3;

    if self=0 then ehrs20=hrs20;

  end;

 

  * The total number of hours worked since age 20;

 

  do k=1 to 10;

    if hrs20 ge 0 then r7hrs20 = r7hrs20 + hrs20;

    if ehrs20 ge 0 then r7ehrs20 = r7ehrs20 + ehrs20;

  end;

 

  do k=1 to 10;

    if hrs20=-3 then r7hrs20=-3;

    if ehrs20=-3 then r7ehrs20=-3;

  end;

 

 

  if r7int=-5 then do;

     r7hrs14=-5;

     r7ehrs14=-5;

     r7hrs20=-5;

     r7ehrs20=-5;

  end;

 

Return to top


 

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

  **  Number of jobs held during 19##                                 **

  **  (conditional on having worked at least 1 week during that year) **

  **                                                                  **

  **  Created Variables: r7job80-r7job99 r7job00-r7job04              **

  **                     r7self80-r7self99 r7self00-r7self04          **

  **                     r7emp80-r7emp99 r7emp00-r7emp04              **

  **                                                                  **

  **  e.g. r7job93 (r7self93, r7emp93) is the number of jobs          **

  **  (self-employed jobs, employee-type jobs) worked in year 1993.   **

  **                                                                  **

  **********************************************************************;

 

 

 

  array job1wks  (i) w1_1-w1_1280;

  array job2wks  (i) w2_1-w2_1280;

  array job3wks  (i) w3_1-w3_1280;

  array job4wks  (i) w4_1-w4_1280;

  array job5wks  (i) w5_1-w5_1280;

  array job6wks  (i) w6_1-w6_1280;

  array job7wks  (i) w7_1-w7_1280;

  array job8wks  (i) w8_1-w8_1280;

  array job9wks  (i) w9_1-w9_1280;

  array job10wks (i) w10_1-w10_1280;

 

 

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

  ** Indicate if worked at least one week on a job in a given year **

  *******************************************************************;

 

  /* 1980 */

 

  r7j801=0;   r7s801=0;   r7e801=0;

  r7j802=0;       r7s802=0;       r7e802=0;

  r7j803=0;       r7s803=0;       r7e803=0;

  r7j804=0;       r7s804=0;       r7e804=0;

  r7j805=0;       r7s805=0;       r7e805=0;

  r7j806=0;       r7s806=0;       r7e806=0;

  r7j807=0;       r7s807=0;       r7e807=0;

  r7j808=0;       r7s808=0;       r7e808=0;

  r7j809=0;       r7s809=0;       r7e809=0;

  r7j8010=0;      r7s8010=0;      r7e8010=0;

 

 

  do i=1 to 52;

     if job1wks=-3 then do;

        r7j801=-3;

     end;

     if job1wks=-3 and self01=1 then do;

        r7s801=-3;

     end;

     if job1wks=-3 and self01=0 then do;

        r7e801=-3;

     end;

     if job2wks=-3 then do;

        r7j802=-3;

     end;

     if job2wks=-3 and self02=1 then do;

        r7s802=-3;

     end;

     if job2wks=-3 and self02=0 then do;

        r7e802=-3;

     end;

     if job3wks=-3 then do;

        r7j803=-3;

     end;

     if job3wks=-3 and self03=1 then do;

        r7s803=-3;

     end;

     if job3wks=-3 and self03=0 then do;

        r7e803=-3;

     end;

     if job4wks=-3 then do;

        r7j804=-3;

     end;

     if job4wks=-3 and self04=1 then do;

        r7s804=-3;

     end;

     if job4wks=-3 and self04=0 then do;

        r7e804=-3;

     end;

     if job5wks=-3 then do;

        r7j805=-3;

     end;

     if job5wks=-3 and self05=1 then do;

        r7s805=-3;

     end;

     if job5wks=-3 and self05=0 then do;

        r7e805=-3;

     end;

     if job6wks=-3 then do;

        r7j806=-3;

     end;

     if job6wks=-3 and self06=1 then do;

        r7s806=-3;

     end;

     if job6wks=-3 and self06=0 then do;

        r7e806=-3;

     end;

     if job7wks=-3 then do;

        r7j807=-3;

     end;

     if job7wks=-3 and self07=1 then do;

        r7s807=-3;

     end;

     if job7wks=-3 and self07=0 then do;

        r7e807=-3;

     end;

     if job8wks=-3 then do;

        r7j808=-3;

     end;

     if job8wks=-3 and self08=1 then do;

        r7s808=-3;

     end;

     if job8wks=-3 and self08=0 then do;

        r7e808=-3;

     end;

     if job9wks=-3 then do;

        r7j809=-3;

     end;

     if job9wks=-3 and self09=1 then do;

        r7s809=-3;

     end;

     if job9wks=-3 and self09=0 then do;

        r7e809=-3;

     end;

     if job10wks=-3 then do;

        r7j8010=-3;

     end;

     if job10wks=-3 and self10=1 then do;

        r7s8010=-3;

     end;

     if job10wks=-3 and self10=0 then do;

        r7e8010=-3;

     end;

 

  end;

 

  do i=1 to 52;

     if job1wks=1 then do;

        r7j801=1;

     end;

     if job1wks=1 and self01=1 then do;

        r7s801=1;

     end;

     if job1wks=1 and self01=0 then do;

        r7e801=1;

     end;

     if job2wks=1 then do;

        r7j802=1;

     end;

     if job2wks=1 and self02=1 then do;

        r7s802=1;

     end;

     if job2wks=1 and self02=0 then do;

        r7e802=1;

     end;

     if job3wks=1 then do;

        r7j803=1;

     end;

     if job3wks=1 and self03=1 then do;

        r7s803=1;

     end;

     if job3wks=1 and self03=0 then do;

        r7e803=1;

     end;

     if job4wks=1 then do;

        r7j804=1;

     end;

     if job4wks=1 and self04=1 then do;

        r7s804=1;

     end;

     if job4wks=1 and self04=0 then do;

        r7e804=1;

     end;

     if job5wks=1 then do;

        r7j805=1;

     end;

     if job5wks=1 and self05=1 then do;

        r7s805=1;

     end;

     if job5wks=1 and self05=0 then do;

        r7e805=1;

     end;

     if job6wks=1 then do;

        r7j806=1;

     end;

     if job6wks=1 and self06=1 then do;

        r7s806=1;

     end;

     if job6wks=1 and self06=0 then do;

        r7e806=1;

     end;

     if job7wks=1 then do;

        r7j807=1;

     end;

     if job7wks=1 and self07=1 then do;

        r7s807=1;

     end;

     if job7wks=1 and self07=0 then do;

        r7e807=1;

     end;

     if job8wks=1 then do;

        r7j808=1;

     end;

     if job8wks=1 and self08=1 then do;

        r7s808=1;

     end;

     if job8wks=1 and self08=0 then do;

        r7e808=1;

     end;

     if job9wks=1 then do;

        r7j809=1;

     end;

     if job9wks=1 and self09=1 then do;

        r7s809=1;

     end;

     if job9wks=1 and self09=0 then do;

        r7e809=1;

     end;

     if job10wks=1 then do;

        r7j8010=1;

     end;

     if job10wks=1 and self10=1 then do;

        r7s8010=1;

     end;

     if job10wks=1 and self10=0 then do;

        r7e8010=1;

     end;

 

  end;

 

  if r7j801 ne -3 and r7j802 ne -3 and r7j803 ne -3 and r7j804 ne -3 and r7j805 ne -3 and r7j806 ne -3 and r7j807 ne -3

     and r7j808 ne -3 and r7j809 ne -3 and r7j8010 ne -3 then do;

     r7job80=sum(r7j801,r7j802,r7j803,r7j804,r7j805,r7j806,r7j807,r7j808,r7j809,r7j8010) ;

  end;

  if r7j801=-3 or r7j802=-3 or r7j803=-3 or r7j804=-3 or r7j805=-3 or r7j806=-3 or r7j807=-3 or r7j808=-3

     or r7j809=-3 or r7j8010=-3 then do;

     r7job80=-3;

  end;

 

  if r7s801 ne -3 and r7s802 ne -3 and r7s803 ne -3 and r7s804 ne -3 and r7s805 ne -3 and r7s806 ne -3 and r7s807 ne -3

     and r7s808 ne -3 and r7s809 ne -3 and r7s8010 ne -3 then do;

     r7self80=sum(r7s801,r7s802,r7s803,r7s804,r7s805,r7s806,r7s807,r7s808,r7s809,r7s8010 );

  end;

  if r7s801=-3 or r7s802=-3 or r7s803=-3 or r7s804=-3 or r7s805=-3 or r7s806=-3 or r7s807=-3 or r7s808=-3

     or r7s809=-3 or r7s8010=-3 then do;

     r7self80=-3;

  end;

 

  if r7e801 ne -3 and r7e802 ne -3 and r7e803 ne -3 and r7e804 ne -3 and r7e805 ne -3 and r7e806 ne -3 and r7e807 ne -3

     and r7e808 ne -3 and r7e809 ne -3 and r7e8010 ne -3 then do;

     r7emp80=sum(r7e801,r7e802,r7e803,r7e804,r7e805,r7e806,r7e807,r7e808,r7e809,r7e8010) ;

  end;

  if r7e801=-3 or r7e802=-3 or r7e803=-3 or r7e804=-3 or r7e805=-3 or r7e806=-3 or r7e807=-3 or r7e808=-3

     or r7e809=-3 or r7e8010=-3 then do;

     r7emp80=-3;

  end;

 

  /* 1981 */

 

  r7j811=0;   r7s811=0;   r7e811=0;

  r7j812=0;       r7s812=0;       r7e812=0;

  r7j813=0;       r7s813=0;       r7e813=0;

  r7j814=0;       r7s814=0;       r7e814=0;

  r7j815=0;       r7s815=0;       r7e815=0;

  r7j816=0;       r7s816=0;       r7e816=0;

  r7j817=0;       r7s817=0;       r7e817=0;

  r7j818=0;       r7s818=0;       r7e818=0;

  r7j819=0;       r7s819=0;       r7e819=0;

  r7j8110=0;      r7s8110=0;      r7e8110=0;

 

 

  do i=53 to 104;

     if job1wks=-3 then do;

        r7j811=-3;

     end;

     if job1wks=-3 and self01=1 then do;

        r7s811=-3;

     end;

     if job1wks=-3 and self01=0 then do;

        r7e811=-3;

     end;

     if job2wks=-3 then do;

        r7j812=-3;

     end;

     if job2wks=-3 and self02=1 then do;

        r7s812=-3;

     end;

     if job2wks=-3 and self02=0 then do;

        r7e812=-3;

     end;

     if job3wks=-3 then do;

        r7j813=-3;

     end;

     if job3wks=-3 and self03=1 then do;

        r7s813=-3;

     end;

     if job3wks=-3 and self03=0 then do;

        r7e813=-3;

     end;

     if job4wks=-3 then do;

        r7j814=-3;

     end;

     if job4wks=-3 and self04=1 then do;

        r7s814=-3;

     end;

     if job4wks=-3 and self04=0 then do;

        r7e814=-3;

     end;

     if job5wks=-3 then do;

        r7j815=-3;

     end;

     if job5wks=-3 and self05=1 then do;

        r7s815=-3;

     end;

     if job5wks=-3 and self05=0 then do;

        r7e815=-3;

     end;

     if job6wks=-3 then do;

        r7j816=-3;

     end;

     if job6wks=-3 and self06=1 then do;

        r7s816=-3;

     end;

     if job6wks=-3 and self06=0 then do;

        r7e816=-3;

     end;

     if job7wks=-3 then do;

        r7j817=-3;

     end;

     if job7wks=-3 and self07=1 then do;

        r7s817=-3;

     end;

     if job7wks=-3 and self07=0 then do;

        r7e817=-3;

     end;

     if job8wks=-3 then do;

        r7j818=-3;

     end;

     if job8wks=-3 and self08=1 then do;

        r7s818=-3;

     end;

     if job8wks=-3 and self08=0 then do;

        r7e818=-3;

     end;

     if job9wks=-3 then do;

        r7j819=-3;

     end;

     if job9wks=-3 and self09=1 then do;

        r7s819=-3;

     end;

     if job9wks=-3 and self09=0 then do;

        r7e819=-3;

     end;

     if job10wks=-3 then do;

        r7j8110=-3;

     end;

     if job10wks=-3 and self10=1 then do;

        r7s8110=-3;

     end;

     if job10wks=-3 and self10=0 then do;

        r7e8110=-3;

     end;

 

  end;

 

  do i=53 to 104;

     if job1wks=1 then do;

        r7j811=1;

     end;

     if job1wks=1 and self01=1 then do;

        r7s811=1;

     end;

     if job1wks=1 and self01=0 then do;

        r7e811=1;

     end;

     if job2wks=1 then do;

        r7j812=1;

     end;

     if job2wks=1 and self02=1 then do;

        r7s812=1;

     end;

     if job2wks=1 and self02=0 then do;

        r7e812=1;

     end;

     if job3wks=1 then do;

        r7j813=1;

     end;

     if job3wks=1 and self03=1 then do;

        r7s813=1;

     end;

     if job3wks=1 and self03=0 then do;

        r7e813=1;

     end;

     if job4wks=1 then do;

        r7j814=1;

     end;

     if job4wks=1 and self04=1 then do;

        r7s814=1;

     end;

     if job4wks=1 and self04=0 then do;

        r7e814=1;

     end;

     if job5wks=1 then do;

        r7j815=1;

     end;

     if job5wks=1 and self05=1 then do;

        r7s815=1;

     end;

     if job5wks=1 and self05=0 then do;

        r7e815=1;

     end;

     if job6wks=1 then do;

        r7j816=1;

     end;

     if job6wks=1 and self06=1 then do;

        r7s816=1;

     end;

     if job6wks=1 and self06=0 then do;

        r7e816=1;

     end;

     if job7wks=1 then do;

        r7j817=1;

     end;

     if job7wks=1 and self07=1 then do;

        r7s817=1;

     end;

     if job7wks=1 and self07=0 then do;

        r7e817=1;

     end;

     if job8wks=1 then do;

        r7j818=1;

     end;

     if job8wks=1 and self08=1 then do;

        r7s818=1;

     end;

     if job8wks=1 and self08=0 then do;

        r7e818=1;

     end;

     if job9wks=1 then do;

        r7j819=1;

     end;

     if job9wks=1 and self09=1 then do;

        r7s819=1;

     end;

     if job9wks=1 and self09=0 then do;

        r7e819=1;

     end;

     if job10wks=1 then do;

        r7j8110=1;

     end;

     if job10wks=1 and self10=1 then do;

        r7s8110=1;

     end;

     if job10wks=1 and self10=0 then do;

        r7e8110=1;

     end;

 

  end;

 

  if r7j811 ne -3 and r7j812 ne -3 and r7j813 ne -3 and r7j814 ne -3 and r7j815 ne -3 and r7j816 ne -3 and r7j817 ne -3

     and r7j818 ne -3 and r7j819 ne -3 and r7j8110 ne -3 then do;

     r7job81=sum(r7j811,r7j812,r7j813,r7j814,r7j815,r7j816,r7j817,r7j818,r7j819,r7j8110) ;

  end;

  if r7j811=-3 or r7j812=-3 or r7j813=-3 or r7j814=-3 or r7j815=-3 or r7j816=-3 or r7j817=-3 or r7j818=-3

     or r7j819=-3 or r7j8110=-3 then do;

     r7job81=-3;

  end;

 

  if r7s811 ne -3 and r7s812 ne -3 and r7s813 ne -3 and r7s814 ne -3 and r7s815 ne -3 and r7s816 ne -3 and r7s817 ne -3

     and r7s818 ne -3 and r7s819 ne -3 and r7s8110 ne -3 then do;

     r7self81=sum(r7s811,r7s812,r7s813,r7s814,r7s815,r7s816,r7s817,r7s818,r7s819,r7s8110 );

  end;

  if r7s811=-3 or r7s812=-3 or r7s813=-3 or r7s814=-3 or r7s815=-3 or r7s816=-3 or r7s817=-3 or r7s818=-3

     or r7s819=-3 or r7s8110=-3 then do;

     r7self81=-3;

  end;

 

  if r7e811 ne -3 and r7e812 ne -3 and r7e813 ne -3 and r7e814 ne -3 and r7e815 ne -3 and r7e816 ne -3 and r7e817 ne -3

     and r7e818 ne -3 and r7e819 ne -3 and r7e8110 ne -3 then do;

     r7emp81=sum(r7e811,r7e812,r7e813,r7e814,r7e815,r7e816,r7e817,r7e818,r7e819,r7e8110) ;

  end;

  if r7e811=-3 or r7e812=-3 or r7e813=-3 or r7e814=-3 or r7e815=-3 or r7e816=-3 or r7e817=-3 or r7e818=-3

     or r7e819=-3 or r7e8110=-3 then do;

     r7emp81=-3;

  end;

 

  /* 1982 */

 

  r7j821=0;   r7s821=0;   r7e821=0;

  r7j822=0;       r7s822=0;       r7e822=0;

  r7j823=0;       r7s823=0;       r7e823=0;

  r7j824=0;       r7s824=0;       r7e824=0;

  r7j825=0;       r7s825=0;       r7e825=0;

  r7j826=0;       r7s826=0;       r7e826=0;

  r7j827=0;       r7s827=0;       r7e827=0;

  r7j828=0;       r7s828=0;       r7e828=0;

  r7j829=0;       r7s829=0;       r7e829=0;

  r7j8210=0;      r7s8210=0;      r7e8210=0;

 

 

  do i=105 to 156;

     if job1wks=-3 then do;

        r7j821=-3;

     end;

     if job1wks=-3 and self01=1 then do;

        r7s821=-3;

     end;

     if job1wks=-3 and self01=0 then do;

        r7e821=-3;

     end;

     if job2wks=-3 then do;

        r7j822=-3;

     end;

     if job2wks=-3 and self02=1 then do;

        r7s822=-3;

     end;

     if job2wks=-3 and self02=0 then do;

        r7e822=-3;

     end;

     if job3wks=-3 then do;

        r7j823=-3;

     end;

     if job3wks=-3 and self03=1 then do;

        r7s823=-3;

     end;

     if job3wks=-3 and self03=0 then do;

        r7e823=-3;

     end;

     if job4wks=-3 then do;

        r7j824=-3;

     end;

     if job4wks=-3 and self04=1 then do;

        r7s824=-3;

     end;

     if job4wks=-3 and self04=0 then do;

        r7e824=-3;

     end;

     if job5wks=-3 then do;

        r7j825=-3;

     end;

     if job5wks=-3 and self05=1 then do;

        r7s825=-3;

     end;

     if job5wks=-3 and self05=0 then do;

        r7e825=-3;

     end;

     if job6wks=-3 then do;

        r7j826=-3;

     end;

     if job6wks=-3 and self06=1 then do;

        r7s826=-3;

     end;

     if job6wks=-3 and self06=0 then do;

        r7e826=-3;

     end;

     if job7wks=-3 then do;

        r7j827=-3;

     end;

     if job7wks=-3 and self07=1 then do;

        r7s827=-3;

     end;

     if job7wks=-3 and self07=0 then do;

        r7e827=-3;

     end;

     if job8wks=-3 then do;

        r7j828=-3;

     end;

     if job8wks=-3 and self08=1 then do;

        r7s828=-3;

     end;

     if job8wks=-3 and self08=0 then do;

        r7e828=-3;

     end;

     if job9wks=-3 then do;

        r7j829=-3;

     end;

     if job9wks=-3 and self09=1 then do;

        r7s829=-3;

     end;

     if job9wks=-3 and self09=0 then do;

        r7e829=-3;

     end;

     if job10wks=-3 then do;

        r7j8210=-3;

     end;

     if job10wks=-3 and self10=1 then do;

        r7s8210=-3;

     end;

     if job10wks=-3 and self10=0 then do;

        r7e8210=-3;

     end;

 

  end;

 

  do i=105 to 156;

     if job1wks=1 then do;

        r7j821=1;

     end;

     if job1wks=1 and self01=1 then do;

        r7s821=1;

     end;

     if job1wks=1 and self01=0 then do;

        r7e821=1;

     end;

     if job2wks=1 then do;

        r7j822=1;

     end;

     if job2wks=1 and self02=1 then do;

        r7s822=1;

     end;

     if job2wks=1 and self02=0 then do;

        r7e822=1;

     end;

     if job3wks=1 then do;

        r7j823=1;

     end;

     if job3wks=1 and self03=1 then do;

        r7s823=1;

     end;

     if job3wks=1 and self03=0 then do;

        r7e823=1;

     end;

     if job4wks=1 then do;

        r7j824=1;

     end;

     if job4wks=1 and self04=1 then do;

        r7s824=1;

     end;

     if job4wks=1 and self04=0 then do;

        r7e824=1;

     end;

     if job5wks=1 then do;

        r7j825=1;

     end;

     if job5wks=1 and self05=1 then do;

        r7s825=1;

     end;

     if job5wks=1 and self05=0 then do;

        r7e825=1;

     end;

     if job6wks=1 then do;

        r7j826=1;

     end;

     if job6wks=1 and self06=1 then do;

        r7s826=1;

     end;

     if job6wks=1 and self06=0 then do;

        r7e826=1;

     end;

     if job7wks=1 then do;

        r7j827=1;

     end;

     if job7wks=1 and self07=1 then do;

        r7s827=1;

     end;

     if job7wks=1 and self07=0 then do;

        r7e827=1;

     end;

     if job8wks=1 then do;

        r7j828=1;

     end;

     if job8wks=1 and self08=1 then do;

        r7s828=1;

     end;

     if job8wks=1 and self08=0 then do;

        r7e828=1;

     end;

     if job9wks=1 then do;

        r7j829=1;

     end;

     if job9wks=1 and self09=1 then do;

        r7s829=1;

     end;

     if job9wks=1 and self09=0 then do;

        r7e829=1;

     end;

     if job10wks=1 then do;

        r7j8210=1;

     end;

     if job10wks=1 and self10=1 then do;

        r7s8210=1;

     end;

     if job10wks=1 and self10=0 then do;

        r7e8210=1;

     end;

 

  end;

 

  if r7j821 ne -3 and r7j822 ne -3 and r7j823 ne -3 and r7j824 ne -3 and r7j825 ne -3 and r7j826 ne -3 and r7j827 ne -3

     and r7j828 ne -3 and r7j829 ne -3 and r7j8210 ne -3 then do;

     r7job82=sum(r7j821,r7j822,r7j823,r7j824,r7j825,r7j826,r7j827,r7j828,r7j829,r7j8210) ;

  end;

  if r7j821=-3 or r7j822=-3 or r7j823=-3 or r7j824=-3 or r7j825=-3 or r7j826=-3 or r7j827=-3 or r7j828=-3

     or r7j829=-3 or r7j8210=-3 then do;

     r7job82=-3;

  end;

 

  if r7s821 ne -3 and r7s822 ne -3 and r7s823 ne -3 and r7s824 ne -3 and r7s825 ne -3 and r7s826 ne -3 and r7s827 ne -3

     and r7s828 ne -3 and r7s829 ne -3 and r7s8210 ne -3 then do;

     r7self82=sum(r7s821,r7s822,r7s823,r7s824,r7s825,r7s826,r7s827,r7s828,r7s829,r7s8210 );

  end;

  if r7s821=-3 or r7s822=-3 or r7s823=-3 or r7s824=-3 or r7s825=-3 or r7s826=-3 or r7s827=-3 or r7s828=-3

     or r7s829=-3 or r7s8210=-3 then do;

     r7self82=-3;

  end;

 

  if r7e821 ne -3 and r7e822 ne -3 and r7e823 ne -3 and r7e824 ne -3 and r7e825 ne -3 and r7e826 ne -3 and r7e827 ne -3

     and r7e828 ne -3 and r7e829 ne -3 and r7e8210 ne -3 then do;

     r7emp82=sum(r7e821,r7e822,r7e823,r7e824,r7e825,r7e826,r7e827,r7e828,r7e829,r7e8210) ;

  end;

  if r7e821=-3 or r7e822=-3 or r7e823=-3 or r7e824=-3 or r7e825=-3 or r7e826=-3 or r7e827=-3 or r7e828=-3

     or r7e829=-3 or r7e8210=-3 then do;

     r7emp82=-3;

  end;

 

  /* 1983 */

 

  r7j831=0;   r7s831=0;   r7e831=0;

  r7j832=0;       r7s832=0;       r7e832=0;

  r7j833=0;       r7s833=0;       r7e833=0;

  r7j834=0;       r7s834=0;       r7e834=0;

  r7j835=0;       r7s835=0;       r7e835=0;

  r7j836=0;       r7s836=0;       r7e836=0;

  r7j837=0;       r7s837=0;       r7e837=0;

  r7j838=0;       r7s838=0;       r7e838=0;

  r7j839=0;       r7s839=0;       r7e839=0;

  r7j8310=0;      r7s8310=0;      r7e8310=0;

 

 

  do i=157 to 209;

     if job1wks=-3 then do;

        r7j831=-3;

     end;

     if job1wks=-3 and self01=1 then do;

        r7s831=-3;

     end;

     if job1wks=-3 and self01=0 then do;

        r7e831=-3;

     end;

     if job2wks=-3 then do;

        r7j832=-3;

     end;

     if job2wks=-3 and self02=1 then do;

        r7s832=-3;

     end;

     if job2wks=-3 and self02=0 then do;

        r7e832=-3;

     end;

     if job3wks=-3 then do;

        r7j833=-3;

     end;

     if job3wks=-3 and self03=1 then do;

        r7s833=-3;

     end;

     if job3wks=-3 and self03=0 then do;

        r7e833=-3;

     end;

     if job4wks=-3 then do;

        r7j834=-3;

     end;

     if job4wks=-3 and self04=1 then do;

        r7s834=-3;

     end;

     if job4wks=-3 and self04=0 then do;

        r7e834=-3;

     end;

     if job5wks=-3 then do;

        r7j835=-3;

     end;

     if job5wks=-3 and self05=1 then do;

        r7s835=-3;

     end;

     if job5wks=-3 and self05=0 then do;

        r7e835=-3;

     end;

     if job6wks=-3 then do;

        r7j836=-3;

     end;

     if job6wks=-3 and self06=1 then do;

        r7s836=-3;

     end;

     if job6wks=-3 and self06=0 then do;

        r7e836=-3;

     end;

     if job7wks=-3 then do;

        r7j837=-3;

     end;

     if job7wks=-3 and self07=1 then do;

        r7s837=-3;

     end;

     if job7wks=-3 and self07=0 then do;

        r7e837=-3;

     end;

     if job8wks=-3 then do;

        r7j838=-3;

     end;

     if job8wks=-3 and self08=1 then do;

        r7s838=-3;

     end;

     if job8wks=-3 and self08=0 then do;

        r7e838=-3;

     end;

     if job9wks=-3 then do;

        r7j839=-3;

     end;

     if job9wks=-3 and self09=1 then do;

        r7s839=-3;

     end;

     if job9wks=-3 and self09=0 then do;

        r7e839=-3;

     end;

     if job10wks=-3 then do;

        r7j8310=-3;

     end;

     if job10wks=-3 and self10=1 then do;

        r7s8310=-3;

     end;

     if job10wks=-3 and self10=0 then do;

        r7e8310=-3;

     end;

 

  end;

 

  do i=157 to 209;

     if job1wks=1 then do;

        r7j831=1;

     end;

     if job1wks=1 and self01=1 then do;

        r7s831=1;

     end;

     if job1wks=1 and self01=0 then do;

        r7e831=1;

     end;

     if job2wks=1 then do;

        r7j832=1;

     end;

     if job2wks=1 and self02=1 then do;

        r7s832=1;

     end;

     if job2wks=1 and self02=0 then do;

        r7e832=1;

     end;

     if job3wks=1 then do;

        r7j833=1;

     end;

     if job3wks=1 and self03=1 then do;

        r7s833=1;

     end;

     if job3wks=1 and self03=0 then do;

        r7e833=1;

     end;

     if job4wks=1 then do;

        r7j834=1;

     end;

     if job4wks=1 and self04=1 then do;

        r7s834=1;

     end;

     if job4wks=1 and self04=0 then do;

        r7e834=1;

     end;

     if job5wks=1 then do;

        r7j835=1;

     end;

     if job5wks=1 and self05=1 then do;

        r7s835=1;

     end;

     if job5wks=1 and self05=0 then do;

        r7e835=1;

     end;

     if job6wks=1 then do;

        r7j836=1;

     end;

     if job6wks=1 and self06=1 then do;

        r7s836=1;

     end;

     if job6wks=1 and self06=0 then do;

        r7e836=1;

     end;

     if job7wks=1 then do;

        r7j837=1;

     end;

     if job7wks=1 and self07=1 then do;

        r7s837=1;

     end;

     if job7wks=1 and self07=0 then do;

        r7e837=1;

     end;

     if job8wks=1 then do;

        r7j838=1;

     end;

     if job8wks=1 and self08=1 then do;

        r7s838=1;

     end;

     if job8wks=1 and self08=0 then do;

        r7e838=1;

     end;

     if job9wks=1 then do;

        r7j839=1;

     end;

     if job9wks=1 and self09=1 then do;

        r7s839=1;

     end;

     if job9wks=1 and self09=0 then do;

        r7e839=1;

     end;

     if job10wks=1 then do;

        r7j8310=1;

     end;

     if job10wks=1 and self10=1 then do;

        r7s8310=1;

     end;

     if job10wks=1 and self10=0 then do;

        r7e8310=1;

     end;

 

  end;

 

  if r7j831 ne -3 and r7j832 ne -3 and r7j833 ne -3 and r7j834 ne -3 and r7j835 ne -3 and r7j836 ne -3 and r7j837 ne -3

     and r7j838 ne -3 and r7j839 ne -3 and r7j8310 ne -3 then do;

     r7job83=sum(r7j831,r7j832,r7j833,r7j834,r7j835,r7j836,r7j837,r7j838,r7j839,r7j8310) ;

  end;

  if r7j831=-3 or r7j832=-3 or r7j833=-3 or r7j834=-3 or r7j835=-3 or r7j836=-3 or r7j837=-3 or r7j838=-3

     or r7j839=-3 or r7j8310=-3 then do;

     r7job83=-3;

  end;

 

  if r7s831 ne -3 and r7s832 ne -3 and r7s833 ne -3 and r7s834 ne -3 and r7s835 ne -3 and r7s836 ne -3 and r7s837 ne -3

     and r7s838 ne -3 and r7s839 ne -3 and r7s8310 ne -3 then do;

     r7self83=sum(r7s831,r7s832,r7s833,r7s834,r7s835,r7s836,r7s837,r7s838,r7s839,r7s8310 );

  end;

  if r7s831=-3 or r7s832=-3 or r7s833=-3 or r7s834=-3 or r7s835=-3 or r7s836=-3 or r7s837=-3 or r7s838=-3

     or r7s839=-3 or r7s8310=-3 then do;

     r7self83=-3;

  end;

 

  if r7e831 ne -3 and r7e832 ne -3 and r7e833 ne -3 and r7e834 ne -3 and r7e835 ne -3 and r7e836 ne -3 and r7e837 ne -3

     and r7e838 ne -3 and r7e839 ne -3 and r7e8310 ne -3 then do;

     r7emp83=sum(r7e831,r7e832,r7e833,r7e834,r7e835,r7e836,r7e837,r7e838,r7e839,r7e8310) ;

  end;

  if r7e831=-3 or r7e832=-3 or r7e833=-3 or r7e834=-3 or r7e835=-3 or r7e836=-3 or r7e837=-3 or r7e838=-3

     or r7e839=-3 or r7e8310=-3 then do;

     r7emp83=-3;

  end;

 

  /* 1984 */

 

  r7j841=0;   r7s841=0;   r7e841=0;

  r7j842=0;       r7s842=0;       r7e842=0;

  r7j843=0;       r7s843=0;       r7e843=0;

  r7j844=0;       r7s844=0;       r7e844=0;

  r7j845=0;       r7s845=0;       r7e845=0;

  r7j846=0;       r7s846=0;       r7e846=0;

  r7j847=0;       r7s847=0;       r7e847=0;

  r7j848=0;       r7s848=0;       r7e848=0;

  r7j849=0;       r7s849=0;       r7e849=0;

  r7j8410=0;      r7s8410=0;      r7e8410=0;

 

 

  do i=210 to 261;

     if job1wks=-3 then do;

        r7j841=-3;

     end;

     if job1wks=-3 and self01=1 then do;

        r7s841=-3;

     end;

     if job1wks=-3 and self01=0 then do;

        r7e841=-3;

     end;

     if job2wks=-3 then do;

        r7j842=-3;

     end;

     if job2wks=-3 and self02=1 then do;

        r7s842=-3;

     end;

     if job2wks=-3 and self02=0 then do;

        r7e842=-3;

     end;

     if job3wks=-3 then do;

        r7j843=-3;

     end;

     if job3wks=-3 and self03=1 then do;

        r7s843=-3;

     end;

     if job3wks=-3 and self03=0 then do;

        r7e843=-3;

     end;

     if job4wks=-3 then do;

        r7j844=-3;

     end;

     if job4wks=-3 and self04=1 then do;

        r7s844=-3;

     end;

     if job4wks=-3 and self04=0 then do;

        r7e844=-3;

     end;

     if job5wks=-3 then do;

        r7j845=-3;

     end;

     if job5wks=-3 and self05=1 then do;

        r7s845=-3;

     end;

     if job5wks=-3 and self05=0 then do;

        r7e845=-3;

     end;

     if job6wks=-3 then do;

        r7j846=-3;

     end;

     if job6wks=-3 and self06=1 then do;

        r7s846=-3;

     end;

     if job6wks=-3 and self06=0 then do;

        r7e846=-3;

     end;

     if job7wks=-3 then do;

        r7j847=-3;

     end;

     if job7wks=-3 and self07=1 then do;

        r7s847=-3;

     end;

     if job7wks=-3 and self07=0 then do;

        r7e847=-3;

     end;

     if job8wks=-3 then do;

        r7j848=-3;

     end;

     if job8wks=-3 and self08=1 then do;

        r7s848=-3;

     end;

     if job8wks=-3 and self08=0 then do;

        r7e848=-3;

     end;

     if job9wks=-3 then do;

        r7j849=-3;

     end;

     if job9wks=-3 and self09=1 then do;

        r7s849=-3;

     end;

     if job9wks=-3 and self09=0 then do;

        r7e849=-3;

     end;

     if job10wks=-3 then do;

        r7j8410=-3;

     end;

     if job10wks=-3 and self10=1 then do;

        r7s8410=-3;

     end;

     if job10wks=-3 and self10=0 then do;

        r7e8410=-3;

     end;

 

  end;

 

  do i=210 to 261;

     if job1wks=1 then do;

        r7j841=1;

     end;

     if job1wks=1 and self01=1 then do;

        r7s841=1;

     end;

     if job1wks=1 and self01=0 then do;

        r7e841=1;

     end;

     if job2wks=1 then do;

        r7j842=1;

     end;

     if job2wks=1 and self02=1 then do;

        r7s842=1;

     end;

     if job2wks=1 and self02=0 then do;

        r7e842=1;

     end;

     if job3wks=1 then do;

        r7j843=1;

     end;

     if job3wks=1 and self03=1 then do;

        r7s843=1;

     end;

     if job3wks=1 and self03=0 then do;

        r7e843=1;

     end;

     if job4wks=1 then do;

        r7j844=1;

     end;

     if job4wks=1 and self04=1 then do;

        r7s844=1;

     end;

     if job4wks=1 and self04=0 then do;

        r7e844=1;

     end;

     if job5wks=1 then do;

        r7j845=1;

     end;

     if job5wks=1 and self05=1 then do;

        r7s845=1;

     end;

     if job5wks=1 and self05=0 then do;

        r7e845=1;

     end;

     if job6wks=1 then do;

        r7j846=1;

     end;

     if job6wks=1 and self06=1 then do;

        r7s846=1;

     end;

     if job6wks=1 and self06=0 then do;

        r7e846=1;

     end;

     if job7wks=1 then do;

        r7j847=1;

     end;

     if job7wks=1 and self07=1 then do;

        r7s847=1;

     end;

     if job7wks=1 and self07=0 then do;

        r7e847=1;

     end;

     if job8wks=1 then do;

        r7j848=1;

     end;

     if job8wks=1 and self08=1 then do;

        r7s848=1;

     end;

     if job8wks=1 and self08=0 then do;

        r7e848=1;

     end;

     if job9wks=1 then do;

        r7j849=1;

     end;

     if job9wks=1 and self09=1 then do;

        r7s849=1;

     end;

     if job9wks=1 and self09=0 then do;

        r7e849=1;

     end;

     if job10wks=1 then do;

        r7j8410=1;

     end;

     if job10wks=1 and self10=1 then do;

        r7s8410=1;

     end;

     if job10wks=1 and self10=0 then do;

        r7e8410=1;

     end;

 

  end;

 

  if r7j841 ne -3 and r7j842 ne -3 and r7j843 ne -3 and r7j844 ne -3 and r7j845 ne -3 and r7j846 ne -3 and r7j847 ne -3

     and r7j848 ne -3 and r7j849 ne -3 and r7j8410 ne -3 then do;

     r7job84=sum(r7j841,r7j842,r7j843,r7j844,r7j845,r7j846,r7j847,r7j848,r7j849,r7j8410) ;

  end;

  if r7j841=-3 or r7j842=-3 or r7j843=-3 or r7j844=-3 or r7j845=-3 or r7j846=-3 or r7j847=-3 or r7j848=-3

     or r7j849=-3 or r7j8410=-3 then do;

     r7job84=-3;

  end;

 

  if r7s841 ne -3 and r7s842 ne -3 and r7s843 ne -3 and r7s844 ne -3 and r7s845 ne -3 and r7s846 ne -3 and r7s847 ne -3

     and r7s848 ne -3 and r7s849 ne -3 and r7s8410 ne -3 then do;

     r7self84=sum(r7s841,r7s842,r7s843,r7s844,r7s845,r7s846,r7s847,r7s848,r7s849,r7s8410 );

  end;

  if r7s841=-3 or r7s842=-3 or r7s843=-3 or r7s844=-3 or r7s845=-3 or r7s846=-3 or r7s847=-3 or r7s848=-3

     or r7s849=-3 or r7s8410=-3 then do;

     r7self84=-3;

  end;

 

  if r7e841 ne -3 and r7e842 ne -3 and r7e843 ne -3 and r7e844 ne -3 and r7e845 ne -3 and r7e846 ne -3 and r7e847 ne -3

     and r7e848 ne -3 and r7e849 ne -3 and r7e8410 ne -3 then do;

     r7emp84=sum(r7e841,r7e842,r7e843,r7e844,r7e845,r7e846,r7e847,r7e848,r7e849,r7e8410) ;

  end;

  if r7e841=-3 or r7e842=-3 or r7e843=-3 or r7e844=-3 or r7e845=-3 or r7e846=-3 or r7e847=-3 or r7e848=-3

     or r7e849=-3 or r7e8410=-3 then do;

     r7emp84=-3;

  end;

 

  /* 1985 */

 

  r7j851=0;   r7s851=0;   r7e851=0;

  r7j852=0;       r7s852=0;       r7e852=0;

  r7j853=0;       r7s853=0;       r7e853=0;

  r7j854=0;       r7s854=0;       r7e854=0;

  r7j855=0;       r7s855=0;       r7e855=0;

  r7j856=0;       r7s856=0;       r7e856=0;

  r7j857=0;       r7s857=0;       r7e857=0;

  r7j858=0;       r7s858=0;       r7e858=0;

  r7j859=0;       r7s859=0;       r7e859=0;

  r7j8510=0;      r7s8510=0;      r7e8510=0;

 

 

  do i=262 to 313;

     if job1wks=-3 then do;

        r7j851=-3;

     end;

     if job1wks=-3 and self01=1 then do;

        r7s851=-3;

     end;

     if job1wks=-3 and self01=0 then do;

        r7e851=-3;

     end;

     if job2wks=-3 then do;

        r7j852=-3;

     end;

     if job2wks=-3 and self02=1 then do;

        r7s852=-3;

     end;

     if job2wks=-3 and self02=0 then do;

        r7e852=-3;

     end;

     if job3wks=-3 then do;

        r7j853=-3;

     end;

     if job3wks=-3 and self03=1 then do;

        r7s853=-3;

     end;

     if job3wks=-3 and self03=0 then do;

        r7e853=-3;

     end;

     if job4wks=-3 then do;

        r7j854=-3;

     end;

     if job4wks=-3 and self04=1 then do;

        r7s854=-3;

     end;

     if job4wks=-3 and self04=0 then do;

        r7e854=-3;

     end;

     if job5wks=-3 then do;

        r7j855=-3;

     end;

     if job5wks=-3 and self05=1 then do;

        r7s855=-3;

     end;

     if job5wks=-3 and self05=0 then do;

        r7e855=-3;

     end;

     if job6wks=-3 then do;

        r7j856=-3;

     end;

     if job6wks=-3 and self06=1 then do;

        r7s856=-3;

     end;

     if job6wks=-3 and self06=0 then do;

        r7e856=-3;

     end;

     if job7wks=-3 then do;

        r7j857=-3;

     end;

     if job7wks=-3 and self07=1 then do;

        r7s857=-3;

     end;

     if job7wks=-3 and self07=0 then do;

        r7e857=-3;

     end;

     if job8wks=-3 then do;

        r7j858=-3;

     end;

     if job8wks=-3 and self08=1 then do;

        r7s858=-3;

     end;

     if job8wks=-3 and self08=0 then do;

        r7e858=-3;

     end;

     if job9wks=-3 then do;

        r7j859=-3;

     end;

     if job9wks=-3 and self09=1 then do;

        r7s859=-3;

     end;

     if job9wks=-3 and self09=0 then do;

        r7e859=-3;

     end;

     if job10wks=-3 then do;

        r7j8510=-3;

     end;

     if job10wks=-3 and self10=1 then do;

        r7s8510=-3;

     end;

     if job10wks=-3 and self10=0 then do;

        r7e8510=-3;

     end;

 

  end;

 

  do i=262 to 313;

     if job1wks=1 then do;

        r7j851=1;

     end;

     if job1wks=1 and self01=1 then do;

        r7s851=1;

     end;

     if job1wks=1 and self01=0 then do;

        r7e851=1;

     end;

     if job2wks=1 then do;

        r7j852=1;

     end;

     if job2wks=1 and self02=1 then do;

        r7s852=1;

     end;

     if job2wks=1 and self02=0 then do;

        r7e852=1;

     end;

     if job3wks=1 then do;

        r7j853=1;

     end;

     if job3wks=1 and self03=1 then do;

        r7s853=1;

     end;

     if job3wks=1 and self03=0 then do;

        r7e853=1;

     end;

     if job4wks=1 then do;

        r7j854=1;

     end;

     if job4wks=1 and self04=1 then do;

        r7s854=1;

     end;

     if job4wks=1 and self04=0 then do;

        r7e854=1;

     end;

     if job5wks=1 then do;

        r7j855=1;

     end;

     if job5wks=1 and self05=1 then do;

        r7s855=1;

     end;

     if job5wks=1 and self05=0 then do;

        r7e855=1;

     end;

     if job6wks=1 then do;

        r7j856=1;

     end;

     if job6wks=1 and self06=1 then do;

        r7s856=1;

     end;

     if job6wks=1 and self06=0 then do;

        r7e856=1;

     end;

     if job7wks=1 then do;

        r7j857=1;

     end;

     if job7wks=1 and self07=1 then do;

        r7s857=1;

     end;

     if job7wks=1 and self07=0 then do;

        r7e857=1;

     end;

     if job8wks=1 then do;

        r7j858=1;

     end;

     if job8wks=1 and self08=1 then do;

        r7s858=1;

     end;

     if job8wks=1 and self08=0 then do;

        r7e858=1;

     end;

     if job9wks=1 then do;

        r7j859=1;

     end;

     if job9wks=1 and self09=1 then do;

        r7s859=1;

     end;

     if job9wks=1 and self09=0 then do;

        r7e859=1;

     end;

     if job10wks=1 then do;

        r7j8510=1;

     end;

     if job10wks=1 and self10=1 then do;

        r7s8510=1;

     end;

     if job10wks=1 and self10=0 then do;

        r7e8510=1;

     end;

 

  end;

 

  if r7j851 ne -3 and r7j852 ne -3 and r7j853 ne -3 and r7j854 ne -3 and r7j855 ne -3 and r7j856 ne -3 and r7j857 ne -3

     and r7j858 ne -3 and r7j859 ne -3 and r7j8510 ne -3 then do;

     r7job85=sum(r7j851,r7j852,r7j853,r7j854,r7j855,r7j856,r7j857,r7j858,r7j859,r7j8510) ;

  end;

  if r7j851=-3 or r7j852=-3 or r7j853=-3 or r7j854=-3 or r7j855=-3 or r7j856=-3 or r7j857=-3 or r7j858=-3

     or r7j859=-3 or r7j8510=-3 then do;

     r7job85=-3;

  end;

 

  if r7s851 ne -3 and r7s852 ne -3 and r7s853 ne -3 and r7s854 ne -3 and r7s855 ne -3 and r7s856 ne -3 and r7s857 ne -3

     and r7s858 ne -3 and r7s859 ne -3 and r7s8510 ne -3 then do;

     r7self85=sum(r7s851,r7s852,r7s853,r7s854,r7s855,r7s856,r7s857,r7s858,r7s859,r7s8510 );

  end;

  if r7s851=-3 or r7s852=-3 or r7s853=-3 or r7s854=-3 or r7s855=-3 or r7s856=-3 or r7s857=-3 or r7s858=-3

     or r7s859=-3 or r7s8510=-3 then do;

     r7self85=-3;

  end;

 

  if r7e851 ne -3 and r7e852 ne -3 and r7e853 ne -3 and r7e854 ne -3 and r7e855 ne -3 and r7e856 ne -3 and r7e857 ne -3

     and r7e858 ne -3 and r7e859 ne -3 and r7e8510 ne -3 then do;

     r7emp85=sum(r7e851,r7e852,r7e853,r7e854,r7e855,r7e856,r7e857,r7e858,r7e859,r7e8510) ;

  end;

  if r7e851=-3 or r7e852=-3 or r7e853=-3 or r7e854=-3 or r7e855=-3 or r7e856=-3 or r7e857=-3 or r7e858=-3

     or r7e859=-3 or r7e8510=-3 then do;

     r7emp85=-3;

  end;

 

  /* 1986 */

 

  r7j861=0;   r7s861=0;   r7e861=0;

  r7j862=0;       r7s862=0;       r7e862=0;

  r7j863=0;       r7s863=0;       r7e863=0;

  r7j864=0;       r7s864=0;       r7e864=0;

  r7j865=0;       r7s865=0;       r7e865=0;

  r7j866=0;       r7s866=0;       r7e866=0;

  r7j867=0;       r7s867=0;       r7e867=0;

  r7j868=0;       r7s868=0;       r7e868=0;

  r7j869=0;       r7s869=0;       r7e869=0;

  r7j8610=0;      r7s8610=0;      r7e8610=0;

 

 

  do i=314 to 365;

     if job1wks=-3 then do;

        r7j861=-3;

     end;

     if job1wks=-3 and self01=1 then do;

        r7s861=-3;

     end;

     if job1wks=-3 and self01=0 then do;

        r7e861=-3;

     end;

     if job2wks=-3 then do;

        r7j862=-3;

     end;

     if job2wks=-3 and self02=1 then do;

        r7s862=-3;

     end;

     if job2wks=-3 and self02=0 then do;

        r7e862=-3;

     end;

     if job3wks=-3 then do;

        r7j863=-3;

     end;

     if job3wks=-3 and self03=1 then do;

        r7s863=-3;

     end;

     if job3wks=-3 and self03=0 then do;

        r7e863=-3;

     end;

     if job4wks=-3 then do;

        r7j864=-3;

     end;

     if job4wks=-3 and self04=1 then do;

        r7s864=-3;

     end;

     if job4wks=-3 and self04=0 then do;

        r7e864=-3;

     end;

     if job5wks=-3 then do;

        r7j865=-3;

     end;

     if job5wks=-3 and self05=1 then do;

        r7s865=-3;

     end;

     if job5wks=-3 and self05=0 then do;

        r7e865=-3;

     end;

     if job6wks=-3 then do;

        r7j866=-3;

     end;

     if job6wks=-3 and self06=1 then do;

        r7s866=-3;

     end;

     if job6wks=-3 and self06=0 then do;

        r7e866=-3;

     end;

     if job7wks=-3 then do;

        r7j867=-3;

     end;

     if job7wks=-3 and self07=1 then do;

        r7s867=-3;

     end;

     if job7wks=-3 and self07=0 then do;

        r7e867=-3;

     end;

     if job8wks=-3 then do;

        r7j868=-3;

     end;

     if job8wks=-3 and self08=1 then do;

        r7s868=-3;

     end;

     if job8wks=-3 and self08=0 then do;

        r7e868=-3;

     end;

     if job9wks=-3 then do;

        r7j869=-3;

     end;

     if job9wks=-3 and self09=1 then do;

        r7s869=-3;

     end;

     if job9wks=-3 and self09=0 then do;

        r7e869=-3;

     end;

     if job10wks=-3 then do;

        r7j8610=-3;

     end;

     if job10wks=-3 and self10=1 then do;

        r7s8610=-3;

     end;

     if job10wks=-3 and self10=0 then do;

        r7e8610=-3;

     end;

 

  end;

 

  do i=314 to 365;

     if job1wks=1 then do;

        r7j861=1;

     end;

     if job1wks=1 and self01=1 then do;

        r7s861=1;

     end;

     if job1wks=1 and self01=0 then do;

        r7e861=1;

     end;

     if job2wks=1 then do;

        r7j862=1;

     end;

     if job2wks=1 and self02=1 then do;

        r7s862=1;

     end;

     if job2wks=1 and self02=0 then do;

        r7e862=1;

     end;

     if job3wks=1 then do;

        r7j863=1;

     end;

     if job3wks=1 and self03=1 then do;

        r7s863=1;

     end;

     if job3wks=1 and self03=0 then do;

        r7e863=1;

     end;

     if job4wks=1 then do;

        r7j864=1;

     end;

     if job4wks=1 and self04=1 then do;

        r7s864=1;

     end;

     if job4wks=1 and self04=0 then do;

        r7e864=1;

     end;

     if job5wks=1 then do;

        r7j865=1;

     end;

     if job5wks=1 and self05=1 then do;

        r7s865=1;

     end;

     if job5wks=1 and self05=0 then do;

        r7e865=1;

     end;

     if job6wks=1 then do;

        r7j866=1;

     end;

     if job6wks=1 and self06=1 then do;

        r7s866=1;

     end;

     if job6wks=1 and self06=0 then do;

        r7e866=1;

     end;

     if job7wks=1 then do;

        r7j867=1;

     end;

     if job7wks=1 and self07=1 then do;

        r7s867=1;

     end;

     if job7wks=1 and self07=0 then do;

        r7e867=1;

     end;

     if job8wks=1 then do;

        r7j868=1;

     end;

     if job8wks=1 and self08=1 then do;

        r7s868=1;

     end;

     if job8wks=1 and self08=0 then do;

        r7e868=1;

     end;

     if job9wks=1 then do;

        r7j869=1;

     end;

     if job9wks=1 and self09=1 then do;

        r7s869=1;

     end;

     if job9wks=1 and self09=0 then do;

        r7e869=1;

     end;

     if job10wks=1 then do;

        r7j8610=1;

     end;

     if job10wks=1 and self10=1 then do;

        r7s8610=1;

     end;

     if job10wks=1 and self10=0 then do;

        r7e8610=1;

     end;

 

  end;

 

  if r7j861 ne -3 and r7j862 ne -3 and r7j863 ne -3 and r7j864 ne -3 and r7j865 ne -3 and r7j866 ne -3 and r7j867 ne -3

     and r7j868 ne -3 and r7j869 ne -3 and r7j8610 ne -3 then do;

     r7job86=sum(r7j861,r7j862,r7j863,r7j864,r7j865,r7j866,r7j867,r7j868,r7j869,r7j8610) ;

  end;

  if r7j861=-3 or r7j862=-3 or r7j863=-3 or r7j864=-3 or r7j865=-3 or r7j866=-3 or r7j867=-3 or r7j868=-3

     or r7j869=-3 or r7j8610=-3 then do;

     r7job86=-3;

  end;

 

  if r7s861 ne -3 and r7s862 ne -3 and r7s863 ne -3 and r7s864 ne -3 and r7s865 ne -3 and r7s866 ne -3 and r7s867 ne -3

     and r7s868 ne -3 and r7s869 ne -3 and r7s8610 ne -3 then do;

     r7self86=sum(r7s861,r7s862,r7s863,r7s864,r7s865,r7s866,r7s867,r7s868,r7s869,r7s8610 );

  end;

  if r7s861=-3 or r7s862=-3 or r7s863=-3 or r7s864=-3 or r7s865=-3 or r7s866=-3 or r7s867=-3 or r7s868=-3

     or r7s869=-3 or r7s8610=-3 then do;

     r7self86=-3;

  end;

 

  if r7e861 ne -3 and r7e862 ne -3 and r7e863 ne -3 and r7e864 ne -3 and r7e865 ne -3 and r7e866 ne -3 and r7e867 ne -3

     and r7e868 ne -3 and r7e869 ne -3 and r7e8610 ne -3 then do;

     r7emp86=sum(r7e861,r7e862,r7e863,r7e864,r7e865,r7e866,r7e867,r7e868,r7e869,r7e8610) ;

  end;

  if r7e861=-3 or r7e862=-3 or r7e863=-3 or r7e864=-3 or r7e865=-3 or r7e866=-3 or r7e867=-3 or r7e868=-3

     or r7e869=-3 or r7e8610=-3 then do;

     r7emp86=-3;

  end;

 

  /* 1987 */

 

  r7j871=0;   r7s871=0;   r7e871=0;

  r7j872=0;       r7s872=0;       r7e872=0;

  r7j873=0;       r7s873=0;       r7e873=0;

  r7j874=0;       r7s874=0;       r7e874=0;

  r7j875=0;       r7s875=0;       r7e875=0;

  r7j876=0;       r7s876=0;       r7e876=0;

  r7j877=0;       r7s877=0;       r7e877=0;

  r7j878=0;       r7s878=0;       r7e878=0;

  r7j879=0;       r7s879=0;       r7e879=0;

  r7j8710=0;      r7s8710=0;      r7e8710=0;

 

 

  do i=366 to 417;

     if job1wks=-3 then do;

        r7j871=-3;

     end;

     if job1wks=-3 and self01=1 then do;

        r7s871=-3;

     end;

     if job1wks=-3 and self01=0 then do;

        r7e871=-3;

     end;

     if job2wks=-3 then do;

        r7j872=-3;

     end;

     if job2wks=-3 and self02=1 then do;

        r7s872=-3;

     end;

     if job2wks=-3 and self02=0 then do;

        r7e872=-3;

     end;

     if job3wks=-3 then do;

        r7j873=-3;

     end;

     if job3wks=-3 and self03=1 then do;

        r7s873=-3;

     end;

     if job3wks=-3 and self03=0 then do;

        r7e873=-3;

     end;

     if job4wks=-3 then do;

        r7j874=-3;

     end;

     if job4wks=-3 and self04=1 then do;

        r7s874=-3;

     end;

     if job4wks=-3 and self04=0 then do;

        r7e874=-3;

     end;

     if job5wks=-3 then do;

        r7j875=-3;

     end;

     if job5wks=-3 and self05=1 then do;

        r7s875=-3;

     end;

     if job5wks=-3 and self05=0 then do;

        r7e875=-3;

     end;

     if job6wks=-3 then do;

        r7j876=-3;

     end;

     if job6wks=-3 and self06=1 then do;

        r7s876=-3;

     end;

     if job6wks=-3 and self06=0 then do;

        r7e876=-3;

     end;

     if job7wks=-3 then do;

        r7j877=-3;

     end;

     if job7wks=-3 and self07=1 then do;

        r7s877=-3;

     end;

     if job7wks=-3 and self07=0 then do;

        r7e877=-3;

     end;

     if job8wks=-3 then do;

        r7j878=-3;

     end;

     if job8wks=-3 and self08=1 then do;

        r7s878=-3;

     end;

     if job8wks=-3 and self08=0 then do;

        r7e878=-3;

     end;

     if job9wks=-3 then do;

        r7j879=-3;

     end;

     if job9wks=-3 and self09=1 then do;

        r7s879=-3;

     end;

     if job9wks=-3 and self09=0 then do;

        r7e879=-3;

     end;

     if job10wks=-3 then do;

        r7j8710=-3;

     end;

     if job10wks=-3 and self10=1 then do;

        r7s8710=-3;

     end;

     if job10wks=-3 and self10=0 then do;

        r7e8710=-3;

     end;

 

  end;

 

  do i=366 to 417;

     if job1wks=1 then do;

        r7j871=1;

     end;

     if job1wks=1 and self01=1 then do;

        r7s871=1;

     end;

     if job1wks=1 and self01=0 then do;

        r7e871=1;

     end;

     if job2wks=1 then do;

        r7j872=1;

     end;

     if job2wks=1 and self02=1 then do;

        r7s872=1;

     end;

     if job2wks=1 and self02=0 then do;

        r7e872=1;

     end;

     if job3wks=1 then do;

        r7j873=1;

     end;

     if job3wks=1 and self03=1 then do;

        r7s873=1;

     end;

     if job3wks=1 and self03=0 then do;

        r7e873=1;

     end;

     if job4wks=1 then do;

        r7j874=1;

     end;

     if job4wks=1 and self04=1 then do;

        r7s874=1;

     end;

     if job4wks=1 and self04=0 then do;

        r7e874=1;

     end;

     if job5wks=1 then do;

        r7j875=1;

     end;

     if job5wks=1 and self05=1 then do;

        r7s875=1;

     end;

     if job5wks=1 and self05=0 then do;

        r7e875=1;

     end;

     if job6wks=1 then do;

        r7j876=1;

     end;

     if job6wks=1 and self06=1 then do;

        r7s876=1;

     end;

     if job6wks=1 and self06=0 then do;

        r7e876=1;

     end;

     if job7wks=1 then do;

        r7j877=1;

     end;

     if job7wks=1 and self07=1 then do;

        r7s877=1;

     end;

     if job7wks=1 and self07=0 then do;

        r7e877=1;

     end;

     if job8wks=1 then do;

        r7j878=1;

     end;

     if job8wks=1 and self08=1 then do;

        r7s878=1;

     end;

     if job8wks=1 and self08=0 then do;

        r7e878=1;

     end;

     if job9wks=1 then do;

        r7j879=1;

     end;

     if job9wks=1 and self09=1 then do;

        r7s879=1;

     end;

     if job9wks=1 and self09=0 then do;

        r7e879=1;

     end;

     if job10wks=1 then do;

        r7j8710=1;

     end;

     if job10wks=1 and self10=1 then do;

        r7s8710=1;

     end;

     if job10wks=1 and self10=0 then do;

        r7e8710=1;

     end;

 

  end;

 

  if r7j871 ne -3 and r7j872 ne -3 and r7j873 ne -3 and r7j874 ne -3 and r7j875 ne -3 and r7j876 ne -3 and r7j877 ne -3

     and r7j878 ne -3 and r7j879 ne -3 and r7j8710 ne -3 then do;

     r7job87=sum(r7j871,r7j872,r7j873,r7j874,r7j875,r7j876,r7j877,r7j878,r7j879,r7j8710) ;

  end;

  if r7j871=-3 or r7j872=-3 or r7j873=-3 or r7j874=-3 or r7j875=-3 or r7j876=-3 or r7j877=-3 or r7j878=-3

     or r7j879=-3 or r7j8710=-3 then do;

     r7job87=-3;

  end;

 

  if r7s871 ne -3 and r7s872 ne -3 and r7s873 ne -3 and r7s874 ne -3 and r7s875 ne -3 and r7s876 ne -3 and r7s877 ne -3

     and r7s878 ne -3 and r7s879 ne -3 and r7s8710 ne -3 then do;

     r7self87=sum(r7s871,r7s872,r7s873,r7s874,r7s875,r7s876,r7s877,r7s878,r7s879,r7s8710 );

  end;

  if r7s871=-3 or r7s872=-3 or r7s873=-3 or r7s874=-3 or r7s875=-3 or r7s876=-3 or r7s877=-3 or r7s878=-3

     or r7s879=-3 or r7s8710=-3 then do;

     r7self87=-3;

  end;

 

  if r7e871 ne -3 and r7e872 ne -3 and r7e873 ne -3 and r7e874 ne -3 and r7e875 ne -3 and r7e876 ne -3 and r7e877 ne -3

     and r7e878 ne -3 and r7e879 ne -3 and r7e8710 ne -3 then do;

     r7emp87=sum(r7e871,r7e872,r7e873,r7e874,r7e875,r7e876,r7e877,r7e878,r7e879,r7e8710) ;

  end;

  if r7e871=-3 or r7e872=-3 or r7e873=-3 or r7e874=-3 or r7e875=-3 or r7e876=-3 or r7e877=-3 or r7e878=-3

     or r7e879=-3 or r7e8710=-3 then do;

     r7emp87=-3;

  end;

 

  /* 1988 */

 

  r7j881=0;   r7s881=0;   r7e881=0;

  r7j882=0;       r7s882=0;       r7e882=0;

  r7j883=0;       r7s883=0;       r7e883=0;

  r7j884=0;       r7s884=0;       r7e884=0;

  r7j885=0;       r7s885=0;       r7e885=0;

  r7j886=0;       r7s886=0;       r7e886=0;

  r7j887=0;       r7s887=0;       r7e887=0;

  r7j888=0;       r7s888=0;       r7e888=0;

  r7j889=0;       r7s889=0;       r7e889=0;

  r7j8810=0;      r7s8810=0;      r7e8810=0;

 

 

  do i=418 to 470;

     if job1wks=-3 then do;

        r7j881=-3;

     end;

     if job1wks=-3 and self01=1 then do;

        r7s881=-3;

     end;

     if job1wks=-3 and self01=0 then do;

        r7e881=-3;

     end;

     if job2wks=-3 then do;

        r7j882=-3;

     end;

     if job2wks=-3 and self02=1 then do;

        r7s882=-3;

     end;

     if job2wks=-3 and self02=0 then do;

        r7e882=-3;

     end;

     if job3wks=-3 then do;

        r7j883=-3;

     end;

     if job3wks=-3 and self03=1 then do;

        r7s883=-3;

     end;

     if job3wks=-3 and self03=0 then do;

        r7e883=-3;

     end;

     if job4wks=-3 then do;

        r7j884=-3;

     end;

     if job4wks=-3 and self04=1 then do;

        r7s884=-3;

     end;

     if job4wks=-3 and self04=0 then do;

        r7e884=-3;

     end;

     if job5wks=-3 then do;

        r7j885=-3;

     end;

     if job5wks=-3 and self05=1 then do;

        r7s885=-3;

     end;

     if job5wks=-3 and self05=0 then do;

        r7e885=-3;

     end;

     if job6wks=-3 then do;

        r7j886=-3;

     end;

     if job6wks=-3 and self06=1 then do;

        r7s886=-3;

     end;

     if job6wks=-3 and self06=0 then do;

        r7e886=-3;

     end;

     if job7wks=-3 then do;

        r7j887=-3;

     end;

     if job7wks=-3 and self07=1 then do;

        r7s887=-3;

     end;

     if job7wks=-3 and self07=0 then do;

        r7e887=-3;

     end;

     if job8wks=-3 then do;

        r7j888=-3;

     end;

     if job8wks=-3 and self08=1 then do;

        r7s888=-3;

     end;

     if job8wks=-3 and self08=0 then do;

        r7e888=-3;

     end;

     if job9wks=-3 then do;

        r7j889=-3;

     end;

     if job9wks=-3 and self09=1 then do;

        r7s889=-3;

     end;

     if job9wks=-3 and self09=0 then do;

        r7e889=-3;

     end;

     if job10wks=-3 then do;

        r7j8810=-3;

     end;

     if job10wks=-3 and self10=1 then do;

        r7s8810=-3;

     end;

     if job10wks=-3 and self10=0 then do;

        r7e8810=-3;

     end;

 

  end;

 

  do i=418 to 470;

     if job1wks=1 then do;

        r7j881=1;

     end;

     if job1wks=1 and self01=1 then do;

        r7s881=1;

     end;

     if job1wks=1 and self01=0 then do;

        r7e881=1;

     end;

     if job2wks=1 then do;

        r7j882=1;

     end;

     if job2wks=1 and self02=1 then do;

        r7s882=1;

     end;

     if job2wks=1 and self02=0 then do;

        r7e882=1;

     end;

     if job3wks=1 then do;

        r7j883=1;

     end;

     if job3wks=1 and self03=1 then do;

        r7s883=1;

     end;

     if job3wks=1 and self03=0 then do;

        r7e883=1;

     end;

     if job4wks=1 then do;

        r7j884=1;

     end;

     if job4wks=1 and self04=1 then do;

        r7s884=1;

     end;

     if job4wks=1 and self04=0 then do;

        r7e884=1;

     end;

     if job5wks=1 then do;

        r7j885=1;

     end;

     if job5wks=1 and self05=1 then do;

        r7s885=1;

     end;

     if job5wks=1 and self05=0 then do;

        r7e885=1;

     end;

     if job6wks=1 then do;

        r7j886=1;

     end;

     if job6wks=1 and self06=1 then do;

        r7s886=1;

     end;

     if job6wks=1 and self06=0 then do;

        r7e886=1;

     end;

     if job7wks=1 then do;

        r7j887=1;

     end;

     if job7wks=1 and self07=1 then do;

        r7s887=1;

     end;

     if job7wks=1 and self07=0 then do;

        r7e887=1;

     end;

     if job8wks=1 then do;

        r7j888=1;

     end;

     if job8wks=1 and self08=1 then do;

        r7s888=1;

     end;

     if job8wks=1 and self08=0 then do;

        r7e888=1;

     end;

     if job9wks=1 then do;

        r7j889=1;

     end;

     if job9wks=1 and self09=1 then do;

        r7s889=1;

     end;

     if job9wks=1 and self09=0 then do;

        r7e889=1;

     end;

     if job10wks=1 then do;

        r7j8810=1;

     end;

     if job10wks=1 and self10=1 then do;

        r7s8810=1;

     end;

     if job10wks=1 and self10=0 then do;

        r7e8810=1;

     end;

 

  end;

 

  if r7j881 ne -3 and r7j882 ne -3 and r7j883 ne -3 and r7j884 ne -3 and r7j885 ne -3 and r7j886 ne -3 and r7j887 ne -3

     and r7j888 ne -3 and r7j889 ne -3 and r7j8810 ne -3 then do;

     r7job88=sum(r7j881,r7j882,r7j883,r7j884,r7j885,r7j886,r7j887,r7j888,r7j889,r7j8810) ;

  end;

  if r7j881=-3 or r7j882=-3 or r7j883=-3 or r7j884=-3 or r7j885=-3 or r7j886=-3 or r7j887=-3 or r7j888=-3

     or r7j889=-3 or r7j8810=-3 then do;

     r7job88=-3;

  end;

 

  if r7s881 ne -3 and r7s882 ne -3 and r7s883 ne -3 and r7s884 ne -3 and r7s885 ne -3 and r7s886 ne -3 and r7s887 ne -3

     and r7s888 ne -3 and r7s889 ne -3 and r7s8810 ne -3 then do;

     r7self88=sum(r7s881,r7s882,r7s883,r7s884,r7s885,r7s886,r7s887,r7s888,r7s889,r7s8810 );

  end;

  if r7s881=-3 or r7s882=-3 or r7s883=-3 or r7s884=-3 or r7s885=-3 or r7s886=-3 or r7s887=-3 or r7s888=-3

     or r7s889=-3 or r7s8810=-3 then do;

     r7self88=-3;

  end;

 

  if r7e881 ne -3 and r7e882 ne -3 and r7e883 ne -3 and r7e884 ne -3 and r7e885 ne -3 and r7e886 ne -3 and r7e887 ne -3

     and r7e888 ne -3 and r7e889 ne -3 and r7e8810 ne -3 then do;

     r7emp88=sum(r7e881,r7e882,r7e883,r7e884,r7e885,r7e886,r7e887,r7e888,r7e889,r7e8810) ;

  end;

  if r7e881=-3 or r7e882=-3 or r7e883=-3 or r7e884=-3 or r7e885=-3 or r7e886=-3 or r7e887=-3 or r7e888=-3

     or r7e889=-3 or r7e8810=-3 then do;

     r7emp88=-3;

  end;

 

  /* 1989 */

 

  r7j891=0;   r7s891=0;   r7e891=0;

  r7j892=0;       r7s892=0;       r7e892=0;

  r7j893=0;       r7s893=0;       r7e893=0;

  r7j894=0;       r7s894=0;       r7e894=0;

  r7j895=0;       r7s895=0;       r7e895=0;

  r7j896=0;       r7s896=0;       r7e896=0;

  r7j897=0;       r7s897=0;       r7e897=0;

  r7j898=0;       r7s898=0;       r7e898=0;

  r7j899=0;       r7s899=0;       r7e899=0;

  r7j8910=0;      r7s8910=0;      r7e8910=0;

 

 

  do i=471 to 522;

     if job1wks=-3 then do;

        r7j891=-3;

     end;

     if job1wks=-3 and self01=1 then do;

        r7s891=-3;

     end;

     if job1wks=-3 and self01=0 then do;

        r7e891=-3;

     end;

     if job2wks=-3 then do;

        r7j892=-3;

     end;

     if job2wks=-3 and self02=1 then do;

        r7s892=-3;

     end;

     if job2wks=-3 and self02=0 then do;

        r7e892=-3;

     end;

     if job3wks=-3 then do;

        r7j893=-3;

     end;

     if job3wks=-3 and self03=1 then do;

        r7s893=-3;

     end;

     if job3wks=-3 and self03=0 then do;

        r7e893=-3;

     end;

     if job4wks=-3 then do;

        r7j894=-3;

     end;

     if job4wks=-3 and self04=1 then do;

        r7s894=-3;

     end;

     if job4wks=-3 and self04=0 then do;

        r7e894=-3;

     end;

     if job5wks=-3 then do;

        r7j895=-3;

     end;

     if job5wks=-3 and self05=1 then do;

        r7s895=-3;

     end;

     if job5wks=-3 and self05=0 then do;

        r7e895=-3;

     end;

     if job6wks=-3 then do;

        r7j896=-3;

     end;

     if job6wks=-3 and self06=1 then do;

        r7s896=-3;

     end;

     if job6wks=-3 and self06=0 then do;

        r7e896=-3;

     end;

     if job7wks=-3 then do;

        r7j897=-3;

     end;

     if job7wks=-3 and self07=1 then do;

        r7s897=-3;

     end;

     if job7wks=-3 and self07=0 then do;

        r7e897=-3;

     end;

     if job8wks=-3 then do;

        r7j898=-3;

     end;

     if job8wks=-3 and self08=1 then do;

        r7s898=-3;

     end;

     if job8wks=-3 and self08=0 then do;

        r7e898=-3;

     end;

     if job9wks=-3 then do;

        r7j899=-3;

     end;

     if job9wks=-3 and self09=1 then do;

        r7s899=-3;

     end;

     if job9wks=-3 and self09=0 then do;

        r7e899=-3;

     end;

     if job10wks=-3 then do;

        r7j8910=-3;

     end;

     if job10wks=-3 and self10=1 then do;

        r7s8910=-3;

     end;

     if job10wks=-3 and self10=0 then do;

        r7e8910=-3;

     end;

 

  end;

 

  do i=471 to 522;

     if job1wks=1 then do;

        r7j891=1;

     end;

     if job1wks=1 and self01=1 then do;

        r7s891=1;

     end;

     if job1wks=1 and self01=0 then do;

        r7e891=1;

     end;

     if job2wks=1 then do;

        r7j892=1;

     end;

     if job2wks=1 and self02=1 then do;

        r7s892=1;

     end;

     if job2wks=1 and self02=0 then do;

        r7e892=1;

     end;

     if job3wks=1 then do;

        r7j893=1;

     end;

     if job3wks=1 and self03=1 then do;

        r7s893=1;

     end;

     if job3wks=1 and self03=0 then do;

        r7e893=1;

     end;

     if job4wks=1 then do;

        r7j894=1;

     end;

     if job4wks=1 and self04=1 then do;

        r7s894=1;

     end;

     if job4wks=1 and self04=0 then do;

        r7e894=1;

     end;

     if job5wks=1 then do;

        r7j895=1;

     end;

     if job5wks=1 and self05=1 then do;

        r7s895=1;

     end;

     if job5wks=1 and self05=0 then do;

        r7e895=1;

     end;

     if job6wks=1 then do;

        r7j896=1;

     end;

     if job6wks=1 and self06=1 then do;

        r7s896=1;

     end;

     if job6wks=1 and self06=0 then do;

        r7e896=1;

     end;

     if job7wks=1 then do;

        r7j897=1;

     end;

     if job7wks=1 and self07=1 then do;

        r7s897=1;

     end;

     if job7wks=1 and self07=0 then do;

        r7e897=1;

     end;

     if job8wks=1 then do;

        r7j898=1;

     end;

     if job8wks=1 and self08=1 then do;

        r7s898=1;

     end;

     if job8wks=1 and self08=0 then do;

        r7e898=1;

     end;

     if job9wks=1 then do;

        r7j899=1;

     end;

     if job9wks=1 and self09=1 then do;

        r7s899=1;

     end;

     if job9wks=1 and self09=0 then do;

        r7e899=1;

     end;

     if job10wks=1 then do;

        r7j8910=1;

     end;

     if job10wks=1 and self10=1 then do;

        r7s8910=1;

     end;

     if job10wks=1 and self10=0 then do;

        r7e8910=1;

     end;

 

  end;

 

  if r7j891 ne -3 and r7j892 ne -3 and r7j893 ne -3 and r7j894 ne -3 and r7j895 ne -3 and r7j896 ne -3 and r7j897 ne -3

     and r7j898 ne -3 and r7j899 ne -3 and r7j8910 ne -3 then do;

     r7job89=sum(r7j891,r7j892,r7j893,r7j894,r7j895,r7j896,r7j897,r7j898,r7j899,r7j8910) ;

  end;

  if r7j891=-3 or r7j892=-3 or r7j893=-3 or r7j894=-3 or r7j895=-3 or r7j896=-3 or r7j897=-3 or r7j898=-3

     or r7j899=-3 or r7j8910=-3 then do;

     r7job89=-3;

  end;

 

  if r7s891 ne -3 and r7s892 ne -3 and r7s893 ne -3 and r7s894 ne -3 and r7s895 ne -3 and r7s896 ne -3 and r7s897 ne -3

     and r7s898 ne -3 and r7s899 ne -3 and r7s8910 ne -3 then do;

     r7self89=sum(r7s891,r7s892,r7s893,r7s894,r7s895,r7s896,r7s897,r7s898,r7s899,r7s8910 );

  end;

  if r7s891=-3 or r7s892=-3 or r7s893=-3 or r7s894=-3 or r7s895=-3 or r7s896=-3 or r7s897=-3 or r7s898=-3

     or r7s899=-3 or r7s8910=-3 then do;

     r7self89=-3;

  end;

 

  if r7e891 ne -3 and r7e892 ne -3 and r7e893 ne -3 and r7e894 ne -3 and r7e895 ne -3 and r7e896 ne -3 and r7e897 ne -3

     and r7e898 ne -3 and r7e899 ne -3 and r7e8910 ne -3 then do;

     r7emp89=sum(r7e891,r7e892,r7e893,r7e894,r7e895,r7e896,r7e897,r7e898,r7e899,r7e8910) ;

  end;

  if r7e891=-3 or r7e892=-3 or r7e893=-3 or r7e894=-3 or r7e895=-3 or r7e896=-3 or r7e897=-3 or r7e898=-3

     or r7e899=-3 or r7e8910=-3 then do;

     r7emp89=-3;

  end;

 

  /* 1990 */

 

  r7j901=0;   r7s901=0;   r7e901=0;

  r7j902=0;       r7s902=0;       r7e902=0;

  r7j903=0;       r7s903=0;       r7e903=0;

  r7j904=0;       r7s904=0;       r7e904=0;

  r7j905=0;       r7s905=0;       r7e905=0;

  r7j906=0;       r7s906=0;       r7e906=0;

  r7j907=0;       r7s907=0;       r7e907=0;

  r7j908=0;       r7s908=0;       r7e908=0;

  r7j909=0;       r7s909=0;       r7e909=0;

  r7j9010=0;      r7s9010=0;      r7e9010=0;

 

 

  do i=523 to 574;

     if job1wks=-3 then do;

        r7j901=-3;

     end;

     if job1wks=-3 and self01=1 then do;

        r7s901=-3;

     end;

     if job1wks=-3 and self01=0 then do;

        r7e901=-3;

     end;

     if job2wks=-3 then do;

        r7j902=-3;

     end;

     if job2wks=-3 and self02=1 then do;

        r7s902=-3;

     end;

     if job2wks=-3 and self02=0 then do;

        r7e902=-3;

     end;

     if job3wks=-3 then do;

        r7j903=-3;

     end;

     if job3wks=-3 and self03=1 then do;

        r7s903=-3;

     end;

     if job3wks=-3 and self03=0 then do;

        r7e903=-3;

     end;

     if job4wks=-3 then do;

        r7j904=-3;

     end;

     if job4wks=-3 and self04=1 then do;

        r7s904=-3;

     end;

     if job4wks=-3 and self04=0 then do;

        r7e904=-3;

     end;

     if job5wks=-3 then do;

        r7j905=-3;

     end;

     if job5wks=-3 and self05=1 then do;

        r7s905=-3;

     end;

     if job5wks=-3 and self05=0 then do;

        r7e905=-3;

     end;

     if job6wks=-3 then do;

        r7j906=-3;

     end;

     if job6wks=-3 and self06=1 then do;

        r7s906=-3;

     end;

     if job6wks=-3 and self06=0 then do;

        r7e906=-3;

     end;

     if job7wks=-3 then do;

        r7j907=-3;

     end;

     if job7wks=-3 and self07=1 then do;

        r7s907=-3;

     end;

     if job7wks=-3 and self07=0 then do;

        r7e907=-3;

     end;

     if job8wks=-3 then do;

        r7j908=-3;

     end;

     if job8wks=-3 and self08=1 then do;

        r7s908=-3;

     end;

     if job8wks=-3 and self08=0 then do;

        r7e908=-3;

     end;

     if job9wks=-3 then do;

        r7j909=-3;

     end;

     if job9wks=-3 and self09=1 then do;

        r7s909=-3;

     end;

     if job9wks=-3 and self09=0 then do;

        r7e909=-3;

     end;

     if job10wks=-3 then do;

        r7j9010=-3;

     end;

     if job10wks=-3 and self10=1 then do;

        r7s9010=-3;

     end;

     if job10wks=-3 and self10=0 then do;

        r7e9010=-3;

     end;

 

  end;

 

  do i=523 to 574;

     if job1wks=1 then do;

        r7j901=1;

     end;

     if job1wks=1 and self01=1 then do;

        r7s901=1;

     end;

     if job1wks=1 and self01=0 then do;

        r7e901=1;

     end;

     if job2wks=1 then do;

        r7j902=1;

     end;

     if job2wks=1 and self02=1 then do;

        r7s902=1;

     end;

     if job2wks=1 and self02=0 then do;

        r7e902=1;

     end;

     if job3wks=1 then do;

        r7j903=1;

     end;

     if job3wks=1 and self03=1 then do;

        r7s903=1;

     end;

     if job3wks=1 and self03=0 then do;

        r7e903=1;

     end;

     if job4wks=1 then do;

        r7j904=1;

     end;

     if job4wks=1 and self04=1 then do;

        r7s904=1;

     end;

     if job4wks=1 and self04=0 then do;

        r7e904=1;

     end;

     if job5wks=1 then do;

        r7j905=1;

     end;

     if job5wks=1 and self05=1 then do;

        r7s905=1;

     end;

     if job5wks=1 and self05=0 then do;

        r7e905=1;

     end;

     if job6wks=1 then do;

        r7j906=1;

     end;

     if job6wks=1 and self06=1 then do;

        r7s906=1;

     end;

     if job6wks=1 and self06=0 then do;

        r7e906=1;

     end;

     if job7wks=1 then do;

        r7j907=1;

     end;

     if job7wks=1 and self07=1 then do;

        r7s907=1;

     end;

     if job7wks=1 and self07=0 then do;

        r7e907=1;

     end;

     if job8wks=1 then do;

        r7j908=1;

     end;

     if job8wks=1 and self08=1 then do;

        r7s908=1;

     end;

     if job8wks=1 and self08=0 then do;

        r7e908=1;

     end;

     if job9wks=1 then do;

        r7j909=1;

     end;

     if job9wks=1 and self09=1 then do;

        r7s909=1;

     end;

     if job9wks=1 and self09=0 then do;

        r7e909=1;

     end;

     if job10wks=1 then do;

        r7j9010=1;

     end;

     if job10wks=1 and self10=1 then do;

        r7s9010=1;

     end;

     if job10wks=1 and self10=0 then do;

        r7e9010=1;

     end;

 

  end;