Collection of Employment Data. The employment sections of the NLSY97 questionnaire are somewhat complex. Before beginning analysis, researchers must understand the structure of each round's questionnaire, particularly the way in which jobs are classified as employee, freelance, or self-employment. It is important to note that this classification depends in part on the survey round and the respondent's age. In rounds 1 and 2, employee jobs were recorded in the first part of the YEMP section, administered only to respondents age 14 or older as of the interview date. The second part of the YEMP section collected information about freelance jobs of respondents age 14 and older and all jobs of respondents age 12 or 13 (the implicit assumption being that respondents younger than 14 are not likely to hold employee jobs). If the respondent was at least 16 years old and made at least $200/week in a freelance job, the job was classified as self-employment and an extra series of questions was asked during the freelance section.
In round 3, all respondents were at least age 14 by the interview date, so the age restriction for employee jobs was no longer necessary. The structure of the section remained largely the same, with a division between employee and freelance jobs. Self-employment was classified in the same way as in the earlier rounds.
In round 4 the section was redesigned. Respondents born in 1980-82 (who were mostly age 18 and older when the round 4 field period began) were asked about employee jobs and self-employment at the same time. In addition, the minimum income requirement from the freelance section no longer applied; jobs could be classified as self-employment regardless of earnings. However, respondents born in 1983-84 (who were mostly age 16 or 17 when the round 4 field period began) continued to describe employee and freelance jobs separately. Data on self-employment jobs were still collected in the freelance section, and freelance jobs still had to meet the income criteria to qualify as self-employment. The same pattern was used in round 5.
The redesign of the employment section has important implications for created employment variables. In rounds 1-3, all of the created employment variables were based only on employee-type jobs. So, for example, the variable "Weeks Worked during Calendar Year 1999" counted only the weeks worked by a respondent at a regular employee-type job. If the respondent also reported self-employment in a lawn care business, the weeks spent working at that job were not counted in the created variable.
In round 4, when older respondents reported both employee-type and self-employed jobs in the same series of variables, this approach was reconsidered. For rounds 4 and 5, older respondents now have three versions of most created variables. The first version, identified by the suffix "ET" in the question name, includes only employee-type jobs. The second version, the "SE" variables, includes only self-employed jobs reported by respondents born in 1980-83 in the regular employment section during round 5 (and similarly for respondents born in 1980-82 in round 4). These variables do not include freelance jobs or self-employment reported by younger respondents in the freelance jobs section in rounds 4 and 5, and they do not include freelance jobs or self-employment reported in rounds 1-3 by any respondent regardless of age. Finally, the variables for all jobs include both employee-type jobs and self-employment reported during round 5 for respondents born in 1980-83 but only include employee-type jobs for respondents born in 1984 (similarly, in round 4, these variables reported all jobs for respondents born in 1980-82 and only employee-type jobs for respondents born in 1983-84). These last variables are identified with the suffix "ALL" in the question name.
Respondents' ages varied widely in round 4, when self-employed jobs were first recorded as part of the regular employment section, and some respondents reported employment over several years if they missed a round of interviewing. To simplify the creation of the employment variables, survey staff included only the self-employment job information starting on January 1 of the year the respondent turned 18. For example, consider a respondent who was 20 years old on his round 4 interview date in April 2001 and had not been interviewed since round 1. He reports self-employment in a computer repair business beginning on his 17th birthday in March 1998 and continuous employment at a fast-food restaurant since his round 1 interview in 1997. The round 4 created employment variables would include information about the employee-type fast food job dating all the way back to 1997. However, the computer repair business would not be considered until January 1, 1999 (the first day of the year he turned 18). In other words, the variable "Weeks Worked in Calendar Year 1998" would count only the fast food job and the variable "Weeks Worked Any Job in Calendar Year 1999" would count both the fast food job and the repair business. Similarly, the new variable "Weeks R Was Self-Employed Year 1998" would have a value of -4, or valid skip (because the respondent was not yet 18), but the variable "Weeks R Was Self-Employed Year 1999" would report the weeks the respondent worked at the computer repair business in 1999. This approach, continued in round 5, will permit users to compare the employment variables across respondents in different rounds with confidence that the job types included are the same for all respondents of a given age.
"Backreporters." Occasionally respondents report a job in the current interview that started before the date of their last interview and should have been reported at that time. Appendix 6 in this document contains a more complete description of the implications of these reports for the created employment event history variables. There are also a number of created employment variables detailed in this appendix. Nearly all of these variables use the information provided about employment previous to the date of last interview. The only exception is the set of CV_WKSWK_DLI variables, which reports the weeks worked since the previous interview date. The current round's variables would not include the backreported information in any case; the previous round's variables are not re-created to incorporate this new information.
For example, assume that Jane was interviewed in round 3 on April 15, 2000, and in round 4 on April 15, 2001. In the round 4 interview, she reports for the first time a job that started on April 1, 2000. The 2 weeks worked at that job before April 15, 2000, would not be reflected in any round's CV_WKSWK_DLI variables. However, those weeks would be counted in other variables. For example, CV_WKSWK_YR.00 would count all the weeks worked at any job in 2000, regardless of whether those weeks were reported in the round 3 or round 4 interview.
Creation of Employment Variables. A number of the created employment variables use the same program as input. The program in this section is referred to throughout the employment variables. For example, to create the "Weeks Worked at Employee Job #x during 19xx" variables, survey staff first run the program titled "emp_begin.sas" and then run the program included in the weeks worked section of this appendix. The variables and code for "emp_begin.sas" are provided in a separate file.
Variables Created: V_WKSWK_YR_ALL.80 - CV_WKSWK_YR_ALL.03
CV_WKSWK_YR_ET.80 - CV_WKSWK_YR_ET.03
CV_WKSWK_YR_SE.98 - CV_WKSWK_YR_SE.03
Programs Used
This program uses emp_begin.sas as input (follow hyperlink for details).
This variable is created for each individual for each year of potential work activity (1980-2003) See the introduction to this appendix for important information about the universes for each of these variables. Respondents not working in a given year are given a default value of zero (0) weeks worked. Otherwise, the variable indicates the actual cumulative weeks worked on all jobs in that year.
array job1wks (i) w1_1-w1_1253;
array job2wks (i) w2_1-w2_1253;
array job3wks (i) w3_1-w3_1253;
array job4wks (i) w4_1-w4_1253;
array job5wks (i) w5_1-w5_1253;
array job6wks (i) w6_1-w6_1253;
array job7wks (i) w7_1-w7_1253;
array job8wks (i) w8_1-w8_1253;
array job9wks (i) w9_1-w9_1253;
array job10wks (i) w10_1-w10_1253;
array job11wks (i) w11_1-w11_1253;
array alljobs (i) wks1-wks1253;
array selfjobs (i) swks1-swks1253;
array empjobs (i) ewks1-ewks1253;
array starw (i) starw01-starw11;
array stopw (i) stopw01-stopw11;
array uid (i) uid01-uid11;
array self (i) self01-self11;
array smof (i) smof01-smof11;
array emof (i) emof01-emof11;
array stary (i) stary01-stary11;
array stopy (i) stopy01-stopy11;
array r6wks (i) r6wks80-r6wks99 r6wks00 r6wks01 r6wks02 r6wks03;
array r6swks (i) r6swks80-r6swks99 r6swks00 r6swks01 r6swks02 r6swks03;
array r6ewks (i) r6ewks80-r6ewks99 r6ewks00 r6ewks01 r6ewks02 r6ewks03;
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;
/* repeat code for jobs 3-11*/
end;
**********************************************************
** Calculate cumulative weeks on all jobs for each year **
**********************************************************;
/* Initialize each annual c.v. */
do over r6wks;
r6wks=0;
r6swks=0;
r6ewks=0;
end;
/* 1980 */
do i=1 to 52;
if alljobs=1 then do;
r6wks80=r6wks80+1;
end;
if selfjobs=1 then do;
r6swks80=r6swks80+1;
end;
if empjobs=1 then do;
r6ewks80=r6ewks80+1;
end;
end;
do i=1 to 52;
if alljobs=-3 then do;
r6wks80=-3;
end;
if selfjobs=-3 then do;
r6swks80=-3;
end;
if empjobs=-3 then do;
r6ewks80=-3;
end;
end;
/* repeat for 1981-2003
/*the week numbers for the do i statements are as follows*/
/* 1981 */ do i=53 to 104;
/* 1982 */ do i=105 to 156;
/* 1983 */ do i=157 to 209;
/* 1984 */ do i=210 to 261;
/* 1985 */ do i=262 to 313;
/* 1986 */ do i=314 to 365;
/* 1987 */ do i=366 to 417;
/* 1988 */ do i=418 to 470;
/* 1989 */ do i=471 to 522;
/* 1990 */ do i=523 to 574;
/* 1991 */ do i=575 to 626;
/* 1992 */ do i=627 to 678;
/* 1993 */ do i=679 to 730;
/* 1994 */ do i=731 to 783;
/* 1995 */ do i=784 to 835;
/* 1996 */ do i=836 to 887;
/* 1997 */ do i=888 to 939;
/* 1998 */ do i=940 to 991;
/* 1999 */ do i=992 to 1043;
/* 2000 */ do i=1044 to 1096;
/* 2001 */ do i=1097 to 1148;
/* 2002 */ do i=1149 to 1200;
/* 2003 */ do i=1201 to 1252;
*** Include valid skips;
do over r6wks;
if e200=-5 then do;
r6wks=-5;
r6swks=-5;
r6ewks=-5;
end;
end;
/* Define the following c.v.'s to match up the array sizes, they are zero by
definition. */
r1wks99=0; r1wks00=0; r1wks01=0; r1wks02=0; r1wks03=0;
r2wks00=0; r2wks01=0; r2wks02=0; r2wks03=0; r3wks03=0;
r3wks01=0; r3wks02=0; r3wks03=0;
r4wks02=0; r4ewks02=0; r4swks02=0; r4wks03=0; r4ewks03=0; r4swks03=0;
r5wks03=0; r5ewks03=0; r5swks03=0;
array r1wks (i) r1wks80-r1wks99 r1wks00 r1wks01 r1wks02 r1wks03; /* Round 1
created variable */
array r2wks (i) r2wks80-r2wks99 r2wks00 r2wks01 r2wks02 r2wks03; /* Round 2
created variable */
array r3wks (i) r3wks80-r3wks99 r3wks00 r3wks01 r3wks02 r3wks03; /* Round 3
created variable */
array r4wks (i) r4wks80-r4wks99 r4wks00 r4wks01 r4wks02 r4wks03; /* Round 4
created variable, all jobs */
array r4ewks (i) r4ewks80-r4ewks99 r4ewks00 r4ewks01 r4ewks02 r4ewks03;/* Round
4 created variable, employee jobs*/
array r4swks (i) r4swks80-r4swks99 r4swks00 r4swks01 r4swks02 r4swks03;/*Round 4
created variable, self-employed jobs */
array r5wks (i) r5wks80-r5wks99 r5wks00 r5wks01 r5wks02 r5wks03; /* Round 5
created variable, all jbos */
array r5ewks (i) r5ewks80-r5ewks99 r5ewks00 r5ewks01 r5ewks02 r5ewks03 ; /*
Round 5 created variable, employee jobs */
array r5swks (i) r5swks80-r5swks99 r5swks00 r5swks01 r5swks02 r5swks03; /* Round
5 created variable, self-employed jobs */
array r6wks (i) r6wks80-r6wks99 r6wks00 r6wks01 r6wks02 r6wks03; /*number of
weeks worked in each year forall jobs);*/
array r6ewks (i)r6ewks80-r6ewks99 r6ewks00 r6ewks01 r6ewks02 r6ewks03; /*number
of weeks worked in each year for employ type jobs);*/
array r6swks (i)r6swks80-r6swks99 r6swks00 r6swks01 r6swks02 r6swks03; /*number
of weeks worked in each year self-employed .*/
array twks (i) twks80-twks99 twks00 twks01 twks02 twks03;/* Total created
variable, all jobs */
array tewks (i) tewks80-tewks99 tewks00 tewks01 tewks02 tewks03;/* Total created
variable, employee jobs */
array tswks (i) tswks80-tswks99 tswks00 tswks01 tswks02 tswks03;/* Total created
variable, self-employed jobs */
/* 4-16-04 Thes people backreported on a military job. The problem is that the
backreporting skips them into the
bottom calculation of the c.v.'s, so their "back5" is set back to "." */
array br (i) br1-br11;
array milflag (i) milflag1-milflag11;
do over br;
if br=1 and milflag=1 then do;
flagmi=1;
back5=.;
end;
end;
/* Begin by splitting up periods where Round5 the dli c.v. exclusively collect
weeks worked information. Define the dli
interview year as the split. By construction, any weeks worked information
collected before the dli interview week
should be independent of information collected in Round5. */
/* For the new Round 5 c.v.'s, we are assuming that all dli jobs are
employee-type jobs. Thus, dli information
will be added to the "all jobs" and "employee jobs" c.v.'s but not
"self-employed jobs" c.v.'s. */
do over r6wks;
twks=0;
tswks=0;
tewks=0;
if r6wks>0 then do;
twks=r6wks;
end;
if r6swks>0 then do;
tswks=r6swks;
end;
if r6ewks>0 then do;
tewks=r6ewks;
end;
/* 4-19-04 dli is Round 5 */
if r5wks>0 and dliwk=r5int then do;
twks=r5wks;
end;
if r5swks>0 and dliwk=r5int then do;
tswks=r5swks;
end;
if r5ewks>0 and dliwk=r5int then do;
tewks=r5ewks;
end;
if r5wks>0 and r6wks>0 and dliwk=r5int then do;
twks=r5wks+r6wks;
end;
if r5swks>0 and r6swks>0 and dliwk=r5int then do;
tswks=r5swks+r6swks;
end;
if r5ewks>0 and r6ewks>0 and dliwk=r5int then do;
tewks=r5ewks+r6ewks;
end;
/* dli is Round 4 */
if r4wks>0 and dliwk=r4int then do;
twks=r4wks;
end;
if r4swks>0 and dliwk=r4int then do;
tswks=r4swks;
end;
if r4ewks>0 and dliwk=r4int then do;
tewks=r4ewks;
end;
if r4wks>0 and r6wks>0 and dliwk=r4int then do;
twks=r4wks+r6wks;
end;
if r4swks>0 and r6swks>0 and dliwk=r4int then do;
tswks=r4swks+r6swks;
end;
if r4ewks>0 and r6ewks>0 and dliwk=r4int then do;
tewks=r4ewks+r6ewks;
end;
/* dli is Round 3 */
if r3wks>0 and dliwk=r3int then do;
twks=r3wks;
tewks=r3wks;
end;
if r3wks>0 and r6wks>0 and dliwk=r3int then do;
twks=r3wks+r6wks;
end;
if r3wks>0 and r6ewks>0 and dliwk=r3int then do;
tewks=r3wks+r6ewks;
end;
/* dli is Round 2 */
if r2wks>0 and dliwk=r2int then do;
twks=r2wks;
tewks=r2wks;
end;
if r2wks>0 and r6wks>0 and dliwk=r2int then do;
twks=r2wks+r6wks;
end;
if r2wks>0 and r6ewks>0 and dliwk=r2int then do;
tewks=r2wks+r6ewks;
end;
/* dli is Round 1 */
if r1wks>0 and dliwk=r1int then do;
twks=r1wks;
tewks=r1wks;
end;
if r1wks>0 and r6wks>0 and dliwk=r1int then do;
twks=r1wks+r6wks;
end;
if r1wks>0 and r6ewks>0 and dliwk=r1int then do;
tewks=r1wks+r6ewks;
end;
end;
/* This section is written for the backreporters. We load in the weeks array
from the Round 5 c.v.'s and
use it to update the corresponding Round 6 array. */
array alljobs (i) wks1-wks1252; /* form R6 status arrray xia.emp29_numwks*/
array selfjobs (i) swks1-swks1252; /* form R6 selfemp status
arrrayxia.emp29_numwks*/
array empjobs (i) ewks1-ewks1252; /* form R6 emp status arrrayxia.emp29_numwks*/
array r5ar (i) r5ar1-r5ar1252; /* R1-R5 xia.tnwksa weeks status arrray */
array r5sar (i) r5sar1-r5sar1252; /* R1-R5 xia.tnwksa weeks selfemp status
arrray */
array r5ear (i) r5ear1-r5ear1252; /* R1-R5 xia.tnwksa weeks emp status arrray */
if back1=1 or back2=1 or back3=1 or back4=1 then back5=1;
if back5=1 then do;
do over alljobs;
if r5ar=1 then do;
alljobs=r5ar;
end;
if r5ear=1 then do;
empjobs=r5ear;
end;
if r5ar=1 and r5sar=0 and r5ear=0 then do;
empjobs=r5ar;
end;
if r5sar=1 then do;
selfjobs=r5sar;
end;
if r5ar=-3 and alljobs=0 then do;
alljobs=r5ar;
end;
if r5ear=-3 and empjobs=0 and r5sar=0 then do;
empjobs=r5ar;
end;
end;
/* 1990 */
twks90=0;
tswks90=0;
tewks90=0;
do i=523 to 574;
if alljobs=1 then do;
twks90=twks90+1;
end;
if selfjobs=1 then do;
tswks90=tswks90+1;
end;
if empjobs=1 then do;
tewks90=tewks90+1;
end;
end;
do i=523 to 574;
if alljobs=-3 then do;
twks90=-3;
end;
if selfjobs=-3 then do;
tswks90=-3;
end;
if empjobs=-3 then do;
tewks90=-3;
end;
end;
/*repeat above code for 1991-2003*/
/*do i statements for each year are as follows:*/
/* 1991 */ do i=575 to 626;
/* 1992 */ do i=627 to 678;
/* 1993 */ do i=679 to 730;
/* 1994 */ do i=731 to 783;
/* 1995 */ do i=784 to 835;
/* 1996 */ do i=836 to 887;
/* 1997 */ do i=888 to 939;
/* 1998 */ do i=940 to 991;
/* 1999 */ do i=992 to 1043;
/* 2000 */ do i=1044 to 1096;
/* 2001 */ do i=1097 to 1148;
/* 2002 */ do i=1149 to 1200;
/* 2003 */ do i=1201 to 1252;
end;
/* If either created variable from Round 6 or dli is a -2 or -3, then the
overall created variable will be -2 or -3, respectively. */
do over r6wks;
if r6wks in (-1,-2,-3) then do;
twks=-3;
end;
if r6swks in (-1,-2,-3) then do;
tswks=-3;
end;
if r6ewks in (-1,-2,-3) then do;
tewks=-3;
end;
if r5wks in (-1,-2,-3) and dliwk=r5int then do;
twks=-3;
end;
if r5swks in (-1,-2,-3) and dliwk=r5int then do;
tswks=-3;
end;
if r5ewks in (-1,-2,-3) and dliwk=r5int then do;
tewks=-3;
end;
if r4wks in (-1,-2,-3) and dliwk=r4int then do;
twks=-3;
end;
if r4swks in (-1,-2,-3) and dliwk=r4int then do;
tswks=-3;
end;
if r4ewks in (-1,-2,-3) and dliwk=r4int then do;
tewks=-3;
end;
if r3wks in (-1,-2,-3) and dliwk=r3int then do;
twks=-3;
tewks=-3;
end;
if r2wks in (-1,-2,-3) and dliwk=r2int then do;
twks=-3;
tewks=-3;
end;
if r1wks in (-1,-2,-3) and dliwk=r1int then do;
twks=-3;
tewks=-3;
end;
end;
/* Round 6 non-interview cases */
do over twks;
if intwk=-5 then do;
twks=-5;
tswks=-5;
tewks=-5;
end;
end;
endsas;
Variables Created: CV_WKSWK_DLI_ALL
CV_WKSWK_DLI_ET
CV_WKSWK_DLI_SE
Programs Used
This program uses emp_begin.sas as input (follow hyperlink for details).
For each individual, this program counts the number of weeks the respondent worked since the last interview. Three variables are created: one for all jobs, one for employee-type jobs, and one for self-employed jobs. See the introduction to this appendix for important information about the universes for each of these variables. Respondents not working in a given year are given a default value of zero.
array job1wks (i) w1_1-w1_1253;
array job2wks (i) w2_1-w2_1253;
array job3wks (i) w3_1-w3_1253;
array job4wks (i) w4_1-w4_1253;
array job5wks (i) w5_1-w5_1253;
array job6wks (i) w6_1-w6_1253;
array job7wks (i) w7_1-w7_1253;
array job8wks (i) w8_1-w8_1253;
array job9wks (i) w9_1-w9_1253;
array job10wks (i) w10_1-w10_1253;
array job11wks (i) w11_1-w11_1253;
array alljobs (i) wks1-wks1253;
array selfjobs (i) swks1-swks1253;
array empjobs (i) ewks1-ewks1253;
array starw (i) starw01-starw11;
array stopw (i) stopw01-stopw11;
array self (i) self01-self11;
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;
/*At this point the program loops through the job2 code for jobs 3-11. Contact NLS User Services for details.*/
** 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 1253;
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 1253;
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 1253;
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 1253;
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 e200=-5 then do;
allwks=-5;
selfwks=-5;
empwks=-5;
end;
endsas;
Variables Created: CV_WKSWK_TEEN
CV_WKSWK_ADULT_ET
CV_WKSWK_ADULT_ALL
Programs Used
This program uses emp_begin.sas as input (follow hyperlink for details).
For each respondent, this program creates a variable counting the number of weeks worked at any employee-type job between the ages of 14 and 19. It then creates two variables counting weeks worked from age 20 to the present; one totals all jobs and one presents only employee jobs. See the introduction to this appendix for important information about the universes for each of these variables. Respondents not working are given a default value of zero; respondents who have not yet reached age 20 receive a valid skip (-4) on the latter two variables.
if
pubid=1461 then self03=0;
array job1wks (i) w1_1-w1_1253;
array job2wks (i) w2_1-w2_1253;
array job3wks (i) w3_1-w3_1253;
array job4wks (i) w4_1-w4_1253;
array job5wks (i) w5_1-w5_1253;
array job6wks (i) w6_1-w6_1253;
array job7wks (i) w7_1-w7_1253;
array job8wks (i) w8_1-w8_1253;
array job9wks (i) w9_1-w9_1253;
array job10wks (i) w10_1-w10_1253;
array job11wks (i) w11_1-w11_1253;
array alljobs (i) wks1-wks1253;
array empjobs (i) ewks1-ewks1253;
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;
/*repeat job 2 code for jobs 3-11*/
*********************************************************
** Calculate cumulative weeks on all jobs since age 14 **
*********************************************************;
r6emp14=0;
r6wks14=0;
r6emp20=0;
r6wks20=0;
/* The min. of age14wk (age20wk) is 731 (1044). The max. of age14wk (age20wk) is
992 (1305).
All values of age14wk (age20wk) are positive. */
/* r6wks14 */
if age14wk>0 and (age20wk-1)<=1253 then do;
do i=age14wk to (age20wk-1);
if alljobs=1 then do;
r6wks14=r6wks14+1;
end;
end;
do i=age14wk to (age20wk-1);
if alljobs=-3 then do;
r6wks14=-3;
end;
end;
end;
if age14wk>0 and (age20wk-1)>1253 then do;
do i=age14wk to 1253;
if alljobs=1 then do;
r6wks14=r6wks14+1;
end;
end;
do i=age14wk to 1253;
if alljobs=-3 then do;
r6wks14=-3;
end;
end;
end;
/* r6emp14 */
if age14wk>0 and (age20wk-1)<=1253 then do;
do i=age14wk to (age20wk-1);
if empjobs=1 then do;
r6emp14=r6emp14+1;
end;
end;
do i=age14wk to (age20wk-1);
if empjobs=-3 then do;
r6emp14=-3;
end;
end;
end;
if age14wk>0 and (age20wk-1)>1253 then do;
do i=age14wk to 1253;
if empjobs=1 then do;
r6emp14=r6emp14+1;
end;
end;
do i=age14wk to 1253;
if empjobs=-3 then do;
r6emp14=-3;
end;
end;
end;
/* r6wks20 */
if age14wk>0 and age20wk<=1253 then do;
do i=age20wk to 1253;
if alljobs=1 then do;
r6wks20=r6wks20+1;
end;
end;
do i=age20wk to 1253;
if alljobs=-3 then do;
r6wks20=-3;
end;
end;
end;
/* r6emp20 */
if age14wk>0 and age20wk<=1253 then do;
do i=age20wk to 1253;
if empjobs=1 then do;
r6emp20=r6emp20+1;
end;
end;
do i=age20wk to 1253;
if empjobs=-3 then do;
r6emp20=-3;
end;
end;
end;
*** Include valid skips;
if e200=-5 then do;
r6wks14=-5;
r6emp14=-5;
r6wks20=-5;
r6emp20=-5;
end;
* define all the back reporters, for whom we will go back to the round 1 to
round 5 combined arrays;
if back1=1 or back2=1 or back3=1 or back4=1 or back5=1 then back=1;
* For the back reporters who back report on a military job, we don't need to go
back to the round 1 to round 5 combined array;
array br (i) br01-br11;
array milflag (i) milflag01-milflag11;
do over br;
if br=1 and milflag=1 then back=. ;
end;
* 21 cases. printout of these cases show no other back reported jobs besides the
military job;
* Initialize the created variables to zero;
temp14=0;
twks20=0;
temp20=0;
/* Merge the round 6 created array with round 1 to round 5 combined arrays */
array alljobs (i) wks1-wks1253;
array empjobs (i) ewks1-ewks1253;
array r5arr (i) r5ar1-r5ar1253;
array r5ear (i) r5ear1-r5ear1253;
* the interview date before r4 interview date;
if r3int ne -5 then r123int=r3int;
if r3int=-5 and r2int ne -5 then r123int=r2int;
if r3int=-5 and r2int=-5 then r123int=r1int;
* "wks" array;
do over alljobs;
if r5arr=1 then do;
alljobs=r5arr;
end;
if r5arr=-3 and alljobs=0 then do;
alljobs=r5arr;
end;
end;
* "ewks" array, the "wks" array in rounds 1-3 are for only employee type jobs;
do i=1 to r123int-1;
if r5arr=1 then do;
empjobs=r5arr;
end;
if r5arr=-3 and empjobs=0 then do;
empjobs=r5arr;
end;
end;
do i=r123int to 1253;
if r5ear=1 then do;
empjobs=r5ear;
end;
if r5ear=-3 and empjobs=0 then do;
empjobs=r5ear;
end;
end;
* the created variable using the combined array;
if age14wk>0 and (age20wk-1)<=1253 then do;
do i=age14wk to (age20wk-1);
if empjobs=1 then do;
temp14=temp14+1;
end;
end;
do i=age14wk to (age20wk-1);
if empjobs=-3 then do;
temp14=-3;
end;
end;
end;
if age14wk>0 and age20wk<=1253 then do;
do i=age20wk to 1253;
if alljobs=1 then do;
twks20=twks20+1;
end;
end;
do i=age20wk to 1253;
if alljobs=-3 then do;
twks20=-3;
end;
end;
end;
if age14wk>0 and age20wk<=1253 then do;
do i=age20wk to 1253;
if empjobs=1 then do;
temp20=temp20+1;
end;
end;
do i=age20wk to 1253;
if empjobs=-3 then do;
temp20=-3;
end;
end;
end;
/* People who are under 20 */
if age14wk>0 and (age20wk-1)>1253 then do;
do i=age14wk to 1253;
if empjobs=1 then do;
temp14=temp14+1;
end;
end;
do i=age14wk to 1253;
if empjobs=-3 then do;
temp14=-3;
end;
end;
end;
* For those who are not interviewed;
if e200=-5 then do;
temp14=-5;
twks20=-5;
temp20=-5;
end;
*For respondents younger than 20 at interview date, their c.v. will be -4;
if age20wk>intwk and intwk ne -5 then do;
twks20=-4;
temp20=-4;
end;
endsas;
Variables Created:
CV_WKSWK_JOB_YR.01.xx-CV_WKSWK_JOB_YR.11.xx
Programs Used
This program uses emp_begin.sas as input (follow hyperlink for details).
This program creates variables for each of the respondent's jobs counting the number of weeks worked in each calendar year. 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). The most jobs held by any respondent in round 5 was eight, so variables are created for eight jobs for each respondent.
array job1wks (i) w1_1-w1_1253;
array job2wks (i) w2_1-w2_1253;
array job3wks (i) w3_1-w3_1253;
array job4wks (i) w4_1-w4_1253;
array job5wks (i) w5_1-w5_1253;
array job6wks (i) w6_1-w6_1253;
array job7wks (i) w7_1-w7_1253;
array job8wks (i) w8_1-w8_1253;
array job9wks (i) w9_1-w9_1253;
array job10wks (i) w10_1-w10_1253;
array job11wks (i) w11_1-w11_1253;
array starw (i) starw01-starw11;
array stopw (i) stopw01-stopw11;
array starfl (i) starf_1-starf_11;
array stopfl (i) stopf_1-stopf_11;
array smof (i) smof01-smof11;
array emof (i) emof01-emof11;
array stary (i) stary01-stary11;
array stopy (i) stopy01-stopy11;
array r6wks80 (i) r6w80_1-r6w80_11;
array r6wks81 (i) r6w81_1-r6w81_11;
array r6wks82 (i) r6w82_1-r6w82_11;
array r6wks83 (i) r6w83_1-r6w83_11;
array r6wks84 (i) r6w84_1-r6w84_11;
array r6wks85 (i) r6w85_1-r6w85_11;
array r6wks86 (i) r6w86_1-r6w86_11;
array r6wks87 (i) r6w87_1-r6w87_11;
array r6wks88 (i) r6w88_1-r6w88_11;
array r6wks89 (i) r6w89_1-r6w89_11;
array r6wks90 (i) r6w90_1-r6w90_11;
array r6wks91 (i) r6w91_1-r6w91_11;
array r6wks92 (i) r6w92_1-r6w92_11;
array r6wks93 (i) r6w93_1-r6w93_11;
array r6wks94 (i) r6w94_1-r6w94_11;
array r6wks95 (i) r6w95_1-r6w95_11;
array r6wks96 (i) r6w96_1-r6w96_11;
array r6wks97 (i) r6w97_1-r6w97_11;
array r6wks98 (i) r6w98_1-r6w98_11;
array r6wks99 (i) r6w99_1-r6w99_11;
array r6wks00 (i) r6w00_1-r6w00_11;
array r6wks01 (i) r6w01_1-r6w01_11;
array r6wks02 (i) r6w02_1-r6w02_11;
array r6wks03 (i) r6w03_1-r6w03_11;
*****************************************************************
** Calculate cumulative weeks on individual jobs for each year **
*****************************************************************;
/* 1980 */
do over r6wks80;
r6wks80=0;
end;
do i=1 to 52;
if job1wks=1 then do;
r6w80_1=r6w80_1+1;
end;
if job2wks=1 then do;
r6w80_2=r6w80_2+1;
end;
if job3wks=1 then do;
r6w80_3=r6w80_3+1;
end;
if job4wks=1 then do;
r6w80_4=r6w80_4+1;
end;
if job5wks=1 then do;
r6w80_5=r6w80_5+1;
end;
if job6wks=1 then do;
r6w80_6=r6w80_6+1;
end;
if job7wks=1 then do;
r6w80_7=r6w80_7+1;
end;
if job8wks=1 then do;
r6w80_8=r6w80_8+1;
end;
if job9wks=1 then do;
r6w80_9=r6w80_9+1;
end;
if job10wks=1 then do;
r6w80_10=r6w80_10+1;
end;
if job11wks=1 then do;
r6w80_11=r6w80_11+1;
end;
end;
do i=1 to 52;
if job1wks=-3 then do;
r6w80_1=-3;
end;
if job2wks=-3 then do;
r6w80_2=-3;
end;
if job3wks=-3 then do;
r6w80_3=-3;
end;
if job4wks=-3 then do;
r6w80_4=-3;
end;
if job5wks=-3 then do;
r6w80_5=-3;
end;
if job6wks=-3 then do;
r6w80_6=-3;
end;
if job7wks=-3 then do;
r6w80_7=-3;
end;
if job8wks=-3 then do;
r6w80_8=-3;
end;
if job9wks=-3 then do;
r6w80_9=-3;
end;
if job10wks=-3 then do;
r6w80_10=-3;
end;
if job11wks=-3 then do;
r6w80_11=-3;
end;
end;
/*repeat above code for 1981-2003*/
/*the week numbers for the do i statements are as follows*/
/* 1981 */ do i=53 to 104;
/* 1982 */ do i=105 to 156;
/* 1983 */ do i=157 to 209;
/* 1984 */ do i=210 to 261;
/* 1985 */ do i=262 to 313;
/* 1986 */ do i=314 to 365;
/* 1987 */ do i=366 to 417;
/* 1988 */ do i=418 to 470;
/* 1989 */ do i=471 to 522;
/* 1990 */ do i=523 to 574;
/* 1991 */ do i=575 to 626;
/* 1992 */ do i=627 to 678;
/* 1993 */ do i=679 to 730;
/* 1994 */ do i=731 to 783;
/* 1995 */ do i=784 to 835;
/* 1996 */ do i=836 to 887;
/* 1997 */ do i=888 to 939;
/* 1998 */ do i=940 to 991;
/* 1999 */ do i=992 to 1043;
/* 2000 */ do i=1044 to 1096;
/* 2001 */ do i=1097 to 1148;
/* 2002 */ do i=1149 to 1200;
/* 2003 */ do i=1201 to 1252;
do i=1 to 11;
if e200=-5 then do;
r6wks80=-5; r6wks92=-5;
r6wks81=-5; r6wks93=-5;
r6wks82=-5; r6wks94=-5;
r6wks83=-5; r6wks95=-5;
r6wks84=-5; r6wks96=-5;
r6wks85=-5; r6wks97=-5;
r6wks86=-5; r6wks98=-5;
r6wks87=-5; r6wks99=-5;
r6wks88=-5; r6wks00=-5;
r6wks89=-5; r6wks01=-5;
r6wks90=-5; r6wks02=-5;
r6wks91=-5; r6wks03=-5;
end;
end;
* define arrays;
array r6uid (i) uid01-uid11;
/* Arrange the jobs by year for Round 6 */
array r6wks80 (i) r6w80_1-r6w80_11;
array r6wks81 (i) r6w81_1-r6w81_11;
array r6wks82 (i) r6w82_1-r6w82_11;
array r6wks83 (i) r6w83_1-r6w83_11;
array r6wks84 (i) r6w84_1-r6w84_11;
array r6wks85 (i) r6w85_1-r6w85_11;
array r6wks86 (i) r6w86_1-r6w86_11;
array r6wks87 (i) r6w87_1-r6w87_11;
array r6wks88 (i) r6w88_1-r6w88_11;
array r6wks89 (i) r6w89_1-r6w89_11;
array r6wks90 (i) r6w90_1-r6w90_11;
array r6wks91 (i) r6w91_1-r6w91_11;
array r6wks92 (i) r6w92_1-r6w92_11;
array r6wks93 (i) r6w93_1-r6w93_11;
array r6wks94 (i) r6w94_1-r6w94_11;
array r6wks95 (i) r6w95_1-r6w95_11;
array r6wks96 (i) r6w96_1-r6w96_11;
array r6wks97 (i) r6w97_1-r6w97_11;
array r6wks98 (i) r6w98_1-r6w98_11;
array r6wks99 (i) r6w99_1-r6w99_11;
array r6wks00 (i) r6w00_1-r6w00_11;
array r6wks01 (i) r6w01_1-r6w01_11;
array r6wks02 (i) r6w02_1-r6w02_11;
array r6wks03 (i) r6w03_1-r6w03_11;
/* Arrange the jobs by year for total c.v. */
array twks80 (i) twk80_1-twk80_11;
array twks81 (i) twk81_1-twk81_11;
array twks82 (i) twk82_1-twk82_11;
array twks83 (i) twk83_1-twk83_11;
array twks84 (i) twk84_1-twk84_11;
array twks85 (i) twk85_1-twk85_11;
array twks86 (i) twk86_1-twk86_11;
array twks87 (i) twk87_1-twk87_11;
array twks88 (i) twk88_1-twk88_11;
array twks89 (i) twk89_1-twk89_11;
array twks90 (i) twk90_1-twk90_11;
array twks91 (i) twk91_1-twk91_11;
array twks92 (i) twk92_1-twk92_11;
array twks93 (i) twk93_1-twk93_11;
array twks94 (i) twk94_1-twk94_11;
array twks95 (i) twk95_1-twk95_11;
array twks96 (i) twk96_1-twk96_11;
array twks97 (i) twk97_1-twk97_11;
array twks98 (i) twk98_1-twk98_11;
array twks99 (i) twk99_1-twk99_11;
array twks00 (i) twk00_1-twk00_11;
array twks01 (i) twk01_1-twk01_11;
array twks02 (i) twk02_1-twk02_11;
array twks03 (i) twk03_1-twk03_11;
/* Initialize total weeks count to zero */
do i=1 to 11;
twks80=0; twks81=0; twks82=0; twks83=0; twks84=0; twks85=0; twks86=0; twks87=0;
twks88=0; twks89=0; twks90=0; twks91=0;
twks92=0; twks93=0; twks94=0; twks95=0; twks96=0; twks97=0; twks98=0; twks99=0;
twks00=0; twks01=0; twks02=0; twks03=0;
end;
/* Accounts for non-interview cases */
do i=1 to 11;
if e200=-5 then do;
twks80=-5; twks81=-5; twks82=-5; twks83=-5; twks84=-5; twks85=-5; twks86=-5;
twks87=-5; twks88=-5; twks89=-5;
twks90=-5; twks91=-5; twks92=-5; twks93=-5; twks94=-5; twks95=-5; twks96=-5;
twks97=-5; twks98=-5; twks99=-5;
twks00=-5; twks01=-5; twks02=-5; twks03=-5;
end;
end;
/* Initialize the "total" variables by the round 6 created variables */
/* 1980 */
do i=1 to 11;
if r6wks80=>0 then do;
twks80=r6wks80;
end;
if -4<r6wks80<0 then do;
twks80=-3;
end;
end;
/* 1981 */
do i=1 to 11;
if r6wks81=>0 then do;
twks81=r6wks81;
end;
if -4<r6wks81<0 then do;
twks81=-3;
end;
end;
/* and so on through */
/* 2003 */
do i=1 to 11;
if -4<r6wks03<0 then do;
twks03=-3;
end;
if r6wks03>0 then do;
twks03=r6wks03;
end;
end;
/* When matching jobs from a dli Round to Round 6, we only need to worry about
jobs in Round 6 with a UID not
beginning with "2002" since only those jobs that could have been worked in both
rounds. */
array match1 (i) mat1_1-mat1_11;
array match2 (i) mat2_1-mat2_11;
array match3 (i) mat3_1-mat3_11;
array match4 (i) mat4_1-mat4_11;
array match5 (i) mat5_1-mat5_11;
array match6 (i) mat6_1-mat6_11;
array match7 (i) mat7_1-mat7_11;
array match8 (i) mat8_1-mat8_11;
array match9 (i) mat9_1-mat9_11;
do i=1 to 11;
match1=0; match2=0; match3=0; match4=0; match5=0; match6=0; match7=0; match8=0;
match9=0;
end;
/* Define "mat1_4" as the dummy variable that equals 1 when the first job in the
last round and the fourth job in the
current round Roster have the same UID. */
do over r6uid; /* If UID from the first position in dli Round matches with any
UID in Round 6 */
if r5uid1>0 and r6uid>0 and r5int>0 and intwk>0 then do;
if r5uid1=r6uid then do;
match1=1;
end;
end;
if r4uid1>0 and r6uid>0 and r4int>0 and r5int=-5 and intwk>0 then do;
if r4uid1=r6uid then do;
match1=1;
end;
end;
if r3uid1>0 and r6uid>0 and r3int>0 and r4int=-5 and r5int=-5 and intwk>0 then
do;
if r3uid1=r6uid then do;
match1=1;
end;
end;
if r2uid1>0 and r6uid>0 and r2int>0 and r3int=-5 and r4int=-5 and r5int=-5 and
intwk>0 then do;
if r2uid1=r6uid then do;
match1=1;
end;
end;
if r1uid1>0 and r6uid>0 and r1int>0 and r2int=-5 and r3int=-5 and r4int=-5 and
r5int=-5 and intwk>0 then do;
if r1uid1=r6uid then do;
match1=1;
end;
end;
end;
do over r6uid; /* If UID from the second position in dli Round matches with any
UID in Round 6 */
if r5uid2>0 and r6uid>0 and r5int>0 and intwk>0 then do;
if r5uid2=r6uid then do;
match2=1;
end;
end;
if r4uid2>0 and r6uid>0 and r4int>0 and r5int=-5 and intwk>0 then do;
if r4uid2=r6uid then do;
match2=1;
end;
end;
if r3uid2>0 and r6uid>0 and r3int>0 and r4int=-5 and r5int=-5 and intwk>0 then
do;
if r3uid2=r6uid then do;
match2=1;
end;
end;
if r2uid2>0 and r6uid>0 and r2int>0 and r3int=-5 and r4int=-5 and r5int=-5 and
intwk>0 then do;
if r2uid2=r6uid then do;
match2=1;
end;
end;
if r1uid2>0 and r6uid>0 and r1int>0 and r2int=-5 and r3int=-5 and r4int=-5 and
r5int=-5 and intwk>0 then do;
if r1uid2=r6uid then do;
match2=1;
end;
end;
end;
/* and so on through */
do over r6uid; /* If UID from the 9th position in dli Round matches with any UID
in Round 6 */
if r5uid9>0 and r6uid>0 and r5int>0 and intwk>0 then do;
if r5uid9=r6uid then do;
match9=1;
end;
end;
if r4uid9>0 and r6uid>0 and r4int>0 and r5int=-5 and intwk>0 then do;
if r4uid9=r6uid then do;
match9=1;
end;
end;
if r3uid9>0 and r6uid>0 and r3int>0 and r4int=-5 and r5int=-5 and intwk>0 then
do;
if r3uid9=r6uid then do;
match9=1;
end;
end;
if r2uid9>0 and r6uid>0 and r2int>0 and r3int=-5 and r4int=-5 and r5int=-5 and
intwk>0 then do;
if r2uid9=r6uid then do;
match9=1;
end;
end;
if r1uid9>0 and r6uid>0 and r1int>0 and r2int=-5 and r3int=-5 and r4int=-5 and
r5int=-5 and intwk>0 then do;
if r1uid9=r6uid then do;
match9=1;
end;
end;
end;
/* Now reassign total created variable if there is an identical job was worked
in both rounds. Using the match variable,
a job worked in both rounds will update the total created variable. Need to add
positivity condition on the weeks
worked values since some of the values equal -3. */
/* For respondents last interviewed in Round 5, 2002 */
if r5int_y=2002 then do;
do over match1;
if match1=1 then do;
if r5wks801 not in (-5,-4,0,.) then twks80=r5wks801; if r5wks891 not in
(-5,-4,0,.) then twks89=r5wks891;
if r5wks811 not in (-5,-4,0,.) then twks81=r5wks811; if r5wks901 not in
(-5,-4,0,.) then twks90=r5wks901;
if r5wks821 not in (-5,-4,0,.) then twks82=r5wks821; if r5wks911 not in
(-5,-4,0,.) then twks91=r5wks911;
if r5wks831 not in (-5,-4,0,.) then twks83=r5wks831; if r5wks921 not in
(-5,-4,0,.) then twks92=r5wks921;
if r5wks841 not in (-5,-4,0,.) then twks84=r5wks841; if r5wks931 not in
(-5,-4,0,.) then twks93=r5wks931;
if r5wks851 not in (-5,-4,0,.) then twks85=r5wks851; if r5wks941 not in
(-5,-4,0,.) then twks94=r5wks941;
if r5wks861 not in (-5,-4,0,.) then twks86=r5wks861; if r5wks951 not in
(-5,-4,0,.) then twks95=r5wks951;
if r5wks871 not in (-5,-4,0,.) then twks87=r5wks871; if r5wks961 not in
(-5,-4,0,.) then twks96=r5wks961;
if r5wks881 not in (-5,-4,0,.) then twks88=r5wks881; if r5wks971 not in
(-5,-4,0,.) then twks97=r5wks971;
if r5wks981 not in (-5,-4,0,.) then twks98=r5wks981;
if r5wks991 not in (-5,-4,0,.) then twks99=r5wks991;
if r5wks001 not in (-5,-4,0,.) then twks00=r5wks001;
if r5wks011 not in (-5,-4,0,.) then twks01=r5wks011;
end;
end;
do over match1;
if match1=1 and r6wks02=>0 and r5wks021=>0 then do;
twks02=r5wks021+r6wks02;
end;
if match1=1 and (-4<r6wks02<0 or -4<r5wks021<0) then do;
twks02=-3;
end;
end;
do over match2;
if match2=1 then do;
if r5wks802 not in (-5,-4,0,.) then twks80=r5wks802; if r5wks892 not in
(-5,-4,0,.) then twks89=r5wks892;
if r5wks812 not in (-5,-4,0,.) then twks81=r5wks812; if r5wks902 not in
(-5,-4,0,.) then twks90=r5wks902;
if r5wks822 not in (-5,-4,0,.) then twks82=r5wks822; if r5wks912 not in
(-5,-4,0,.) then twks91=r5wks912;
if r5wks832 not in (-5,-4,0,.) then twks83=r5wks832; if r5wks922 not in
(-5,-4,0,.) then twks92=r5wks922;
if r5wks842 not in (-5,-4,0,.) then twks84=r5wks842; if r5wks932 not in
(-5,-4,0,.) then twks93=r5wks932;
if r5wks852 not in (-5,-4,0,.) then twks85=r5wks852; if r5wks942 not in
(-5,-4,0,.) then twks94=r5wks942;
if r5wks862 not in (-5,-4,0,.) then twks86=r5wks862; if r5wks952 not in
(-5,-4,0,.) then twks95=r5wks952;
if r5wks872 not in (-5,-4,0,.) then twks87=r5wks872; if r5wks962 not in
(-5,-4,0,.) then twks96=r5wks962;
if r5wks882 not in (-5,-4,0,.) then twks88=r5wks882; if r5wks972 not in
(-5,-4,0,.) then twks97=r5wks972;
if r5wks982 not in (-5,-4,0,.) then twks98=r5wks982;
if r5wks992 not in (-5,-4,0,.) then twks99=r5wks992;
if r5wks002 not in (-5,-4,0,.) then twks00=r5wks002;
if r5wks012 not in (-5,-4,0,.) then twks01=r5wks012;
end;
end;
do over match2;
if match2=1 and r6wks02=>0 and r5wks022=>0 then do;
twks02=r5wks022+r6wks02;
end;
if match2=1 and (-4<r6wks02<0 or -4<r5wks022<0) then do;
twks02=-3;
end;
end;
/* and so on through */
do over match9;
if match9=1 then do;
if r5wks809 not in (-5,-4,0,.) then twks80=r5wks809; if r5wks899 not in
(-5,-4,0,.) then twks89=r5wks899;
if r5wks819 not in (-5,-4,0,.) then twks81=r5wks819; if r5wks909 not in
(-5,-4,0,.) then twks90=r5wks909;
if r5wks829 not in (-5,-4,0,.) then twks82=r5wks829; if r5wks919 not in
(-5,-4,0,.) then twks91=r5wks919;
if r5wks839 not in (-5,-4,0,.) then twks83=r5wks839; if r5wks929 not in
(-5,-4,0,.) then twks92=r5wks929;
if r5wks849 not in (-5,-4,0,.) then twks84=r5wks849; if r5wks939 not in
(-5,-4,0,.) then twks93=r5wks939;
if r5wks859 not in (-5,-4,0,.) then twks85=r5wks859; if r5wks949 not in
(-5,-4,0,.) then twks94=r5wks949;
if r5wks869 not in (-5,-4,0,.) then twks86=r5wks869; if r5wks959 not in
(-5,-4,0,.) then twks95=r5wks959;
if r5wks879 not in (-5,-4,0,.) then twks87=r5wks879; if r5wks969 not in
(-5,-4,0,.) then twks96=r5wks969;
if r5wks889 not in (-5,-4,0,.) then twks88=r5wks889; if r5wks979 not in
(-5,-4,0,.) then twks97=r5wks979;
if r5wks989 not in (-5,-4,0,.) then twks98=r5wks989;
if r5wks999 not in (-5,-4,0,.) then twks99=r5wks999;
if r5wks009 not in (-5,-4,0,.) then twks00=r5wks009;
if r5wks019 not in (-5,-4,0,.) then twks01=r5wks019;
end;
end;
do over match9;
if match9=1 and r6wks02=>0 and r5wks029=>0 then do;
twks02=r5wks029+r6wks02;
end;
if match9=1 and (-4<r6wks02<0 or -4<r5wks029<0) then do;
twks02=-3;
end;
end;
end;
/* For respondents last interviewed in Round 5, 2001 */
if r5int_y=2001 then do;
do over match1;
if match1=1 then do;
if r5wks801 not in (-5,-4,0,.) then twks80=r5wks801; if r5wks891 not in
(-5,-4,0,.) then twks89=r5wks891;
if r5wks811 not in (-5,-4,0,.) then twks81=r5wks811; if r5wks901 not in
(-5,-4,0,.) then twks90=r5wks901;
if r5wks821 not in (-5,-4,0,.) then twks82=r5wks821; if r5wks911 not in
(-5,-4,0,.) then twks91=r5wks911;
if r5wks831 not in (-5,-4,0,.) then twks83=r5wks831; if r5wks921 not in
(-5,-4,0,.) then twks92=r5wks921;
if r5wks841 not in (-5,-4,0,.) then twks84=r5wks841; if r5wks931 not in
(-5,-4,0,.) then twks93=r5wks931;
if r5wks851 not in (-5,-4,0,.) then twks85=r5wks851; if r5wks941 not in
(-5,-4,0,.) then twks94=r5wks941;
if r5wks861 not in (-5,-4,0,.) then twks86=r5wks861; if r5wks951 not in
(-5,-4,0,.) then twks95=r5wks951;
if r5wks871 not in (-5,-4,0,.) then twks87=r5wks871; if r5wks961 not in
(-5,-4,0,.) then twks96=r5wks961;
if r5wks881 not in (-5,-4,0,.) then twks88=r5wks881; if r5wks971 not in
(-5,-4,0,.) then twks97=r5wks971;
if r5wks981 not in (-5,-4,0,.) then twks98=r5wks981;
if r5wks991 not in (-5,-4,0,.) then twks99=r5wks991;
if r5wks001 not in (-5,-4,0,.) then twks00=r5wks001;
end;
end;
do over match1;
if match1=1 and r6wks01=>0 and r5wks011=>0 then do;
twks01=r5wks011+r6wks01;
end;
if match1=1 and (-4<r6wks01<0 or -4<r5wks011<0) then do;
twks01=-3;
end;
end;
do over match2;
if match2=1 then do;
if r5wks802 not in (-5,-4,0,.) then twks80=r5wks802; if r5wks892 not in
(-5,-4,0,.) then twks89=r5wks892;
if r5wks812 not in (-5,-4,0,.) then twks81=r5wks812; if r5wks902 not in
(-5,-4,0,.) then twks90=r5wks902;
if r5wks822 not in (-5,-4,0,.) then twks82=r5wks822; if r5wks912 not in
(-5,-4,0,.) then twks91=r5wks912;
if r5wks832 not in (-5,-4,0,.) then twks83=r5wks832; if r5wks922 not in
(-5,-4,0,.) then twks92=r5wks922;
if r5wks842 not in (-5,-4,0,.) then twks84=r5wks842; if r5wks932 not in
(-5,-4,0,.) then twks93=r5wks932;
if r5wks852 not in (-5,-4,0,.) then twks85=r5wks852; if r5wks942 not in
(-5,-4,0,.) then twks94=r5wks942;
if r5wks862 not in (-5,-4,0,.) then twks86=r5wks862; if r5wks952 not in
(-5,-4,0,.) then twks95=r5wks952;
if r5wks872 not in (-5,-4,0,.) then twks87=r5wks872; if r5wks962 not in
(-5,-4,0,.) then twks96=r5wks962;
if r5wks882 not in (-5,-4,0,.) then twks88=r5wks882; if r5wks972 not in
(-5,-4,0,.) then twks97=r5wks972;
if r5wks982 not in (-5,-4,0,.) then twks98=r5wks982;
if r5wks992 not in (-5,-4,0,.) then twks99=r5wks992;
if r5wks002 not in (-5,-4,0,.) then twks00=r5wks002;
end;
end;
do over match2;
if match2=1 and r6wks01=>0 and r5wks012=>0 then do;
twks01=r5wks012+r6wks01;
end;
if match2=1 and (-4<r6wks01<0 or -4<r5wks012<0) then do;
twks01=-3;
end;
end;
/* and so on through */
do over match9;
if match9=1 then do;
if r5wks809 not in (-5,-4,0,.) then twks80=r5wks809; if r5wks899 not in
(-5,-4,0,.) then twks89=r5wks899;
if r5wks819 not in (-5,-4,0,.) then twks81=r5wks819; if r5wks909 not in
(-5,-4,0,.) then twks90=r5wks909;
if r5wks829 not in (-5,-4,0,.) then twks82=r5wks829; if r5wks919 not in
(-5,-4,0,.) then twks91=r5wks919;
if r5wks839 not in (-5,-4,0,.) then twks83=r5wks839; if r5wks929 not in
(-5,-4,0,.) then twks92=r5wks929;
if r5wks849 not in (-5,-4,0,.) then twks84=r5wks849; if r5wks939 not in
(-5,-4,0,.) then twks93=r5wks939;
if r5wks859 not in (-5,-4,0,.) then twks85=r5wks859; if r5wks949 not in
(-5,-4,0,.) then twks94=r5wks949;
if r5wks869 not in (-5,-4,0,.) then twks86=r5wks869; if r5wks959 not in
(-5,-4,0,.) then twks95=r5wks959;
if r5wks879 not in (-5,-4,0,.) then twks87=r5wks879; if r5wks969 not in
(-5,-4,0,.) then twks96=r5wks969;
if r5wks889 not in (-5,-4,0,.) then twks88=r5wks889; if r5wks979 not in
(-5,-4,0,.) then twks97=r5wks979;
if r5wks989 not in (-5,-4,0,.) then twks98=r5wks989;
if r5wks999 not in (-5,-4,0,.) then twks99=r5wks999;
if r5wks009 not in (-5,-4,0,.) then twks00=r5wks009;
end;
end;
do over match9;
if match9=1 and r6wks01=>0 and r5wks019=>0 then do;
twks01=r5wks019+r6wks01;
end;
if match9=1 and (-4<r6wks01<0 or -4<r5wks019<0) then do;
twks01=-3;
end;
end;
end;
/* For respondents last interviewed in Round 4, 2001 */
if r5int=-5 and r4int_y=2001 then do;
do over match1;
if match1=1 then do;
if r4wks801 not in (-5,-4,0,.) then twks80=r4wks801; if r4wks891 not in
(-5,-4,0,.) then twks89=r4wks891;
if r4wks811 not in (-5,-4,0,.) then twks81=r4wks811; if r4wks901 not in
(-5,-4,0,.) then twks90=r4wks901;
if r4wks821 not in (-5,-4,0,.) then twks82=r4wks821; if r4wks911 not in
(-5,-4,0,.) then twks91=r4wks911;
if r4wks831 not in (-5,-4,0,.) then twks83=r4wks831; if r4wks921 not in
(-5,-4,0,.) then twks92=r4wks921;
if r4wks841 not in (-5,-4,0,.) then twks84=r4wks841; if r4wks931 not in
(-5,-4,0,.) then twks93=r4wks931;
if r4wks851 not in (-5,-4,0,.) then twks85=r4wks851; if r4wks941 not in
(-5,-4,0,.) then twks94=r4wks941;
if r4wks861 not in (-5,-4,0,.) then twks86=r4wks861; if r4wks951 not in
(-5,-4,0,.) then twks95=r4wks951;
if r4wks871 not in (-5,-4,0,.) then twks87=r4wks871; if r4wks961 not in
(-5,-4,0,.) then twks96=r4wks961;
if r4wks881 not in (-5,-4,0,.) then twks88=r4wks881; if r4wks971 not in
(-5,-4,0,.) then twks97=r4wks971;
if r4wks981 not in (-5,-4,0,.) then twks98=r4wks981;
if r4wks991 not in (-5,-4,0,.) then twks99=r4wks991;
if r4wks001 not in (-5,-4,0,.) then twks00=r4wks001;
end;
end;
do over match1;
if match1=1 and r6wks01=>0 and r4wks011=>0 then do;
twks01=r4wks011+r6wks01;
end;
if match1=1 and (-4<r6wks01<0 or -4<r4wks011<0) then do;
twks01=-3;
end;
end;
do over match2;
if match2=1 then do;
if r4wks802 not in (-5,-4,0,.) then twks80=r4wks802; if r4wks892 not in
(-5,-4,0,.) then twks89=r4wks892;
if r4wks812 not in (-5,-4,0,.) then twks81=r4wks812; if r4wks902 not in
(-5,-4,0,.) then twks90=r4wks902;
if r4wks822 not in (-5,-4,0,.) then twks82=r4wks822; if r4wks912 not in
(-5,-4,0,.) then twks91=r4wks912;
if r4wks832 not in (-5,-4,0,.) then twks83=r4wks832; if r4wks922 not in
(-5,-4,0,.) then twks92=r4wks922;
if r4wks842 not in (-5,-4,0,.) then twks84=r4wks842; if r4wks932 not in
(-5,-4,0,.) then twks93=r4wks932;
if r4wks852 not in (-5,-4,0,.) then twks85=r4wks852; if r4wks942 not in
(-5,-4,0,.) then twks94=r4wks942;
if r4wks862 not in (-5,-4,0,.) then twks86=r4wks862; if r4wks952 not in
(-5,-4,0,.) then twks95=r4wks952;
if r4wks872 not in (-5,-4,0,.) then twks87=r4wks872; if r4wks962 not in
(-5,-4,0,.) then twks96=r4wks962;
if r4wks882 not in (-5,-4,0,.) then twks88=r4wks882; if r4wks972 not in
(-5,-4,0,.) then twks97=r4wks972;
if r4wks982 not in (-5,-4,0,.) then twks98=r4wks982;
if r4wks992 not in (-5,-4,0,.) then twks99=r4wks992;
if r4wks002 not in (-5,-4,0,.) then twks00=r4wks002;
end;
end;
do over match2;
if match2=1 and r6wks01=>0 and r4wks012=>0 then do;
twks01=r4wks012+r6wks01;
end;
if match2=1 and (-4<r6wks01<0 or -4<r4wks012<0) then do;
twks01=-3;
end;
end;
/* and so on through */
do over match9;
if match9=1 and r6wks01=>0 and r4wks019=>0 then do;
twks01=r4wks019+r6wks01;
end;
if match9=1 and (-4<r6wks01<0 or -4<r4wks019<0) then do;
twks01=-3;
end;
end;
end;
/* For respondents last interviewed in Round 4, 2000 */
if r5int=-5 and r4int_y=2000 then do;
do over match1;
if match1=1 then do;
if r4wks801 not in (-5,-4,0,.) then twks80=r4wks801; if r4wks891 not in
(-5,-4,0,.) then twks89=r4wks891;
if r4wks811 not in (-5,-4,0,.) then twks81=r4wks811; if r4wks901 not in
(-5,-4,0,.) then twks90=r4wks901;
if r4wks821 not in (-5,-4,0,.) then twks82=r4wks821; if r4wks911 not in
(-5,-4,0,.) then twks91=r4wks911;
if r4wks831 not in (-5,-4,0,.) then twks83=r4wks831; if r4wks921 not in
(-5,-4,0,.) then twks92=r4wks921;
if r4wks841 not in (-5,-4,0,.) then twks84=r4wks841; if r4wks931 not in
(-5,-4,0,.) then twks93=r4wks931;
if r4wks851 not in (-5,-4,0,.) then twks85=r4wks851; if r4wks941 not in
(-5,-4,0,.) then twks94=r4wks941;
if r4wks861 not in (-5,-4,0,.) then twks86=r4wks861; if r4wks951 not in
(-5,-4,0,.) then twks95=r4wks951;
if r4wks871 not in (-5,-4,0,.) then twks87=r4wks871; if r4wks961 not in
(-5,-4,0,.) then twks96=r4wks961;
if r4wks881 not in (-5,-4,0,.) then twks88=r4wks881; if r4wks971 not in
(-5,-4,0,.) then twks97=r4wks971;
if r4wks981 not in (-5,-4,0,.) then twks98=r4wks981;
if r4wks991 not in (-5,-4,0,.) then twks99=r4wks991;
end;
end;
do over match1;
if match1=1 and r6wks00=>0 and r4wks001=>0 then do;
twks00=r4wks001+r6wks00;
end;
if match1=1 and (-4<r6wks00<0 or -4<r4wks001<0) then do;
twks00=-3;
end;
end;
do over match2;
if match2=1 then do;
if r4wks802 not in (-5,-4,0,.) then twks80=r4wks802; if r4wks892 not in
(-5,-4,0,.) then twks89=r4wks892;
if r4wks812 not in (-5,-4,0,.) then twks81=r4wks812; if r4wks902 not in
(-5,-4,0,.) then twks90=r4wks902;
if r4wks822 not in (-5,-4,0,.) then twks82=r4wks822; if r4wks912 not in
(-5,-4,0,.) then twks91=r4wks912;
if r4wks832 not in (-5,-4,0,.) then twks83=r4wks832; if r4wks922 not in
(-5,-4,0,.) then twks92=r4wks922;
if r4wks842 not in (-5,-4,0,.) then twks84=r4wks842; if r4wks932 not in
(-5,-4,0,.) then twks93=r4wks932;
if r4wks852 not in (-5,-4,0,.) then twks85=r4wks852; if r4wks942 not in
(-5,-4,0,.) then twks94=r4wks942;
if r4wks862 not in (-5,-4,0,.) then twks86=r4wks862; if r4wks952 not in
(-5,-4,0,.) then twks95=r4wks952;
if r4wks872 not in (-5,-4,0,.) then twks87=r4wks872; if r4wks962 not in
(-5,-4,0,.) then twks96=r4wks962;
if r4wks882 not in (-5,-4,0,.) then twks88=r4wks882; if r4wks972 not in
(-5,-4,0,.) then twks97=r4wks972;
if r4wks982 not in (-5,-4,0,.) then twks98=r4wks982;
if r4wks992 not in (-5,-4,0,.) then twks99=r4wks992;
end;
end;
do over match2;
if match2=1 and r6wks00=>0 and r4wks002=>0 then do;
twks00=r4wks002+r6wks00;
end;
if match2=1 and (-4<r6wks00<0 or -4<r4wks002<0) then do;
twks00=-3;
end;
end;
/* and so on through */
do over match9;
if match9=1 then do;
if r4wks809 not in (-5,-4,0,.) then twks80=r4wks809; if r4wks899 not in
(-5,-4,0,.) then twks89=r4wks899;
if r4wks819 not in (-5,-4,0,.) then twks81=r4wks819; if r4wks909 not in
(-5,-4,0,.) then twks90=r4wks909;
if r4wks829 not in (-5,-4,0,.) then twks82=r4wks829; if r4wks919 not in
(-5,-4,0,.) then twks91=r4wks919;
if r4wks839 not in (-5,-4,0,.) then twks83=r4wks839; if r4wks929 not in
(-5,-4,0,.) then twks92=r4wks929;
if r4wks849 not in (-5,-4,0,.) then twks84=r4wks849; if r4wks939 not in
(-5,-4,0,.) then twks93=r4wks939;
if r4wks859 not in (-5,-4,0,.) then twks85=r4wks859; if r4wks949 not in
(-5,-4,0,.) then twks94=r4wks949;
if r4wks869 not in (-5,-4,0,.) then twks86=r4wks869; if r4wks959 not in
(-5,-4,0,.) then twks95=r4wks959;
if r4wks879 not in (-5,-4,0,.) then twks87=r4wks879; if r4wks969 not in
(-5,-4,0,.) then twks96=r4wks969;
if r4wks889 not in (-5,-4,0,.) then twks88=r4wks889; if r4wks979 not in
(-5,-4,0,.) then twks97=r4wks979;
if r4wks989 not in (-5,-4,0,.) then twks98=r4wks989;
if r4wks999 not in (-5,-4,0,.) then twks99=r4wks999;
end;
end;
do over match9;
if match9=1 and r6wks00=>0 and r4wks009=>0 then do;
twks00=r4wks009+r6wks00;
end;
if match9=1 and (-4<r6wks00<0 or -4<r4wks009<0) then do;
twks00=-3;
end;
end;
end;
/* For respondents last interviewed in Round 3, 2000 */
if r3int_y=2000 and r4int=-5 and r5int=-5 then do;
do over match1;
if match1=1 then do;
if r3wks801 not in (-5,-4,0,.) then twks80=r3wks801; if r3wks891 not in
(-5,-4,0,.) then twks89=r3wks891;
if r3wks811 not in (-5,-4,0,.) then twks81=r3wks811; if r3wks901 not in
(-5,-4,0,.) then twks90=r3wks901;
if r3wks821 not in (-5,-4,0,.) then twks82=r3wks821; if r3wks911 not in
(-5,-4,0,.) then twks91=r3wks911;
if r3wks831 not in (-5,-4,0,.) then twks83=r3wks831; if r3wks921 not in
(-5,-4,0,.) then twks92=r3wks921;
if r3wks841 not in (-5,-4,0,.) then twks84=r3wks841; if r3wks931 not in
(-5,-4,0,.) then twks93=r3wks931;
if r3wks851 not in (-5,-4,0,.) then twks85=r3wks851; if r3wks941 not in
(-5,-4,0,.) then twks94=r3wks941;
if r3wks861 not in (-5,-4,0,.) then twks86=r3wks861; if r3wks951 not in
(-5,-4,0,.) then twks95=r3wks951;
if r3wks871 not in (-5,-4,0,.) then twks87=r3wks871; if r3wks961 not in
(-5,-4,0,.) then twks96=r3wks961;
if r3wks881 not in (-5,-4,0,.) then twks88=r3wks881; if r3wks971 not in
(-5,-4,0,.) then twks97=r3wks971;
if r3wks981 not in (-5,-4,0,.) then twks98=r3wks981;
if r3wks991 not in (-5,-4,0,.) then twks99=r3wks991;
end;
end;
do over match1;
if match1=1 and r6wks00=>0 and r3wks001=>0 then do;
twks00=r3wks001+r6wks00;
end;
if match1=1 and (-4<r6wks00<0 or -4<r3wks001<0) then do;
twks00=-3;
end;
end;
do over match2;
if match2=1 then do;
if r3wks802 not in (-5,-4,0,.) then twks80=r3wks802; if r3wks892 not in
(-5,-4,0,.) then twks89=r3wks892;
if r3wks812 not in (-5,-4,0,.) then twks81=r3wks812; if r3wks902 not in
(-5,-4,0,.) then twks90=r3wks902;
if r3wks822 not in (-5,-4,0,.) then twks82=r3wks822; if r3wks912 not in
(-5,-4,0,.) then twks91=r3wks912;
if r3wks832 not in (-5,-4,0,.) then twks83=r3wks832; if r3wks922 not in
(-5,-4,0,.) then twks92=r3wks922;
if r3wks842 not in (-5,-4,0,.) then twks84=r3wks842; if r3wks932 not in
(-5,-4,0,.) then twks93=r3wks932;
if r3wks852 not in (-5,-4,0,.) then twks85=r3wks852; if r3wks942 not in
(-5,-4,0,.) then twks94=r3wks942;
if r3wks862 not in (-5,-4,0,.) then twks86=r3wks862; if r3wks952 not in
(-5,-4,0,.) then twks95=r3wks952;
if r3wks872 not in (-5,-4,0,.) then twks87=r3wks872; if r3wks962 not in
(-5,-4,0,.) then twks96=r3wks962;
if r3wks882 not in (-5,-4,0,.) then twks88=r3wks882; if r3wks972 not in
(-5,-4,0,.) then twks97=r3wks972;
if r3wks982 not in (-5,-4,0,.) then twks98=r3wks982;
if r3wks992 not in (-5,-4,0,.) then twks99=r3wks992;
end;
end;
do over match2;
if match2=1 and r6wks00=>0 and r3wks002=>0 then do;
twks00=r3wks002+r6wks00;
end;
if match2=1 and (-4<r6wks00<0 or -4<r3wks002<0) then do;
twks00=-3;
end;
end;
/* and so on through */
do over match9;
if match9=1 then do;
if r3wks809 not in (-5,-4,0,.) then twks80=r3wks809; if r3wks899 not in
(-5,-4,0,.) then twks89=r3wks899;
if r3wks819 not in (-5,-4,0,.) then twks81=r3wks819; if r3wks909 not in
(-5,-4,0,.) then twks90=r3wks909;
if r3wks829 not in (-5,-4,0,.) then twks82=r3wks829; if r3wks919 not in
(-5,-4,0,.) then twks91=r3wks919;
if r3wks839 not in (-5,-4,0,.) then twks83=r3wks839; if r3wks929 not in
(-5,-4,0,.) then twks92=r3wks929;
if r3wks849 not in (-5,-4,0,.) then twks84=r3wks849; if r3wks939 not in
(-5,-4,0,.) then twks93=r3wks939;
if r3wks859 not in (-5,-4,0,.) then twks85=r3wks859; if r3wks949 not in
(-5,-4,0,.) then twks94=r3wks949;
if r3wks869 not in (-5,-4,0,.) then twks86=r3wks869; if r3wks959 not in
(-5,-4,0,.) then twks95=r3wks959;
if r3wks879 not in (-5,-4,0,.) then twks87=r3wks879; if r3wks969 not in
(-5,-4,0,.) then twks96=r3wks969;
if r3wks889 not in (-5,-4,0,.) then twks88=r3wks889; if r3wks979 not in
(-5,-4,0,.) then twks97=r3wks979;
if r3wks989 not in (-5,-4,0,.) then twks98=r3wks989;
if r3wks999 not in (-5,-4,0,.) then twks99=r3wks999;
end;
end;
do over match9;
if match9=1 and r6wks00=>0 and r3wks009=>0 then do;
twks00=r3wks009+r6wks00;
end;
if match9=1 and (-4<r6wks00<0 or -4<r3wks009<0) then do;
twks00=-3;
end;
end;
end;
/* For respondents last interviewed in Round 3, 1999 */
if r3int_y=1999 and r4int=-5 and r5int=-5 then do;
do over match1;
if match1=1 then do;
if r3wks801 not in (-5,-4,0,.) then twks80=r3wks801; if r3wks891 not in
(-5,-4,0,.) then twks89=r3wks891;
if r3wks811 not in (-5,-4,0,.) then twks81=r3wks811; if r3wks901 not in
(-5,-4,0,.) then twks90=r3wks901;
if r3wks821 not in (-5,-4,0,.) then twks82=r3wks821; if r3wks911 not in
(-5,-4,0,.) then twks91=r3wks911;
if r3wks831 not in (-5,-4,0,.) then twks83=r3wks831; if r3wks921 not in
(-5,-4,0,.) then twks92=r3wks921;
if r3wks841 not in (-5,-4,0,.) then twks84=r3wks841; if r3wks931 not in
(-5,-4,0,.) then twks93=r3wks931;
if r3wks851 not in (-5,-4,0,.) then twks85=r3wks851; if r3wks941 not in
(-5,-4,0,.) then twks94=r3wks941;
if r3wks861 not in (-5,-4,0,.) then twks86=r3wks861; if r3wks951 not in
(-5,-4,0,.) then twks95=r3wks951;
if r3wks871 not in (-5,-4,0,.) then twks87=r3wks871; if r3wks961 not in
(-5,-4,0,.) then twks96=r3wks961;
if r3wks881 not in (-5,-4,0,.) then twks88=r3wks881; if r3wks971 not in
(-5,-4,0,.) then twks97=r3wks971;
if r3wks981 not in (-5,-4,0,.) then twks98=r3wks981;
end;
end;
do over match1;
if match1=1 and r6wks99=>0 and r3wks991=>0 then do;
twks99=r3wks991+r6wks99;
end;
if match1=1 and (-4<r6wks99<0 or -4<r3wks991<0) then do;
twks99=-3;
end;
end;
do over match2;
if match2=1 then do;
if r3wks802 not in (-5,-4,0,.) then twks80=r3wks802; if r3wks892 not in
(-5,-4,0,.) then twks89=r3wks892;
if r3wks812 not in (-5,-4,0,.) then twks81=r3wks812; if r3wks902 not in
(-5,-4,0,.) then twks90=r3wks902;
if r3wks822 not in (-5,-4,0,.) then twks82=r3wks822; if r3wks912 not in
(-5,-4,0,.) then twks91=r3wks912;
if r3wks832 not in (-5,-4,0,.) then twks83=r3wks832; if r3wks922 not in
(-5,-4,0,.) then twks92=r3wks922;
if r3wks842 not in (-5,-4,0,.) then twks84=r3wks842; if r3wks932 not in
(-5,-4,0,.) then twks93=r3wks932;
if r3wks852 not in (-5,-4,0,.) then twks85=r3wks852; if r3wks942 not in
(-5,-4,0,.) then twks94=r3wks942;
if r3wks862 not in (-5,-4,0,.) then twks86=r3wks862; if r3wks952 not in
(-5,-4,0,.) then twks95=r3wks952;
if r3wks872 not in (-5,-4,0,.) then twks87=r3wks872; if r3wks962 not in
(-5,-4,0,.) then twks96=r3wks962;
if r3wks882 not in (-5,-4,0,.) then twks88=r3wks882; if r3wks972 not in
(-5,-4,0,.) then twks97=r3wks972;
if r3wks982 not in (-5,-4,0,.) then twks98=r3wks982;
end;
end;
do over match2;
if match2=1 and r6wks99=>0 and r3wks992=>0 then do;
twks99=r3wks992+r6wks99;
end;
if match2=1 and (-4<r6wks99<0 or -4<r3wks992<0) then do;
twks99=-3;
end;
end;
/* and so on through */
do over match9;
if match9=1 then do;
if r3wks809 not in (-5,-4,0,.) then twks80=r3wks809; if r3wks899 not in
(-5,-4,0,.) then twks89=r3wks899;
if r3wks819 not in (-5,-4,0,.) then twks81=r3wks819; if r3wks909 not in
(-5,-4,0,.) then twks90=r3wks909;
if r3wks829 not in (-5,-4,0,.) then twks82=r3wks829; if r3wks919 not in
(-5,-4,0,.) then twks91=r3wks919;
if r3wks839 not in (-5,-4,0,.) then twks83=r3wks839; if r3wks929 not in
(-5,-4,0,.) then twks92=r3wks929;
if r3wks849 not in (-5,-4,0,.) then twks84=r3wks849; if r3wks939 not in
(-5,-4,0,.) then twks93=r3wks939;
if r3wks859 not in (-5,-4,0,.) then twks85=r3wks859; if r3wks949 not in
(-5,-4,0,.) then twks94=r3wks949;
if r3wks869 not in (-5,-4,0,.) then twks86=r3wks869; if r3wks959 not in
(-5,-4,0,.) then twks95=r3wks959;
if r3wks879 not in (-5,-4,0,.) then twks87=r3wks879; if r3wks969 not in
(-5,-4,0,.) then twks96=r3wks969;
if r3wks889 not in (-5,-4,0,.) then twks88=r3wks889; if r3wks979 not in
(-5,-4,0,.) then twks97=r3wks979;
if r3wks989 not in (-5,-4,0,.) then twks98=r3wks989;
end;
end;
do over match9;
if match9=1 and r6wks99=>0 and r3wks999=>0 then do;
twks99=r3wks999+r6wks99;
end;
if match9=1 and (-4<r6wks99<0 or -4<r3wks999<0) then do;
twks99=-3;
end;
end;
end;
/* 2-26-01 For respondents last interviewed in Round 2, 1998 */
if r2int_y=1998 and r3int=-5 and r4int=-5 and r5int=-5 then do;
do over match1;
if match1=1 then do;
if r2wks801 not in (-5,-4,0,.) then twks80=r2wks801; if r2wks891 not in
(-5,-4,0,.) then twks89=r2wks891;
if r2wks811 not in (-5,-4,0,.) then twks81=r2wks811; if r2wks901 not in
(-5,-4,0,.) then twks90=r2wks901;
if r2wks821 not in (-5,-4,0,.) then twks82=r2wks821; if r2wks911 not in
(-5,-4,0,.) then twks91=r2wks911;
if r2wks831 not in (-5,-4,0,.) then twks83=r2wks831; if r2wks921 not in
(-5,-4,0,.) then twks92=r2wks921;
if r2wks841 not in (-5,-4,0,.) then twks84=r2wks841; if r2wks931 not in
(-5,-4,0,.) then twks93=r2wks931;
if r2wks851 not in (-5,-4,0,.) then twks85=r2wks851; if r2wks941 not in
(-5,-4,0,.) then twks94=r2wks941;
if r2wks861 not in (-5,-4,0,.) then twks86=r2wks861; if r2wks951 not in
(-5,-4,0,.) then twks95=r2wks951;
if r2wks871 not in (-5,-4,0,.) then twks87=r2wks871; if r2wks961 not in
(-5,-4,0,.) then twks96=r2wks961;
if r2wks881 not in (-5,-4,0,.) then twks88=r2wks881; if r2wks971 not in
(-5,-4,0,.) then twks97=r2wks971;
end;
end;
do over match1;
if match1=1 and r6wks98=>0 and r2wks981=>0 then do;
twks98=r2wks981+r6wks98;
end;
if match1=1 and (-4<r6wks98<0 or -4<r2wks981<0) then do;
twks98=-3;
end;
end;
do over match2;
if match2=1 then do;
if r2wks802 not in (-5,-4,0,.) then twks80=r2wks802; if r2wks892 not in
(-5,-4,0,.) then twks89=r2wks892;
if r2wks812 not in (-5,-4,0,.) then twks81=r2wks812; if r2wks902 not in
(-5,-4,0,.) then twks90=r2wks902;
if r2wks822 not in (-5,-4,0,.) then twks82=r2wks822; if r2wks912 not in
(-5,-4,0,.) then twks91=r2wks912;
if r2wks832 not in (-5,-4,0,.) then twks83=r2wks832; if r2wks922 not in
(-5,-4,0,.) then twks92=r2wks922;
if r2wks842 not in (-5,-4,0,.) then twks84=r2wks842; if r2wks932 not in
(-5,-4,0,.) then twks93=r2wks932;
if r2wks852 not in (-5,-4,0,.) then twks85=r2wks852; if r2wks942 not in
(-5,-4,0,.) then twks94=r2wks942;
if r2wks862 not in (-5,-4,0,.) then twks86=r2wks862; if r2wks952 not in
(-5,-4,0,.) then twks95=r2wks952;
if r2wks872 not in (-5,-4,0,.) then twks87=r2wks872; if r2wks962 not in
(-5,-4,0,.) then twks96=r2wks962;
if r2wks882 not in (-5,-4,0,.) then twks88=r2wks882; if r2wks972 not in
(-5,-4,0,.) then twks97=r2wks972;
end;
end;
do over match2;
if match2=1 and r6wks98=>0 and r2wks982=>0 then do;
twks98=r2wks982+r6wks98;
end;
if match2=1 and (-4<r6wks98<0 or -4<r2wks982<0) then do;
twks98=-3;
end;
end;
/* and so on through */
do over match9;
if match9=1 then do;
if r2wks809 not in (-5,-4,0,.) then twks80=r2wks809; if r2wks899 not in
(-5,-4,0,.) then twks89=r2wks899;
if r2wks819 not in (-5,-4,0,.) then twks81=r2wks819; if r2wks909 not in
(-5,-4,0,.) then twks90=r2wks909;
if r2wks829 not in (-5,-4,0,.) then twks82=r2wks829; if r2wks919 not in
(-5,-4,0,.) then twks91=r2wks919;
if r2wks839 not in (-5,-4,0,.) then twks83=r2wks839; if r2wks929 not in
(-5,-4,0,.) then twks92=r2wks929;
if r2wks849 not in (-5,-4,0,.) then twks84=r2wks849; if r2wks939 not in
(-5,-4,0,.) then twks93=r2wks939;
if r2wks859 not in (-5,-4,0,.) then twks85=r2wks859; if r2wks949 not in
(-5,-4,0,.) then twks94=r2wks949;
if r2wks869 not in (-5,-4,0,.) then twks86=r2wks869; if r2wks959 not in
(-5,-4,0,.) then twks95=r2wks959;
if r2wks879 not in (-5,-4,0,.) then twks87=r2wks879; if r2wks969 not in
(-5,-4,0,.) then twks96=r2wks969;
if r2wks889 not in (-5,-4,0,.) then twks88=r2wks889; if r2wks979 not in
(-5,-4,0,.) then twks97=r2wks979;
end;
end;
do over match9;
if match9=1 and r6wks98=>0 and r2wks989=>0 then do;
twks98=r2wks989+r6wks98;
end;
if match9=1 and (-4<r6wks98<0 or -4<r2wks989<0) then do;
twks98=-3;
end;
end;
end;
/* For respondents last interviewed in Round 2, 1999 */
if r2int_y=1999 and r3int=-5 and r4int=-5 and r5int=-5 then do;
do over match1;
if match1=1 then do;
if r2wks801 not in (-5,-4,0,.) then twks80=r2wks801; if r2wks891 not in
(-5,-4,0,.) then twks89=r2wks891;
if r2wks811 not in (-5,-4,0,.) then twks81=r2wks811; if r2wks901 not in
(-5,-4,0,.) then twks90=r2wks901;
if r2wks821 not in (-5,-4,0,.) then twks82=r2wks821; if r2wks911 not in
(-5,-4,0,.) then twks91=r2wks911;
if r2wks831 not in (-5,-4,0,.) then twks83=r2wks831; if r2wks921 not in
(-5,-4,0,.) then twks92=r2wks921;
if r2wks841 not in (-5,-4,0,.) then twks84=r2wks841; if r2wks931 not in
(-5,-4,0,.) then twks93=r2wks931;
if r2wks851 not in (-5,-4,0,.) then twks85=r2wks851; if r2wks941 not in
(-5,-4,0,.) then twks94=r2wks941;
if r2wks861 not in (-5,-4,0,.) then twks86=r2wks861; if r2wks951 not in
(-5,-4,0,.) then twks95=r2wks951;
if r2wks871 not in (-5,-4,0,.) then twks87=r2wks871; if r2wks961 not in
(-5,-4,0,.) then twks96=r2wks961;
if r2wks881 not in (-5,-4,0,.) then twks88=r2wks881; if r2wks971 not in
(-5,-4,0,.) then twks97=r2wks971;
if r2wks981 not in (-5,-4,0,.) then twks98=r2wks981;
end;
end;
do over match1;
if match1=1 and r6wks99=>0 and r2wks991=>0 then do;
twks99=r2wks991+r6wks99;
end;
if match1=1 and (-4<r6wks99<0 or -4<r2wks991<0) then do;
twks99=-3;
end;
end;
do over match2;
if match2=1 then do;
if r2wks802 not in (-5,-4,0,.) then twks80=r2wks802; if r2wks892 not in
(-5,-4,0,.) then twks89=r2wks892;
if r2wks812 not in (-5,-4,0,.) then twks81=r2wks812; if r2wks902 not in
(-5,-4,0,.) then twks90=r2wks902;
if r2wks822 not in (-5,-4,0,.) then twks82=r2wks822; if r2wks912 not in
(-5,-4,0,.) then twks91=r2wks912;
if r2wks832 not in (-5,-4,0,.) then twks83=r2wks832; if r2wks922 not in
(-5,-4,0,.) then twks92=r2wks922;
if r2wks842 not in (-5,-4,0,.) then twks84=r2wks842; if r2wks932 not in
(-5,-4,0,.) then twks93=r2wks932;
if r2wks852 not in (-5,-4,0,.) then twks85=r2wks852; if r2wks942 not in
(-5,-4,0,.) then twks94=r2wks942;
if r2wks862 not in (-5,-4,0,.) then twks86=r2wks862; if r2wks952 not in
(-5,-4,0,.) then twks95=r2wks952;
if r2wks872 not in (-5,-4,0,.) then twks87=r2wks872; if r2wks962 not in
(-5,-4,0,.) then twks96=r2wks962;
if r2wks882 not in (-5,-4,0,.) then twks88=r2wks882; if r2wks972 not in
(-5,-4,0,.) then twks97=r2wks972;
if r2wks982 not in (-5,-4,0,.) then twks98=r2wks982;
end;
end;
do over match2;
if match2=1 and r6wks99=>0 and r2wks992=>0 then do;
twks99=r2wks992+r6wks99;
end;
if match2=1 and (-4<r6wks99<0 or -4<r2wks992<0) then do;
twks99=-3;
end;
end;
/* and so on through */
do over match9;
if match9=1 then do;
if r2wks809 not in (-5,-4,0,.) then twks80=r2wks809; if r2wks899 not in
(-5,-4,0,.) then twks89=r2wks899;
if r2wks819 not in (-5,-4,0,.) then twks81=r2wks819; if r2wks909 not in
(-5,-4,0,.) then twks90=r2wks909;
if r2wks829 not in (-5,-4,0,.) then twks82=r2wks829; if r2wks919 not in
(-5,-4,0,.) then twks91=r2wks919;
if r2wks839 not in (-5,-4,0,.) then twks83=r2wks839; if r2wks929 not in
(-5,-4,0,.) then twks92=r2wks929;
if r2wks849 not in (-5,-4,0,.) then twks84=r2wks849; if r2wks939 not in
(-5,-4,0,.) then twks93=r2wks939;
if r2wks859 not in (-5,-4,0,.) then twks85=r2wks859; if r2wks949 not in
(-5,-4,0,.) then twks94=r2wks949;
if r2wks869 not in (-5,-4,0,.) then twks86=r2wks869; if r2wks959 not in
(-5,-4,0,.) then twks95=r2wks959;
if r2wks879 not in (-5,-4,0,.) then twks87=r2wks879; if r2wks969 not in
(-5,-4,0,.) then twks96=r2wks969;
if r2wks889 not in (-5,-4,0,.) then twks88=r2wks889; if r2wks979 not in
(-5,-4,0,.) then twks97=r2wks979;
if r2wks989 not in (-5,-4,0,.) then twks98=r2wks989;
end;
end;
do over match9;
if match9=1 and r6wks99=>0 and r2wks999=>0 then do;
twks99=r2wks999+r6wks99;
end;
if match9=1 and (-4<r6wks99<0 or -4<r2wks999<0) then do;
twks99=-3;
end;
end;
end;
/* For respondents last interviewed in Round 1, 1997 */
if r1int_y=1997 and r2int=-5 and r3int=-5 and r4int=-5 and r5int=-5 and intwk>0
then do;
do over match1;
if match1=1 then do;
if r1wks801 not in (-5,-4,0,.) then twks80=r1wks801; if r1wks891 not in
(-5,-4,0,.) then twks89=r1wks891;
if r1wks811 not in (-5,-4,0,.) then twks81=r1wks811; if r1wks901 not in
(-5,-4,0,.) then twks90=r1wks901;
if r1wks821 not in (-5,-4,0,.) then twks82=r1wks821; if r1wks911 not in
(-5,-4,0,.) then twks91=r1wks911;
if r1wks831 not in (-5,-4,0,.) then twks83=r1wks831; if r1wks921 not in
(-5,-4,0,.) then twks92=r1wks921;
if r1wks841 not in (-5,-4,0,.) then twks84=r1wks841; if r1wks931 not in
(-5,-4,0,.) then twks93=r1wks931;
if r1wks851 not in (-5,-4,0,.) then twks85=r1wks851; if r1wks941 not in
(-5,-4,0,.) then twks94=r1wks941;
if r1wks861 not in (-5,-4,0,.) then twks86=r1wks861; if r1wks951 not in
(-5,-4,0,.) then twks95=r1wks951;
if r1wks871 not in (-5,-4,0,.) then twks87=r1wks871; if r1wks961 not in
(-5,-4,0,.) then twks96=r1wks961;
if r1wks881 not in (-5,-4,0,.) then twks88=r1wks881;
end;
end;
do over match1;
if match1=1 and r6wks97=>0 and r1wks971=>0 then do;
twks97=r1wks971+r6wks97;
end;
if match1=1 and (-4<r6wks97<0 or -4<r1wks971<0) then do;
twks97=-3;
end;
end;
do over match2;
if match2=1 then do;
if r1wks802 not in (-5,-4,0,.) then twks80=r1wks802; if r1wks892 not in
(-5,-4,0,.) then twks89=r1wks892;
if r1wks812 not in (-5,-4,0,.) then twks81=r1wks812; if r1wks902 not in
(-5,-4,0,.) then twks90=r1wks902;
if r1wks822 not in (-5,-4,0,.) then twks82=r1wks822; if r1wks912 not in
(-5,-4,0,.) then twks91=r1wks912;
if r1wks832 not in (-5,-4,0,.) then twks83=r1wks832; if r1wks922 not in
(-5,-4,0,.) then twks92=r1wks922;
if r1wks842 not in (-5,-4,0,.) then twks84=r1wks842; if r1wks932 not in
(-5,-4,0,.) then twks93=r1wks932;
if r1wks852 not in (-5,-4,0,.) then twks85=r1wks852; if r1wks942 not in
(-5,-4,0,.) then twks94=r1wks942;
if r1wks862 not in (-5,-4,0,.) then twks86=r1wks862; if r1wks952 not in
(-5,-4,0,.) then twks95=r1wks952;
if r1wks872 not in (-5,-4,0,.) then twks87=r1wks872; if r1wks962 not in
(-5,-4,0,.) then twks96=r1wks962;
if r1wks882 not in (-5,-4,0,.) then twks88=r1wks882;
end;
end;
do over match2;
if match2=1 and r6wks97=>0 and r1wks972=>0 then do;
twks97=r1wks972+r6wks97;
end;
if match2=1 and (-4<r6wks97<0 or -4<r1wks972<0) then do;
twks97=-3;
end;
end;
/* and so on through */
do over match9;
if match9=1 then do;
if r1wks809 not in (-5,-4,0,.) then twks80=r1wks809; if r1wks899 not in
(-5,-4,0,.) then twks89=r1wks899;
if r1wks819 not in (-5,-4,0,.) then twks81=r1wks819; if r1wks909 not in
(-5,-4,0,.) then twks90=r1wks909;
if r1wks829 not in (-5,-4,0,.) then twks82=r1wks829; if r1wks919 not in
(-5,-4,0,.) then twks91=r1wks919;
if r1wks839 not in (-5,-4,0,.) then twks83=r1wks839; if r1wks929 not in
(-5,-4,0,.) then twks92=r1wks929;
if r1wks849 not in (-5,-4,0,.) then twks84=r1wks849; if r1wks939 not in
(-5,-4,0,.) then twks93=r1wks939;
if r1wks859 not in (-5,-4,0,.) then twks85=r1wks859; if r1wks949 not in
(-5,-4,0,.) then twks94=r1wks949;
if r1wks869 not in (-5,-4,0,.) then twks86=r1wks869; if r1wks959 not in
(-5,-4,0,.) then twks95=r1wks959;
if r1wks879 not in (-5,-4,0,.) then twks87=r1wks879; if r1wks969 not in
(-5,-4,0,.) then twks96=r1wks969;
if r1wks889 not in (-5,-4,0,.) then twks88=r1wks889;
end;
end;
do over match9;
if match9=1 and r6wks97=>0 and r1wks979=>0 then do;
twks97=r1wks979+r6wks97;
end;
if match9=1 and (-4<r6wks97<0 or -4<r1wks979<0) then do;
twks97=-3;
end;
end;
end;
/* For respondents last interviewed in Round 1, 1998 */
if r1int_y=1998 and r2int=-5 and r3int=-5 and r4int=-5 and r5int=-5 and intwk>0
then do;
do over match1;
if match1=1 then do;
if r1wks801 not in (-5,-4,0,.) then twks80=r1wks801; if r1wks891 not in
(-5,-4,0,.) then twks89=r1wks891;
if r1wks811 not in (-5,-4,0,.) then twks81=r1wks811; if r1wks901 not in
(-5,-4,0,.) then twks90=r1wks901;
if r1wks821 not in (-5,-4,0,.) then twks82=r1wks821; if r1wks911 not in
(-5,-4,0,.) then twks91=r1wks911;
if r1wks831 not in (-5,-4,0,.) then twks83=r1wks831; if r1wks921 not in
(-5,-4,0,.) then twks92=r1wks921;
if r1wks841 not in (-5,-4,0,.) then twks84=r1wks841; if r1wks931 not in
(-5,-4,0,.) then twks93=r1wks931;
if r1wks851 not in (-5,-4,0,.) then twks85=r1wks851; if r1wks941 not in
(-5,-4,0,.) then twks94=r1wks941;
if r1wks861 not in (-5,-4,0,.) then twks86=r1wks861; if r1wks951 not in
(-5,-4,0,.) then twks95=r1wks951;
if r1wks871 not in (-5,-4,0,.) then twks87=r1wks871; if r1wks961 not in
(-5,-4,0,.) then twks96=r1wks961;
if r1wks881 not in (-5,-4,0,.) then twks88=r1wks881; if r1wks971 not in
(-5,-4,0,.) then twks97=r1wks971;
end;
end;
do over match1;
if match1=1 and r6wks98=>0 and r1wks981=>0 then do;
twks98=r1wks981+r6wks98;
end;
if match1=1 and (-4<r6wks98<0 or -4<r1wks981<0) then do;
twks98=-3;
end;
end;
do over match2;
if match2=1 then do;
if r1wks802 not in (-5,-4,0,.) then twks80=r1wks802; if r1wks892 not in
(-5,-4,0,.) then twks89=r1wks892;
if r1wks812 not in (-5,-4,0,.) then twks81=r1wks812; if r1wks902 not in
(-5,-4,0,.) then twks90=r1wks902;
if r1wks822 not in (-5,-4,0,.) then twks82=r1wks822; if r1wks912 not in
(-5,-4,0,.) then twks91=r1wks912;
if r1wks832 not in (-5,-4,0,.) then twks83=r1wks832; if r1wks922 not in
(-5,-4,0,.) then twks92=r1wks922;
if r1wks842 not in (-5,-4,0,.) then twks84=r1wks842; if r1wks932 not in
(-5,-4,0,.) then twks93=r1wks932;
if r1wks852 not in (-5,-4,0,.) then twks85=r1wks852; if r1wks942 not in
(-5,-4,0,.) then twks94=r1wks942;
if r1wks862 not in (-5,-4,0,.) then twks86=r1wks862; if r1wks952 not in
(-5,-4,0,.) then twks95=r1wks952;
if r1wks872 not in (-5,-4,0,.) then twks87=r1wks872; if r1wks962 not in
(-5,-4,0,.) then twks96=r1wks962;
if r1wks882 not in (-5,-4,0,.) then twks88=r1wks882; if r1wks972 not in
(-5,-4,0,.) then twks97=r1wks972;
end;
end;
do over match2;
if match2=1 and r6wks98=>0 and r1wks982=>0 then do;
twks98=r1wks982+r6wks98;
end;
if match2=1 and (-4<r6wks98<0 or -4<r1wks982<0) then do;
twks98=-3;
end;
end;
/* and so on through */
do over match9;
if match9=1 then do;
if r1wks809 not in (-5,-4,0,.) then twks80=r1wks809; if r1wks899 not in
(-5,-4,0,.) then twks89=r1wks899;
if r1wks819 not in (-5,-4,0,.) then twks81=r1wks819; if r1wks909 not in
(-5,-4,0,.) then twks90=r1wks909;
if r1wks829 not in (-5,-4,0,.) then twks82=r1wks829; if r1wks919 not in
(-5,-4,0,.) then twks91=r1wks919;
if r1wks839 not in (-5,-4,0,.) then twks83=r1wks839; if r1wks929 not in
(-5,-4,0,.) then twks92=r1wks929;
if r1wks849 not in (-5,-4,0,.) then twks84=r1wks849; if r1wks939 not in
(-5,-4,0,.) then twks93=r1wks939;
if r1wks859 not in (-5,-4,0,.) then twks85=r1wks859; if r1wks949 not in
(-5,-4,0,.) then twks94=r1wks949;
if r1wks869 not in (-5,-4,0,.) then twks86=r1wks869; if r1wks959 not in
(-5,-4,0,.) then twks95=r1wks959;
if r1wks879 not in (-5,-4,0,.) then twks87=r1wks879; if r1wks969 not in
(-5,-4,0,.) then twks96=r1wks969;
if r1wks889 not in (-5,-4,0,.) then twks88=r1wks889; if r1wks979 not in
(-5,-4,0,.) then twks97=r1wks979;
end;
end;
do over match9;
if match9=1 and r6wks98=>0 and r1wks989=>0 then do;
twks98=r1wks989+r6wks98;
end;
if match9=1 and (-4<r6wks98<0 or -4<r1wks989<0) then do;
twks98=-3;
end;
end;
end;
/* flag problem cases where total weeks count exceeds 52 weeks in 1997 or 1998
*/
do i=1 to 11;
if twks97>52 then flag97=1;
if twks98>52 then flag98=1;
if twks99>52 then flag99=1;
if twks00>53 then flag00=1;
if twks01>52 then flag01=1;
if twks02>52 then flag02=1;
end;
do i=1 to 11;
if r6wks97>0 and twks97=0 then miss97=1;
if r6wks98>0 and twks98=0 then miss98=1;
if r6wks99>0 and twks99=0 then miss99=1;
if r6wks00>0 and twks00=0 then miss00=1;
if r6wks01>0 and twks01=0 then miss01=1;
if r6wks02>0 and twks02=0 then miss02=1;
end;
endsas;
Variables Created: CV_WKSWK_JOB_DLI.xx
Programs Used
This program uses emp_begin.sas as input (follow hyperlink for details).
This program creates a variable for each job calculating the total length of job tenure in weeks (excluding within-job gaps) since the respondent's 14th birthday. A variable is created for each potential job even if the respondent has no data for that job, with the default value set to zero (0). The most jobs held by any respondent in round 5 was eight, so variables are created for eight jobs for each respondent.
array job1wks (i) w1_1-w1_1253;
array job2wks (i) w2_1-w2_1253;
array job3wks (i) w3_1-w3_1253;
array job4wks (i) w4_1-w4_1253;
array job5wks (i) w5_1-w5_1253;
array job6wks (i) w6_1-w6_1253;
array job7wks (i) w7_1-w7_1253;
array job8wks (i) w8_1-w8_1253;
array job9wks (i) w9_1-w9_1253;
array job10wks (i) w10_1-w10_1253;
array job11wks (i) w11_1-w11_1253;
*****************************************************************
** Calculate cumulative weeks on individual jobs for all years **
*****************************************************************;
r6ten1=0;
r6ten2=0;
r6ten3=0;
r6ten4=0;
r6ten5=0;
r6ten6=0;
r6ten7=0;
r6ten8=0;
r6ten9=0;
r6ten10=0;
r6ten11=0;
do i=1 to 1253;
if job1wks=1 then do;
r6ten1=r6ten1+1;
end;
if job2wks=1 then do;
r6ten2=r6ten2+1;
end;
if job3wks=1 then do;
r6ten3=r6ten3+1;
end;
if job4wks=1 then do;
r6ten4=r6ten4+1;
end;
if job5wks=1 then do;
r6ten5=r6ten5+1;
end;
if job6wks=1 then do;
r6ten6=r6ten6+1;
end;
if job7wks=1 then do;
r6ten7=r6ten7+1;
end;
if job8wks=1 then do;
r6ten8=r6ten8+1;
end;
if job9wks=1 then do;
r6ten9=r6ten9+1;
end;
if job10wks=1 then do;
r6ten10=r6ten10+1;
end;
if job11wks=1 then do;
r6ten11=r6ten11+1;
end;
end;
flag=0;
do i=1 to 1253;
if job1wks=-3 then do;
r6ten1=-3;
flag=1;
end;
if job2wks=-3 then do;
r6ten2=-3;
flag=2;
end;
if job3wks=-3 then do;
r6ten3=-3;
flag=3;
end;
if job4wks=-3 then do;
r6ten4=-3;
flag=4;
end;
if job5wks=-3 then do;
r6ten5=-3;
flag=5;
end;
if job6wks=-3 then do;
r6ten6=-3;
flag=6;
end;
if job7wks=-3 then do;
r6ten7=-3;
flag=7;
end;
if job8wks=-3 then do;
r6ten8=-3;
flag=8;
end;
if job9wks=-3 then do;
r6ten9=-3;
flag=9;
end;
if job10wks=-3 then do;
r6ten10=-3;
flag=10;
end;
if job11wks=-3 then do;
r6ten11=-3;
flag=11;
end;
end;
if e200=-5 then do;
r6ten1=-5; r6ten2=-5; r6ten3=-5; r6ten4=-5; r6ten5=-5; r6ten6=-5; r6ten7=-5;
r6ten8=-5; r6ten9=-5;
r6ten10=-5; r6ten11=-5;
end;
array r1ten (i) r1ten1-r1ten9; /* New
R1 c.v. name */
array r2ten (i) r2ten1-r2ten9; /* New R2 c.v. name */
array r3ten (i) r3ten1-r3ten9; /* New R3 c.v. name */
array r4ten (i) r4ten1-r4ten9; /* New R4 c.v. name */
array r5ten (i) r5ten1-r5ten9; /* New R5 c.v. name */
array r6ten (i) r6ten1-r6ten11; /* New R6 c.v. name */
array totten (i) totten1-totten11;/* Total c.v. name */
do i=1 to 11;
totten=0;
end;
/* When matching jobs from a dli Round to Round 6, we only need to worry about
jobs in Round 6 with a UID not
beginning with "2002" since only those jobs that could have been worked in both
rounds. */
array match1 (i) match1_1-match1_11;
array match2 (i) match2_1-match2_11;
array match3 (i) match3_1-match3_11;
array match4 (i) match4_1-match4_11;
array match5 (i) match5_1-match5_11;
array match6 (i) match6_1-match6_11;
array match7 (i) match7_1-match7_11;
array match8 (i) match8_1-match8_11;
array match9 (i) match9_1-match9_11;
do i=1 to 11;
match1=0; match2=0; match3=0; match4=0; match5=0; match6=0; match7=0; match8=0;
match9=0;
end;
/* Define match1_4 as the dummy variable that equals one when the first job on
the dli UID roster and the fourth job on
the Round6 roster have the same UID. */
array r1uid (i) r1uid1-r1uid9; /* Note there are 7 jobs in Round 1, array
matched to make programming easier */
array r2uid (i) r2uid1-r2uid9;
array r3uid (i) r3uid1-r3uid9;
array r4uid (i) r4uid1-r4uid9;
array r5uid (i) r5uid1-r5uid9;
array r6uid (i) uid1-uid11;
/* If any UID from the first position in dli Round matches with any UID in Round
5 */
do over r6uid;
if r5uid1>0 and r6uid>0 and r5int>0 and intwk>0 then do;
if r5uid1=r6uid then do;
match1=1;
end;
end;
if r4uid1>0 and r6uid>0 and r5int=-5 and r4int>0 and intwk>0 then do;
if r4uid1=r6uid then do;
match1=1;
end;
end;
if r3uid1>0 and r6uid>0 and r4int=-5 and r5int=-5 and intwk>0 then do;
if r3uid1=r6uid then do;
match1=1;
end;
end;
if r2uid1>0 and r6uid>0 and r4int=-5 and r3int=-5 and r5int=-5 and intwk>0 then
do;
if r2uid1=r6uid then do;
match1=1;
end;
end;
if r1uid1>0 and r6uid>0 and r4int=-5 and r3int=-5 and r2int=-5 and r5int=-5 and
intwk>0 then do;
if r1uid1=r6uid then do;
match1=1;
end;
end;
end;
do over r6uid; /* If any UID from the second position in dli Round matches with
any UID in Round 5 */
if r5uid2>0 and r6uid>0 and r5int>0 and intwk>0 then do;
if r5uid2=r6uid then do;
match2=1;
end;
end;
if r4uid2>0 and r6uid>0 and r4int>0 and r5int=-5 and intwk>0 then do;
if r4uid2=r6uid then do;
match2=1;
end;
end;
if r3uid2>0 and r6uid>0 and r4int=-5 and r3int>0 and r5int=-5 and intwk>0 then
do;
if r3uid2=r6uid then do;
match2=1;
end;
end;
if r2uid2>0 and r6uid>0 and r4int=-5 and r3int=-5 and r5int=-5 and intwk>0 then
do;
if r2uid2=r6uid then do;
match2=1;
end;
end;
if r1uid2>0 and r6uid>0 and r4int=-5 and r3int=-5 and r2int=-5 and r5int=-5 and
intwk>0 then do;
if r1uid2=r6uid then do;
match2=1;
end;
end;
end;
do over r6uid; /* If any UID from the third position in dli Round matches with
any UID in Round 5 */
if r5uid3>0 and r6uid>0 and r5int>0 and intwk>0 then do;
if r5uid3=r6uid then do;
match3=1;
end;
end;
if r4uid3>0 and r6uid>0 and r4int>0 and intwk>0 and r5int=-5 then do;
if r4uid3=r6uid then do;
match3=1;
end;
end;
if r3uid3>0 and r6uid>0 and r4int=-5 and r3int>0 and intwk>0 and r5int=-5 then
do;
if r3uid3=r6uid then do;
match3=1;
end;
end;
if r2uid3>0 and r6uid>0 and r4int=-5 and r3int=-5 and r5int=-5 and intwk>0 then
do;
if r2uid3=r6uid then do;
match3=1;
end;
end;
if r1uid3>0 and r6uid>0 and r4int=-5 and r3int=-5 and r2int=-5 and r5int=-5 and
intwk>0 then do;
if r1uid3=r6uid then do;
match3=1;
end;
end;
end;
do over r6uid; /* If any UID from the fourth position in dli Round matches with
any UID in Round 5 */
if r5uid4>0 and r6uid>0 and r5int>0 and intwk>0 then do;
if r5uid4=r6uid then do;
match4=1;
end;
end;
if r4uid4>0 and r6uid>0 and r4int>0 and intwk>0 and r5int=-5 then do;
if r4uid4=r6uid then do;
match4=1;
end;
end;
if r3uid4>0 and r6uid>0 and r4int=-5 and r3int>0 and intwk>0 and r5int=-5 then
do;
if r3uid4=r6uid then do;
match4=1;
end;
end;
if r2uid4>0 and r6uid>0 and r4int=-5 and r3int=-5 and intwk>0 and r5int=-5 then
do;
if r2uid4=r6uid then do;
match4=1;
end;
end;
if r1uid4>0 and r6uid>0 and r4int=-5 and r3int=-5 and r2int=-5 and intwk>0 and
r5int=-5 then do;
if r1uid4=r6uid then do;
match4=1;
end;
end;
end;
do over r6uid; /* If any UID from the fifth position in dli Round matches with
any UID in Round 5 */
if r5uid5>0 and r6uid>0 and r5int>0 and intwk>0 then do;
if r5uid5=r6uid then do;
match5=1;
end;
end;
if r4uid5>0 and r6uid>0 and r4int>0 and intwk>0 and r5int=-5 then do;
if r4uid5=r6uid then do;
match5=1;
end;
end;
if r3uid5>0 and r6uid>0 and r4int=-5 and r3int>0 and intwk>0 and r5int=-5 then
do;
if r3uid5=r6uid then do;
match5=1;
end;
end;
if r2uid5>0 and r6uid>0 and r4int=-5 and r3int=-5 and intwk>0 and r5int=-5 then
do;
if r2uid5=r6uid then do;
match5=1;
end;
end;
if r1uid5>0 and r6uid>0 and r4int=-5 and r3int=-5 and r2int=-5 and intwk>0 and
r5int=-5 then do;
if r1uid5=r6uid then do;
match5=1;
end;
end;
end;
do over r6uid; /* If any UID from the sixth position in dli Round matches with
any UID in Round 5 */
if r5uid6>0 and r6uid>0 and r5int>0 and intwk>0 then do;
if r5uid6=r6uid then do;
match6=1;
end;
end;
if r4uid6>0 and r6uid>0 and r4int>0 and intwk>0 and r5int=-5 then do;
if r4uid6=r6uid then do;
match6=1;
end;
end;
if r3uid6>0 and r6uid>0 and r4int=-5 and r3int>0 and intwk>0 and r5int=-5 then
do;
if r3uid6=r6uid then do;
match6=1;
end;
end;
if r2uid6>0 and r6uid>0 and r4int=-5 and r3int=-5 and intwk>0 and r5int=-5 then
do;
if r2uid6=r6uid then do;
match6=1;
end;
end;
if r1uid6>0 and r6uid>0 and r4int=-5 and r3int=-5 and r2int=-5 and intwk>0 and
r5int=-5 then do;
if r1uid6=r6uid then do;
match6=1;
end;
end;
end;
do over r6uid; /* If any UID from the seventh position in dli Round matches with
any UID in Round 5 */
if r5uid7>0 and r6uid>0 and r5int>0 and intwk>0 then do;
if r5uid7=r6uid then do;
match7=1;
end;
end;
if r4uid7>0 and r6uid>0 and r4int>0 and intwk>0 and r5int=-5 then do;
if r4uid7=r6uid then do;
match7=1;
end;
end;
if r3uid7>0 and r6uid>0 and r4int=-5 and r3int>0 and intwk>0 and r5int=-5 then
do;
if r3uid7=r6uid then do;
match7=1;
end;
end;
if r2uid7>0 and r6uid>0 and r4int=-5 and r3int=-5 and intwk>0 and r5int=-5 then
do;
if r2uid7=r6uid then do;
match7=1;
end;
end;
if r1uid7>0 and r6uid>0 and r4int=-5 and r3int=-5 and r2int=-5 and intwk>0 and
r5int=-5 then do;
if r1uid7=r6uid then do;
match7=1;
end;
end;
end;
do over r6uid; /* If any UID from the eighth position in dli Round matches with
any UID in Round 5 */
if r5uid8>0 and r6uid>0 and r5int>0 and intwk>0 then do;
if r5uid8=r6uid then do;
match8=1;
end;
end;
if r4uid8>0 and r6uid>0 and r4int>0 and intwk>0 and r5int=-5 then do;
if r4uid8=r6uid then do;
match8=1;
end;
end;
if r3uid8>0 and r6uid>0 and r4int=-5 and r3int>0 and intwk>0 and r5int=-5 then
do;
if r3uid8=r6uid then do;
match8=1;
end;
end;
if r2uid8>0 and r6uid>0 and r4int=-5 and r3int=-5 and intwk>0 and r5int=-5 then
do;
if r2uid8=r6uid then do;
match8=1;
end;
end;
end;
do over r6uid; /* If any UID from the ninth position in dli Round matches with
any UID in Round 5 */
if r5uid1>0 and r6uid>0 and r5int>0 and intwk>0 then do;
if r5uid9=r6uid then do;
match9=1;
end;
end;
if r4uid9>0 and r6uid>0 and r4int>0 and intwk>0 and r5int=-5 then do;
if r4uid9=r6uid then do;
match9=1;
end;
end;
if r3uid9>0 and r6uid>0 and r4int=-5 and r3int>0 and intwk>0 and r5int=-5 then
do;
if r3uid9=r6uid then do;
match9=1;
end;
end;
if r2uid9>0 and r6uid>0 and r4int=-5 and r3int=-5 and intwk>0 and r5int=-5 then
do;
if r2uid9=r6uid then do;
match9=1;
end;
end;
end;
/* There can only be 11 possible jobs for the respondent, since we are not
counting jobs that were only worked in
previous rounds. Recall that the only dli Round jobs that we are worried about
are the one that were also worked
in Round 6. */
do over totten;
totten=r6ten;
end;
/* Now reassign total tenure if there is a job was worked in both rounds. Using
the match variable, a job worked in
both round 6 & the dli round will update the total tenure variable. Need to add
positivity condition on the tenure
values since some of the values equal -3. */
do over match1;
if match1=1 and r6ten=>0 and r5ten1=>0 then do;
totten=r5ten1+r6ten;
end;
if match1=1 and -4<r5ten1<0 then do;
totten=-3;
end;
if match1=1 and r6ten=>0 and r4ten1=>0 and r5int=-5 then do;
totten=r4ten1+r6ten;
end;
if match1=1 and -4<r4ten1<0 and r4int=-5 and r5int=-5 then do;
totten=-3;
end;
if match1=1 and r6ten=>0 and r4ten1=-5 and r5int=-5 and r3ten1=>0 then do;
totten=r3ten1+r6ten;
end;
if match1=1 and -4<r3ten1<0 and r4int=-5 and r5int=-5 then do;
totten=-3;
end;
if match1=1 and r6ten=>0 and r2ten1=>0 and r4int=-5 and r3int=-5 and r5int=-5
then do;
totten=r2ten1+r6ten;
end;
if match1=1 and -4<r2ten1<0 and r4int=-5 and r3int=-5 and r5int=-5 then do;
totten=-3;
end;
if match1=1 and r6ten=>0 and r1ten1=>0 and r4int=-5 and r3int=-5 and r2int=-5
and r5int=-5 then do;
totten=r1ten1+r6ten;
end;
if match1=1 and -4<r1ten1<0 and r5int=-5 and r4int=-5 and r3int=-5 and r2int=-5
then do;
totten=-3;
end;
end;
do over match2;
if match2=1 and r6ten=>0 and r5ten1=>0 then do;
totten=r5ten2+r6ten;
end;
if match2=1 and -4<r5ten1<0 then do;
totten=-3;
end;
if match2=1 and r6ten=>0 and r5ten2=-5 and r4ten2=>0 and r5int=-5 then do;
totten=r4ten2+r6ten;
end;
if match2=1 and -4<r4ten2<0 then do;
totten=-3;
end;
if match2=1 and r6ten=>0 and r3ten2=>0 and r5int=-5 and r4int=-5 then do;
totten=r3ten2+r6ten;
end;
if match2=1 and -4<r3ten2<0 and r4int=-5 and r5int=-5 then do;
totten=-3;
end;
if match2=1 and r6ten=>0 and r2ten2=>0 and r5int=-5 and r4int=-5 and r3int=-5
then do;
totten=r2ten2+r6ten;
end;
if match2=1 and -4<r2ten2<0 and r5int=-5 and r4int=-5 and r3int=-5 then do;
totten=-3;
end;
if match2=1 and r6ten=>0 and r1ten2=>0 and r5int=-5 and r4int=-5 and r3int=-5
and r2int=-5 then do;
totten=r1ten2+r6ten;
end;
if match2=1 and -4<r1ten2<0 and r4int=-5 and r3int=-5 and r2int=-5 and r5int=-5
then do;
totten=-3;
end;
end;
do over match3;
if match3=1 and r6ten=>0 and r5ten3=>0 then do;
totten=r5ten3+r6ten;
end;
if match3=1 and -4<r5ten3<0 then do;
totten=-3;
end;
if match3=1 and r6ten=>0 and r5int=-5 and r4ten3=>0 then do;
totten=r4ten3+r6ten;
end;
if match3=1 and r5int=-5 and -4<r4ten3<0 then do;
totten=-3;
end;
if match3=1 and r6ten=>0 and r3ten3=>0 and r5int=-5 and r4int=-5 then do;
totten=r3ten3+r6ten;
end;
if match3=1 and -4<r3ten3<0 and r5int=-5 and r4int=-5 and r3int=-5 then do;
totten=-3;
end;
if match3=1 and r6ten=>0 and r2ten3=>0 and r5int=-5 and r4int=-5 and r3int=-5
then do;
totten=r2ten3+r6ten;
end;
if match3=1 and -4<r2ten3<0 and r5int=-5 and r4int=-5 and r3int=-5 then do;
totten=-3;
end;
if match3=1 and r6ten=>0 and r1ten3=>0 and r5int=-5 and r4int=-5 and r3int=-5
and r2int=-5 then do;
totten=r1ten3+r6ten;
end;
if match3=1 and -4<r1ten3<0 and r5int=-5 and r4int=-5 and r3int=-5 and r2int=-5
then do;
totten=-3;
end;
end;
do over match4;
if match4=1 and r6ten=>0 and r5ten4=>0 then do;
totten=r5ten4+r6ten;
end;
if match4=1 and -4<r5ten4<0 then do;
totten=-3;
end;
if match4=1 and r6ten=>0 and r3ten4=>0 and r4int=-5 and r5int=-5 then do;
totten=r3ten4+r6ten;
end;
if match4=1 and -4<r3ten4<0 and r4int=-5 and r5int=-5 then do;
totten=-3;
end;
if match4=1 and r6ten=>0 and r2ten4=>0 and r4int=-5 and r3int=-5 and r5int=-5
then do;
totten=r2ten4+r6ten;
end;
if match4=1 and -4<r2ten4<0 and r4int=-5 and r3int=-5 and r5int=-5 then do;
totten=-3;
end;
if match4=1 and r5ten=>0 and r1ten4=>0 and r5int=-5 and r4int=-5 and r3int=-5
and r2int=-5 then do;
totten=r1ten4+r6ten;
end;
if match4=1 and -4<r1ten4<0 and r4int=-5 and r3int=-5 and r2int=-5 and r5int=-5
then do;
totten=-3;
end;
end;
do over match5;
if match5=1 and r6ten=>0 and r5ten5=>0 then do;
totten=r5ten5+r6ten;
end;
if match5=1 and -4<r5ten5<0 then do;
totten=-3;
end;
if match5=1 and r6ten=>0 and r4ten5=>0 and r5int=-5 then do;
totten=r4ten5+r6ten;
end;
if match5=1 and -4<r4ten5<0 and r5int=-5 then do;
totten=-3;
end;
if match5=1 and r6ten=>0 and r3ten5=>0 and r4int=-5 and r5int=-5 then do;
totten=r3ten5+r6ten;
end;
if match5=1 and -4<r3ten5<0 and r4int=-5 and r5int=-5 then do;
totten=-3;
end;
if match5=1 and r6ten=>0 and r2ten5=>0 and r4int=-5 and r3int=-5 and r5int=-5
then do;
totten=r2ten5+r6ten;
end;
if match5=1 and -4<r2ten5<0 and r4int=-5 and r3int=-5 and r5int=-5 then do;
totten=-3;
end;
if match5=1 and r5ten=>0 and r1ten5=>0 and r5int=-5 and r4int=-5 and r3int=-5
and r2int=-5 then do;
totten=r1ten5+r6ten;
end;
if match5=1 and -4<r1ten5<0 and r5int=-5 and r4int=-5 and r3int=-5 and r2int=-5
then do;
totten=-3;
end;
end;
do over match6;
if match6=1 and r6ten=>0 and r5ten6=>0 then do;
totten=r5ten6+r6ten;
end;
if match6=1 and -4<r5ten6<0 then do;
totten=-3;
end;
if match6=1 and r5ten=>0 and r4ten6=>0 then do;
totten=r5ten6+r6ten;
end;
if match6=1 and r6ten=>0 and r4ten6=>0 and r5int=-5 then do;
totten=r5ten6+r6ten;
end;
if match6=1 and -4<r5ten6<0 then do;
totten=-3;
end;
if match6=1 and r6ten=>0 and r4ten6=>0 and r5int=-5 then do;
totten=r4ten6+r6ten;
end;
if match6=1 and -4<r4ten6<0 and r5int=-5 then do;
totten=-3;
end;
if match6=1 and r6ten=>0 and r3ten6=>0 and r4int=-5 and r5int=-5 then do;
totten=r3ten6+r6ten;
end;
if match6=1 and -4<r3ten6<0 and r4int=-5 and r5int=-5 then do;
totten=-3;
end;
if match6=1 and r6ten=>0 and r2ten6=>0 and r4int=-5 and r3int=-5 and r5int=-5
then do;
totten=r2ten6+r6ten;
end;
if match6=1 and -4<r2ten6<0 and r4int=-5 and r3int=-5 and r5int=-5 then do;
totten=-3;
end;
if match6=1 and r6ten=>0 and r1ten6=>0 and r4int=-5 and r3int=-5 and r2int=-5
and r5int=-5 then do;
totten=r1ten6+r6ten;
end;
if match6=1 and -4<r1ten6<0 and r4int=-5 and r3int=-5 and r2int=-5 and r5int=-5
then do;
totten=-3;
end;
end;
do over match7;
if match7=1 and r6ten=>0 and r5ten7=>0 then do;
totten=r5ten7+r6ten;
end;
if match7=1 and -4<r5ten7<0 then do;
totten=-3;
end;
if match7=1 and r6ten=>0 and r4ten7=>0 and r5int=-5 then do;
totten=r4ten7+r6ten;
end;
if match7=1 and -4<r4ten7<0 and r5int=-5 then do;
totten=-3;
end;
if match7=1 and r5ten=>0 and r3ten7=>0 and r4int=-5 and r5int=-5 then do;
totten=r3ten7+r6ten;
end;
if match7=1 and -4<r3ten7<0 and r4int=-5 and r5int=-5 then do;
totten=-3;
end;
if match7=1 and r6ten=>0 and r2ten7=>0 and r4int=-5 and r3int=-5 and r5int=-5
then do;
totten=r2ten7+r6ten;
end;
if match7=1 and -4<r2ten7<0 and r4int=-5 and r3int=-5 and r5int=-5 then do;
totten=-3;
end;
if match7=1 and r5ten=>0 and r1ten7=>0 and r4int=-5 and r3int=-5 and r2int=-5
and r5int=-5 then do;
totten=r1ten7+r6ten;
end;
if match7=1 and -4<r1ten7<0 and r4int=-5 and r3int=-5 and r2int=-5 and r5int=-5
then do;
totten=-3;
end;
end;
do over match8;
if match8=1 and r6ten=>0 and r5ten8=>0 then do;
totten=r5ten8+r6ten;
end;
if match8=1 and -4<r5ten8<0 then do;
totten=-3;
end;
if match8=1 and r6ten=>0 and r4ten8=>0 and r5int=-5 then do;
totten=r4ten8+r6ten;
end;
if match8=1 and -4<r4ten8<0 and r5int=-5 then do;
totten=-3;
end;
if match8=1 and r6ten=>0 and r3ten8=>0 and r4int=-5 and r5int=-5 then do;
totten=r3ten8+r6ten;
end;
if match8=1 and -4<r3ten8<0 and r4int=-5 and r5int=-5 then do;
totten=-3;
end;
if match8=1 and r6ten=>0 and r2ten8=>0 and r4int=-5 and r3int=-5 and r5int=-5
then do;
totten=r2ten8+r6ten;
end;
if match8=1 and -4<r2ten8<0 and r4int=-5 and r3int=-5 and r5int=-5 then do;
totten=-3;
end;
end;
do over match9;
if match9=1 and r6ten=>0 and r5ten9=>0 then do;
totten=r5ten9+r6ten;
end;
if match9=1 and -4<r5ten9<0 then do;
totten=-3;
end;
if match9=1 and r6ten=>0 and r4ten9=>0 and r5int=-5 then do;
totten=r4ten9+r6ten;
end;
if match9=1 and -4<r4ten9<0 and r5int=-5 then do;
totten=-3;
end;
if match9=1 and r6ten=>0 and r3ten9=>0 and r4int=-5 and r5int=-5 then do;
totten=r3ten9+r6ten;
end;
if match9=1 and -4<r3ten9<0 and r4int=-5 and r5int=-5 then do;
totten=-3;
end;
if match9=1 and r6ten=>0 and r2ten9=>0 and r4int=-5 and r3int=-5 and r5int=-5
then do;
totten=r2ten9+r6ten;
end;
if match9=1 and -4<r2ten9<0 and r4int=-5 and r3int=-5 and r5int=-5 then do;
totten=-3;
end;
end;
do over r6uid;
if r6uid=-4 then totten=-4;
end;
endsas;
Variables Created: CV_HOURS_WK_YR_ALL.80 - CV_HOURS_WK_YR_ALL.03
CV_HOURS_WK_YR_ET.80 - CV_HOURS_WK_YR_ET.03
CV_HOURS_WK_YR_SE.98 - CV_HOURS_WK_YR_SE.03
Programs Used
This program uses emp_begin.sas as input (follow hyperlink for details).
This program calculates the number of hours worked by the respondent at all jobs in each calendar year. Three sets of variables are created: one for all jobs, one for employee-type jobs, and one for self-employed jobs for respondents age 18 and older in rounds 4 and 5. See the introduction to this appendix for important information about the universes for each of these variables. 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). Note that when both "starting hours" and "current hours" are reported, the latter are used to construct these measures.
if
pubid=1461 then self03=0;
*** Organize hours for each job;
array starw (k) starw01-starw11;
array stopw (k) stopw01-stopw11;
array rghrsb (k) rghrsb01-rghrsb11;
array rghrs (k) rghrs01-rghrs11;
array othrs (k) othrs01-othrs11;
array hours (k) hours01-hours11;
array e23901 (k) e2390101-e2390111;
array e24501 (k) e2450101-e2450111;
array e34402 (k) e3440201-e3440211;
array e34403 (k) e3440301-e3440311;
array e34428 (k) e3442801-e3442811;
array e37904 (k) e3790401-e3790411;
array e38000b (k) e38000b01-e38000b11;
array e38000f (k) e38000f01-e38000f11;
array e38002 (k) e3800201-e3800211;
array e38102 (k) e3810201-e3810211;
array e38103 (k) e3810301-e3810311;
array e38105 (k) e3810501-e3810511;
array e59901 (k) e5990101-e5990111;
array e88000 (k) e8800001-e8800011;
array e88501 (k) e8850101-e8850111;
array e98402 (k) e9840201-e9842011;
array e98403 (k) e9840301-e9840311;
array e98429 (k) e9842901-e9842911;
array e1002252 (k) e100225012 e100225022 e100225032 e100225042 e100225052
e100225062 e100225072 e100225082 e100225092
e100225102 e100225112;
array e100231 (k) e10023101-e10023111;
array e1002253 (k) e100225013 e100225023 e100225033 e100225043 e100225053
e100225063 e100225073 e100225083 e100225093
e100225103 e100225113;
array e100232 (k) e10023201-e10023211;
array e226042 (k) e22604012 e22604022 e22604032 e22604042 e22604052 e22604062
e22604072 e22604082 e22604092
e22604102 e22604112;
array e22610 (k) e2261001-e2261011;
array e226043 (k) e22604013 e22604023 e22604033 e22604043 e22604053 e22604063
e22604073 e22604083 e22604093
e22604103 e22604113;
array e22611 (k) e2261101-e2261111;
array starfl (k) starfl_1-starfl_11;
array stopfl (k) stopfl_1-stopfl_11;
***** Initialize the number of hours per week to 0;
do k=1 to 11;
rghrsb =0;
rghrs=0;
othrs=0;
hours=0;
end;
***** Regular rghrs Per Week;
do k=1 to 11;
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 11;
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 11;
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 **
*****************************************************************;
***** The following program is using the created variables from the program "/emp_curr/emp31_jobwks.sas"--number
of weeks
worked on each job in each year;
array self (k) self01-self11;
/* 1980 */
* created no. of weeks worked on each job;
array wks80 (k) r6w80_1-r6w80_11;
* hours worked on each job;
array ah80 (k) ah80_1-ah80_11;
array sah80 (k) sah80_1-sah80_11;
array eah80 (k) eah80_1-eah80_11;
do k=1 to 11;
ah80=0;
sah80=0;
eah80=0;
end;
do k=1 to 11;
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;
r6hrs80=0;
r6shrs80=0;
r6ehrs80=0;
do k=1 to 11;
if ah80 ge 0 then r6hrs80 = r6hrs80 + ah80;
if sah80 ge 0 then r6shrs80 = r6shrs80 + sah80;
if eah80 ge 0 then r6ehrs80 = r6ehrs80 + eah80;
end;
do k=1 to 11;
if ah80=-3 then r6hrs80 = -3;
if sah80=-3 then r6shrs80 = -3;
if eah80=-3 then r6ehrs80 = -3;
end;
/* At this point the program repeats the above 1980 code for each year through 2002. This code is omitted here due to space considerations. Users who need to see the entire program should contact NLS User Services. The week numbers and variables created for each year are as follows:
|
Year/ Weeks |
Variables Created |
Year/ Weeks |
Variables Created |
||
|
1981 53-104 |
wks811-wks818; swks811-swks818; ewks811-ewks818; |
ah811-ah818; sah811-sah818; eah811-eah818; |
1993 679-730 |
wks931-wks938; swks931-swks938; ewks931-ewks938; |
ah931-ah938; sah931-sah938; eah931-eah938; |
|
1982 105-156 |
wks821-wks828; swks821-swks828; ewks821-ewks828; |
ah821-ah828; sah821-sah828; eah821-eah828; |
1994 731-783 |
wks941-wks948; swks941-swks948; ewks941-ewks948; |
ah941-ah948; sah941-sah948; eah941-eah948; |
|
1983 157-209 |
wks831-wks838; swks831-swks838; ewks831-ewks838; |
ah831-ah838; sah831-sah838; eah831-eah838; |
1995 784-835 |
wks951-wks958; swks951-swks958; ewks951-ewks958; |
ah951-ah958; sah951-sah958; eah951-eah958; |
|
1984 210-261 |
wks841-wks848; swks841-swks848; ewks841-ewks848; |
ah841-ah848; sah841-sah848; eah841-eah848; |
1996 836-887 |
wks961-wks968; swks961-swks968; ewks961-ewks968; |
ah961-ah968; sah961-sah968; eah961-eah968; |
|
1985 262-313 |
wks851-wks858; swks851-swks858; ewks851-ewks858; |
ah851-ah858; sah851-sah858; eah851-eah858; |
1997 888-939 |
wks971-wks978; swks971-swks978; ewks971-ewks978; |
ah971-ah978; sah971-sah978; eah971-eah978; |
|
1986 314-365 |
wks861-wks868; swks861-swks868; ewks861-ewks868; |
ah861-ah868; sah861-sah868; eah861-eah868; |
1998 940-991 |
wks981-wks988; swks981-swks988; ewks981-ewks988; |
ah981-ah988; sah981-sah988; eah981-eah988; |
|
1987 366-417 |
wks871-wks878; swks871-swks878; ewks871-ewks878; |
ah871-ah878; sah871-sah878; eah871-eah878; |
1999 992-1043 |
wks991-wks998; swks991-swks998; ewks991-ewks998; |
ah991-ah998; sah991-sah998; eah991-eah998; |
|
1988 418-470 |
wks881-wks888; swks881-swks888; ewks881-ewks888; |
ah881-ah888; sah881-sah888; eah881-eah888; |
2000 1044-1096 |
wks001-wks008; swks001-swks008; ewks001-ewks008; |
ah001-ah008; sah001-sah008; eah001-eah008; |
|
1989 471-522 |
wks891-wks898; swks891-swks898; ewks891-ewks898; |
ah891-ah898; sah891-sah898; eah891-eah898; |
2001 1097-1148 |
wks011-wks018; swks011-swks018; ewks011-ewks018; |
ah011-ah018; sah011-sah018; eah011-eah018; |
|
1990 523-574 |
wks901-wks908; swks901-swks908; ewks901-ewks908; |
ah901-ah908; sah901-sah908; eah901-eah908; |
2002 1149-1200 |
wks021-wks028; swks021-swks028; ewks021-ewks028; |
ah021-ah028; sah021-sah028; eah021-eah028; |
|
1991 575-626 |
wks911-wks918; swks911-swks918; ewks911-ewks918; |
ah911-ah918; sah911-sah918; eah911-eah918; |
2003 1201-1252 |
wks031-wks038; swks031-swks038; ewks031-ewks038; |
ah031-ah038; sah031-sah038; eah031-eah038; |
|
1992 627-678 |
wks921-wks928; swks921-swks928; ewks921-ewks928; |
ah921-ah928; sah921-sah928; eah921-eah928; |
|||
if e200 in (-3,-5) then do;
r6hrs80=-5; r6hrs81=-5; r6hrs82=-5; r6hrs83=-5; r6hrs84=-5; r6hrs85=-5;
r6hrs86=-5; r6hrs87=-5; r6hrs88=-5; r6hrs89=-5; r6hrs90=-5; r6hrs91=-5;
r6hrs92=-5; r6hrs93=-5; r6hrs94=-5; r6hrs95=-5; r6hrs96=-5; r6hrs97=-5;
r6hrs98=-5; r6hrs99=-5; r6hrs00=-5; r6hrs01=-5; r6hrs02=-5; r6hrs03=-5;
r6shrs80=-5; r6shrs81=-5; r6shrs82=-5; r6shrs83=-5; r6shrs84=-5; r6shrs85=-5;
r6shrs86=-5; r6shrs87=-5; r6shrs88=-5; r6shrs89=-5; r6shrs90=-5; r6shrs91=-5;
r6shrs92=-5; r6shrs93=-5; r6shrs94=-5; r6shrs95=-5; r6shrs96=-5; r6shrs97=-5;
r6shrs98=-5; r6shrs99=-5; r6shrs00=-5; r6shrs01=-5; r6shrs02=-5; r6shrs03=-5;
r6ehrs80=-5; r6ehrs81=-5; r6ehrs82=-5; r6ehrs83=-5; r6ehrs84=-5; r6ehrs85=-5;
r6ehrs86=-5; r6ehrs87=-5; r6ehrs88=-5; r6ehrs89=-5; r6ehrs90=-5; r6ehrs91=-5;
r6ehrs92=-5; r6ehrs93=-5; r6ehrs94=-5; r6ehrs95=-5; r6ehrs96=-5; r6ehrs97=-5;
r6ehrs98=-5; r6ehrs99=-5; r6ehrs00=-5; r6ehrs01=-5; r6ehrs02=-5; r6ehrs03=-5;
end;
array thrs (i) thrs80-thrs99 thrs00-thrs03;
array tshrs (i) tshrs80-tshrs99 tshrs00-tshrs03;
array tehrs (i) tehrs80-tehrs99 tehrs00-tehrs03;
array r1hrs (i) r1hrs80-r1hrs99 r1hrs00-r1hrs03;
array r2hrs (i) r2hrs80-r2hrs99 r2hrs00-r2hrs03;
array r3hrs (i) r3hrs80-r3hrs99 r3hrs00-r3hrs03;
array r4hrs (i) r4hrs80-r4hrs99 r4hrs00-r4hrs03;
array r4shrs (i) r4shrs80-r4shrs99 r4shrs00-r4shrs03;
array r4ehrs (i) r4ehrs80-r4ehrs99 r4ehrs00-r4ehrs03;
array r5hrs (i) r5hrs80-r5hrs99 r5hrs00-r5hrs03;
array r5shrs (i) r5shrs80-r5shrs99 r5shrs00-r5shrs03;
array r5ehrs (i) r5ehrs80-r5ehrs99 r5ehrs00-r5ehrs03;
array r6hrs (i) r6hrs80-r6hrs99 r6hrs00-r6hrs03;
array r6shrs (i) r6shrs80-r6shrs99 r6shrs00-r6shrs03;
array r6ehrs (i) r6ehrs80-r6ehrs99 r6ehrs00-r6ehrs03;
/* For the round 1 to round 3 c.v.'s, we are assuming that all jobs are
employee-type jobs. Thus, these dli information
will be added to the "all jobs" and "employee jobs" c.v.'s but not
"self-employed jobs" c.v.'s. */
do over r6hrs;
thrs=0;
tshrs=0;
tehrs=0;
if r6hrs>0 then do;
thrs=r6hrs;
end;
if r6shrs>0 then do;
tshrs=r6shrs;
end;
if r6ehrs>0 then do;
tehrs=r6ehrs;
end;
if r5hrs>0 and dliwk=r5int then do;
thrs=r5hrs;
end;
if r5shrs>0 and dliwk=r5int then do;
tshrs=r5shrs;
end;
if r5ehrs>0 and dliwk=r5int then do;
tehrs=r5ehrs;
end;
if r4hrs>0 and dliwk=r4int then do;
thrs=r4hrs;
end;
if r4shrs>0 and dliwk=r4int then do;
tshrs=r4shrs;
end;
if r4ehrs>0 and dliwk=r4int then do;
tehrs=r4ehrs;
end;
if r3hrs>0 and dliwk=r3int then do;
thrs=r3hrs;
tehrs=r3hrs;
end;
if r2hrs>0 and dliwk=r2int then do;
thrs=r2hrs;
tehrs=r2hrs;
end;
if r1hrs>0 and dliwk=r1int then do;
thrs=r1hrs;
tehrs=r1hrs;
end;
if r5hrs>0 and r6hrs>0 and dliwk=r5int then do;
thrs=r5hrs+r6hrs;
end;
if r5shrs>0 and r6shrs>0 and dliwk=r5int then do;
tshrs=r5shrs+r6shrs;
end;
if r5ehrs>0 and r6ehrs>0 and dliwk=r5int then do;
tehrs=r5ehrs+r6ehrs;
end;
if r4hrs>0 and r6hrs>0 and dliwk=r4int then do;
thrs=r4hrs+r6hrs;
end;
if r4shrs>0 and r6shrs>0 and dliwk=r4int then do;
tshrs=r4shrs+r6shrs;
end;
if r4ehrs>0 and r6ehrs>0 and dliwk=r4int then do;
tehrs=r4ehrs+r6ehrs;
end;
if r3hrs>0 and r6hrs>0 and dliwk=r3int then do;
thrs=r3hrs+r6hrs;
end;
if r3hrs>0 and r6ehrs>0 and dliwk=r3int then do;
tehrs=r3hrs+r6ehrs;
end;
if r2hrs>0 and r6hrs>0 and dliwk=r2int then do;
thrs=r2hrs+r6hrs;
end;
if r2hrs>0 and r6ehrs>0 and dliwk=r2int then do;
tehrs=r2hrs+r6ehrs;
end;
if r1hrs>0 and r6hrs>0 and dliwk=r1int then do;
thrs=r1hrs+r6hrs;
end;
if r1hrs>0 and r6ehrs>0 and dliwk=r1int then do;
tehrs=r1hrs+r6ehrs;
end;
end;
do over r6hrs;
if -4<r6hrs<0 then do;
thrs=r6hrs;
end;
if -4<r6shrs<0 then do;
tshrs=r6shrs;
end;
if -4<r6ehrs<0 then do;
tehrs=r6ehrs;
end;
if -4<r5hrs<0 then do;
thrs=r5hrs;
end;
if -4<r5shrs<0 then do;
tshrs=r5shrs;
end;
if -4<r5ehrs<0 then do;
tehrs=r5ehrs;
end;
if -4<r4hrs<0 and dliwk=r4int then do;
thrs=r4hrs;
end;
if -4<r4shrs<0 and dliwk=r4int then do;
tshrs=r4shrs;
end;
if -4<r4ehrs<0 and dliwk=r4int then do;
tehrs=r4ehrs;
end;
if -4<r3hrs<0 and dliwk=r3int then do;
thrs=r3hrs;
tehrs=r3hrs;
end;
if -4<r2hrs<0 and dliwk=r2int then do;
thrs=r2hrs;
tehrs=r2hrs;
end;
if -4<r1hrs<0 and dliwk=r1int then do;
thrs=r1hrs;
tehrs=r1hrs;
end;
end;
do over thrs;
if e200=-5 then do;
thrs=-5; tehrs=-5; tshrs=-5;
end;
end;
endsas;
Variables Created:
CV_HOURS_WK_TEEN
CV_HOURS_WK_ADULT_ALL
WE_HOURS_WK_ADULT_ET
Programs Used
This program uses emp_begin.sas as input (follow hyperlink for details).
This program calculates the number of hours worked by the respondent at all employee-type jobs between the ages of 14 and 19. It then creates two variables for the number of hours worked by the respondent since age 20: one for all jobs and one for employee-type jobs. See the introduction to this appendix for important information about the universes for each of these variables. 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). Note that when both "starting hours" and "current hours" are reported, the latter are used to construct these measures.
*** Organize hours for each job;
array rghrsb (k) rghrsb01-rghrsb11;
array rghrs (k) rghrs01-rghrs11;
array othrs (k) othrs01-othrs11;
array hours (k) hours01-hours11;
array e23901 (k) e2390101-e2390111;
array e24501 (k) e2450101-e2450111;
array e34402 (k) e3440201-e3440211;
array e34403 (k) e3440301-e3440311;
array e34428 (k) e3442801-e3442811;
array e37904 (k) e3790401-e3790411;
array e38000b (k) e38000b01-e38000b11;
array e38000f (k) e38000f01-e38000f11;
array e38002 (k) e3800201-e3800211;
array e38102 (k) e3810201-e3810211;
array e38103 (k) e3810301-e3810311;
array e38105 (k) e3810501-e3810511;
array e59901 (k) e5990101-e5990111;
array e88000 (k) e8800001-e8800011;
array e88501 (k) e8850101-e8850111;
array e98402 (k) e9840201-e9842011;
array e98403 (k) e9840301-e9840311;
array e98429 (k) e9842901-e9842911;
array e1002252 (k) e100225012 e100225022 e100225032 e100225042 e100225052
e100225062 e100225072 e100225082 e100225092 e100225102 e100225112;
array e100231 (k) e10023101-e10023111;
array e1002253 (k) e100225013 e100225023 e100225033 e100225043 e100225053
e100225063 e100225073 e100225083 e100225093 e100225103 e100225113;
array e100232 (k) e10023201-e10023211;
array e226042 (k) e22604012 e22604022 e22604032 e22604042 e22604052 e22604062
e22604072 e22604082 e22604092 e22604102 e22604112;
array e22610 (k) e2261001-e2261011;
array e226043 (k) e22604013 e22604023 e22604033 e22604043 e22604053 e22604063
e22604073 e22604083 e22604093 e22604103 e22604113;
array e22611 (k) e2261101-e2261111;
array starfl (k) starfl_1-starfl_11;
array stopfl (k) stopfl_1-stopfl_11;
***** Initialize the number of hours per week to 0;
do k=1 to 11;
rghrsb =0;
rghrs=0;
othrs=0;
hours=0;
end;
***** Regular rghrs Per Week;
do k=1 to 11;
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 11;
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 11;
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_1253;
array job2wks (i) w2_1-w2_1253;
array job3wks (i) w3_1-w3_1253;
array job4wks (i) w4_1-w4_1253;
array job5wks (i) w5_1-w5_1253;
array job6wks (i) w6_1-w6_1253;
array job7wks (i) w7_1-w7_1253;
array job8wks (i) w8_1-w8_1253;
array job9wks (i) w9_1-w9_1253;
array job10wks (i) w10_1-w10_1253;
array job11wks (i) w11_1-w11_1253;
/* Initialize created variables */
r6hrs14=0;
r6ehrs14=0;
r6hrs20=0;
r6ehrs20=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-self11;
array wks14 (k) wks1401-wks1411;
array hrs14 (k) hrs1401-hrs1411;
array ehrs14 (k) ehrs1401-ehrs1411;
array wks20 (k) wks2001-wks2011;
array hrs20 (k) hrs2001-hrs2011;
array ehrs20 (k) ehrs2001-ehrs2011;
do k=1 to 11;
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, 1253);
/* 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;
if job11wks=1 then do;
wks1411=wks1411+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;
if job11wks=-3 then do;
wks1411=-3;
end;
end;
* The number of hours worked on each job since age 14;
do k=1 to 11;
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 11;
if hrs14 ge 0 then r6hrs14 = r6hrs14 + hrs14;
if ehrs14 ge 0 then r6ehrs14 = r6ehrs14 + ehrs14;
end;
do k=1 to 11;
if hrs14=-3 then r6hrs14=-3;
if ehrs14=-3 then r6ehrs14=-3;
end;
***************** The created variable for "since age 20";
if age14wk>0 and age20wk<=1253 then do;
* The number of weeks worked since age 20 for the respondents who have turned 20
by Round 6;
do i=age20wk to 1253;
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;
if job11wks=1 then do;
wks2011=wks2011+1;
end;
end;
do i=age20wk to 1253;
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;
if job11wks=-3 then do;
wks2011=-3;
end;
end;
* The number of hours worked since age 20 for the respondents who have turned 20
by Round 6;
do k=1 to 11;
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 11;
if hrs20 ge 0 then r6hrs20 = r6hrs20 + hrs20;
if ehrs20 ge 0 then r6ehrs20 = r6ehrs20 + ehrs20;
end;
do k=1 to 11;
if hrs20=-3 then r6hrs20=-3;
if ehrs20=-3 then r6ehrs20=-3;
end;
end;
if e200=-5 then do;
r6hrs14=-5;
r6ehrs14=-5;
r6hrs20=-5;
r6ehrs20=-5;
end;
/* Initialize created variables to zero. */
thrs14=0;
thrs20=0;
tehrs20=0;
/* By the construction of the dli created variables, we can simply add the two
created variables from the current and
previous rounds if they are both postive. If one is positive and one is not,
then the positive value will be the total
created variable for both rounds. If neither is positive, then the total created
variable for both rounds will be
zero. */
/* hand editor the case self03=0*/
if pubid=1461 then r6ehrs20=r6hrs20;
if r6hrs14=>0 then do;
thrs14=r6hrs14;
end;
if r6hrs14=-3 then do;
thrs14=-3;
end;
if r5hrs14=>0 and r6hrs14=>0 then do; /* dli is Round 5 */
thrs14=r5hrs14+r6hrs14;
end;
if r5hrs14=-3 then do;
thrs14=-3;
end;
if r4hrs14=>0 and r6hrs14=>0 and r5int=-5 then do; /* dli is Round 4 */
thrs14=r4hrs14+r6hrs14;
end;
if r4hrs14=-3 then do;
thrs14=-3;
end;
if r3hrs14=>0 and r6hrs14=>0 and r4int=-5 and r5int=-5 then do; /* dli is Round
3 */
thrs14=r3hrs14+r6hrs14;
end;
if r3hrs14=-3 and r4int=-5 and r5int=-5 then do;
thrs14=-3;
end;
if r2hrs14=>0 and r6hrs14=>0 and r3int=-5 and r4int=-5 and r5int=-5then do; /*
dli is Round 2 */
thrs14=r2hrs14+r6hrs14;
end;
if r2hrs14=-3 and r3int=-5 and r4int=-5 and r5int=-5 then do;
thrs14=-3;
end;
if r1hrs14=>0 and r6hrs14=>0 and r4int=-5 and r3int=-5 and r2int=-5 and r5int=-5
then do; /* dli is Round 1 */
thrs14=r1hrs14+r6hrs14;
end;
if r1hrs14=-3 and r3int=-5 and r2int=-5 and r4int=-5 and r5int=-5 then do;
thrs14=-3;
end;
if r6hrs20>0 then thrs20=r6hrs20;
if r5hrs20>0 then thrs20=r5hrs20;
if r6hrs20>0 and r5hrs20>0 then do;
thrs20=r6hrs20+r5hrs20;
end;
if r6hrs20=-3 or r5hrs20=-3 then do;
thrs20=-3;
end;
if r4hrs20>0 and r5int=-5 then thrs20=r4hrs20;
if r6hrs20>0 and r4hrs20>0 and r5int=-5 then do;
thrs20=r6hrs20+r4hrs20;
end;
if (r6hrs20=-3 or r4hrs20=-3) and r4int=-5 and r5int=-5 then do;
thrs20=-3;
end;
if r3hrs20>0 and r4int=-5 and r5int=-5 then thrs20=r3hrs20;
if r6hrs20>0 and r3hrs20>0 and r4int=-5 and r5int=-5 then do;
thrs20=r6hrs20+r3hrs20;
end;
if (r6hrs20=-3 or r3hrs20=-3) and r4int=-5 and r5int=-5 then do;
thrs20=-3;
end;
if r6ehrs20>0 then tehrs20=r6ehrs20;
if r5ehrs20>0 then tehrs20=r5ehrs20;
if r6ehrs20>0 and r5ehrs20>0 then do;
tehrs20=r6ehrs20+r5ehrs20;
end;
if r6ehrs20=-3 or r5ehrs20=-3 then do;
tehrs20=-3;
end;
if r4ehrs20>0 and r5int=-5 then tehrs20=r4ehrs20;
if r6ehrs20>0 and r4ehrs20>0 and r5int=-5then do;
tehrs20=r6ehrs20+r4ehrs20;
end;
if r6ehrs20=-3 or r4hrs20=-3 then do;
tehrs20=-3;
end;
if r3hrs20>0 and r4int=-5 and r5int=-5 then tehrs20=r3hrs20;
if r6ehrs20>0 and r3hrs20>0 and r4int=-5 and r5int=-5 then do;
tehrs20=r6ehrs20+r3hrs20;
end;
if (r6ehrs20=-3 or r3hrs20=-3) and r4int=-5 and r5int=-5 then do;
tehrs20=-3;
end;
/* For respondents younger than 20 at interview date, their thrs14 c.v. will be
-4. */
if age20wk>intwk and intwk>0 then do;
thrs20=-4;
tehrs20=-4;
end;
/* Account for non-interview cases */
if uid01=-5 then do;
thrs14=-5;
thrs20=-5;
tehrs20=-5;
end;
endsas;
Variables Created: rCV_TTL_JOB_ALL.80 - CV_TTL_JOB_ALL.03
CV_TTL_JOB_ET.80 - CV_TTL_JOB_ET.03
CV_TTL_JOB_SE.98 - CV_TTL_JOB_SE.03
Programs Used
This program uses emp_begin.sas as input (follow hyperlink for details).
This program calculates the number of employee-type jobs the respondent held during each calendar year. Three sets of variables are created: one for all jobs, one for employee-type jobs, and one for self-employed jobs. See the introduction to this appendix for important information about the universes for each of these variables. These variables are created only for respondents who have worked at least one week in the applicable calendar year.
array job1wks (i) w1_1-w1_1253;
array job2wks (i) w2_1-w2_1253;
array job3wks (i) w3_1-w3_1253;
array job4wks (i) w4_1-w4_1253;
array job5wks (i) w5_1-w5_1253;
array job6wks (i) w6_1-w6_1253;
array job7wks (i) w7_1-w7_1253;
array job8wks (i) w8_1-w8_1253;
array job9wks (i) w9_1-w9_1253;
array job10wks (i) w10_1-w10_1253;
array job11wks (i) w11_1-w11_1253;
*******************************************************************
** Indicate if worked at least one week on a job in a given year **
*******************************************************************;
/* 1980 */
r6j801=0; r6s801=0; r6e801=0;
r6j802=0; r6s802=0; r6e802=0;
r6j803=0; r6s803=0; r6e803=0;
r6j804=0; r6s804=0; r6e804=0;
r6j805=0; r6s805=0; r6e805=0;
r6j806=0; r6s806=0; r6e806=0;
r6j807=0; r6s807=0; r6e807=0;
r6j808=0; r6s808=0; r6e808=0;
r6j809=0; r6s809=0; r6e809=0;
r6j8010=0; r6s8010=0; r6e8010=0;
r6j8011=0; r6s8011=0; r6e8011=0;
do i=1 to 52;
if job1wks=-3 then do;
r6j801=-3;
end;
if job1wks=-3 and self01=1 then do;
r6s801=-3;
end;
if job1wks=-3 and self01=0 then do;
r6e801=-3;
end;
if job2wks=-3 then do;
r6j802=-3;
end;
if job2wks=-3 and self02=1 then do;
r6s802=-3;
end;
if job2wks=-3 and self02=0 then do;
r6e802=-3;
end;
if job3wks=-3 then do;
r6j803=-3;
end;
if job3wks=-3 and self03=1 then do;
r6s803=-3;
end;
if job3wks=-3 and self03=0 then do;
r6e803=-3;
end;
if job4wks=-3 then do;
r6j804=-3;
end;
if job4wks=-3 and self04=1 then do;
r6s804=-3;
end;
if job4wks=-3 and self04=0 then do;
r6e804=-3;
end;
if job5wks=-3 then do;
r6j805=-3;
end;
if job5wks=-3 and self05=1 then do;
r6s805=-3;
end;
if job5wks=-3 and self05=0 then do;
r6e805=-3;
end;
if job6wks=-3 then do;
r6j806=-3;
end;
if job6wks=-3 and self06=1 then do;
r6s806=-3;
end;
if job6wks=-3 and self06=0 then do;
r6e806=-3;
end;
if job7wks=-3 then do;
r6j807=-3;
end;
if job7wks=-3 and self07=1 then do;
r6s807=-3;
end;
if job7wks=-3 and self07=0 then do;
r6e807=-3;
end;
if job8wks=-3 then do;
r6j808=-3;
end;
if job8wks=-3 and self08=1 then do;
r6s808=-3;
end;
if job8wks=-3 and self08=0 then do;
r6e808=-3;
end;
if job9wks=-3 then do;
r6j809=-3;
end;
if job9wks=-3 and self09=1 then do;
r6s809=-3;
end;
if job9wks=-3 and self09=0 then do;
r6e809=-3;
end;
if job10wks=-3 then do;
r6j8010=-3;
end;
if job10wks=-3 and self10=1 then do;
r6s8010=-3;
end;
if job10wks=-3 and self10=0 then do;
r6e8010=-3;
end;
if job11wks=-3 then do;
r6j8011=-3;
end;
if job11wks=-3 and self11=1 then do;
r6s8011=-3;
end;
if job11wks=-3 and self11=0 then do;
r6e8011=-3;
end;
end;
do i=1 to 52;
if job1wks=1 then do;
r6j801=1;
end;
if job1wks=1 and self01=1 then do;
r6s801=1;
end;
if job1wks=1 and self01=0 then do;
r6e801=1;
end;
if job2wks=1 then do;
r6j802=1;
end;
if job2wks=1 and self02=1 then do;
r6s802=1;
end;
if job2wks=1 and self02=0 then do;
r6e802=1;
end;
if job3wks=1 then do;
r6j803=1;
end;
if job3wks=1 and self03=1 then do;
r6s803=1;
end;
if job3wks=1 and self03=0 then do;
r6e803=1;
end;
if job4wks=1 then do;
r6j804=1;
end;
if job4wks=1 and self04=1 then do;
r6s804=1;
end;
if job4wks=1 and self04=0 then do;
r6e804=1;
end;
if job5wks=1 then do;
r6j805=1;
end;
if job5wks=1 and self05=1 then do;
r6s805=1;
end;
if job5wks=1 and self05=0 then do;
r6e805=1;
end;
if job6wks=1 then do;
r6j806=1;
end;
if job6wks=1 and self06=1 then do;
r6s806=1;
end;
if job6wks=1 and self06=0 then do;
r6e806=1;
end;
if job7wks=1 then do;
r6j807=1;
end;
if job7wks=1 and self07=1 then do;
r6s807=1;
end;
if job7wks=1 and self07=0 then do;
r6e807=1;
end;
if job8wks=1 then do;
r6j808=1;
end;
if job8wks=1 and self08=1 then do;
r6s808=1;
end;
if job8wks=1 and self08=0 then do;
r6e808=1;
end;
if job9wks=1 then do;
r6j809=1;
end;
if job9wks=1 and self09=1 then do;
r6s809=1;
end;
if job9wks=1 and self09=0 then do;
r6e809=1;
end;
if job10wks=1 then do;
r6j8010=1;
end;
if job10wks=1 and self10=1 then do;
r6s8010=1;
end;
if job10wks=1 and self10=0 then do;
r6e8010=1;
end;
if job11wks=1 then do;
r6j8011=1;
end;
if job11wks=1 and self11=1 then do;
r6s8011=1;
end;
if job11wks=1 and self11=0 then do;
r6e8011=1;
end;
end;
if r6j801 ne -3 and r6j802 ne -3 and r6j803 ne -3 and r6j804 ne -3 and r6j805 ne
-3 and r6j806 ne -3 and r6j807 ne -3
and r6j808 ne -3 and r6j809 ne -3 and r6j8010 ne -3 and r6j8011 ne -3 then do;
r6job80=sum(r6j801,r6j802,r6j803,r6j804,r6j805,r6j806,r6j807,r6j808,r6j809,r6j8010,r6j8011);
end;
if r6j801=-3 or r6j802=-3 or r6j803=-3 or r6j804=-3 or r6j805=-3 or r6j806=-3 or
r6j807=-3 or r6j808=-3
or r6j809=-3 or r6j8010=-3 or r6j8011=-3 then do;
r6job80=-3;
end;
if r6s801 ne -3 and r6s802 ne -3 and r6s803 ne -3 and r6s804 ne -3 and r6s805 ne
-3 and r6s806 ne -3 and r6s807 ne -3
and r6s808 ne -3 and r6s809 ne -3 and r6s8010 ne -3 and r6s8011 ne -3 then do;
r6self80=sum(r6s801,r6s802,r6s803,r6s804,r6s805,r6s806,r6s807,r6s808,r6s809,r6s8010,r6s8011);
end;
if r6s801=-3 or r6s802=-3 or r6s803=-3 or r6s804=-3 or r6s805=-3 or r6s806=-3 or
r6s807=-3 or r6s808=-3
or r6s809=-3 or r6s8010=-3 or r6s8011=-3 then do;
r6self80=-3;
end;
if r6e801 ne -3 and r6e802 ne -3 and r6e803 ne -3 and r6e804 ne -3 and r6e805 ne
-3 and r6e806 ne -3 and r6e807 ne -3
and r6e808 ne -3 and r6e809 ne -3 and r6e8010 ne -3 and r6e8011 ne -3 then do;
r6emp80=sum(r6e801,r6e802,r6e803,r6e804,r6e805,r6e806,r6e807,r6e808,r6e809,r6e8010,r6e8011);
end;
if r6e801=-3 or r6e802=-3 or r6e803=-3 or r6e804=-3 or r6e805=-3 or r6e806=-3 or
r6e807=-3 or r6e808=-3
or r6e809=-3 or r6e8010=-3 or r6e8011=-3 then do;
r6emp80=-3;
end;
/*repeat the above code for 1981-2003. The do i statements for each year
are as follows:*/
/* 1981 */ do i=53 to 104;
/* 1982 */ do i=105 to 156;
/* 1983 */ do i=157 to 209;
/* 1984 */ do i=210 to 261;
/* 1985 */ do i=262 to 313;
/* 1986 */ do i=314 to 365;
/* 1987 */ do i=366 to 417;
/* 1988 */ do i=418 to 470;
/* 1989 */ do i=471 to 522;
/* 1990 */ do i=523 to 574;
/* 1991 */ do i=575 to 626;
/* 1992 */ do i=627 to 678;
/* 1993 */ do i=679 to 730;
/* 1994 */ do i=731 to 783;
/* 1995 */ do i=784 to 835;
/* 1996 */ do i=836 to 887;
/* 1997 */ do i=888 to 939;
/* 1998 */ do i=940 to 991;
/* 1999 */ do i=992 to 1043;
/* 2000 */ do i=1044 to 1096;
/* 2001 */ do i=1097 to 1148;
/* 2002 */ do i=1149 to 1200;
/* 2003 */ do i=1201 to 1252;
array r6job (k) r6job80-r6job99 r6job00-r6job03;
array r6self (k) r6self80-r6self99 r6self00-r6self03;
array r6emp (k) r6emp80-r6emp99 r6emp00-r6emp03;
*** Include non-interview cases;
do over r6job;
if e200=-5 then do;
r6job=-5; r6self=-5; r6emp=-5;
end;
end;
array r5job r5job80-r5job99 r5job00 r5job01 r5job02;
array tjob tjob80-tjob99 tjob00 tjob01 tjob02;
array r5sjob r5sjob80-r5sjob99 r5sjob00 r5sjob01 r5sjob02;
array tsjob tsjob80-tsjob99 tsjob00 tsjob01 tsjob02;
array r5ejob r5ejob80-r5ejob99 r5ejob00 r5ejob01 r5ejob02;
array tejob tejob80-tejob99 tejob00 tejob01 tejob02;
array self self1-self9;
array r5slf r5slf1-r5slf9;
do over tjob;
r5job=tjob;
r5sjob=tsjob;
r5ejob=tejob;
end;
do over self;
r5slf=self;
end;
drop tjob80-tjob99 tjob00-tjob02 tsjob80-tsjob99 tsjob00-tsjob02 tejob80-tejob99
tejob00-tejob02 self1-self9;
r5int_y=y5int_y;
/***hand edit***/
if pubid=1461 then self03=0;
/* (2-26-01) Begin by renaming the infile c.v. variables */
array r1job (i) r1job80-r1job99 r1job00-r1job03;
array r2job (i) r2job80-r2job99 r2job00-r2job03;
array r3job (i) r3job80-r3job99 r3job00-r3job03;
array r4job (i) r4job80-r4job99 r4job00-r4job03;
array r4self (i) r4sjob80-r4sjob99 r4sjob00-r4sjob03;
array r4emp (i) r4ejob80-r4ejob99 r4ejob00-r4ejob03;
array r5job (i) r5job80-r5job99 r5job00-r5job03;
array r5self (i) r5sjob80-r5sjob99 r5sjob00-r5sjob03;
array r5emp (i) r5ejob80-r5ejob99 r5ejob00-r5ejob03;
array r6job (i) r6job80-r6job99 r6job00-r6job03;
array r6self (i) r6self80-r6self99 r6self00-r6self03;
array r6emp (i) r6emp80-r6emp99 r6emp00-r6emp03;
array tjob (i) tjob80-tjob99 tjob00-tjob03;
array tsjob (i) tsjob80-tsjob99 tsjob00-tsjob03;
array tejob (i) tejob80-tejob99 tejob00-tejob03;
/* Initialize created variable */
do over tjob;
tjob=0;
tsjob=0;
tejob=0;
end;
/* Begin by adding together the created variables from all rounds. Jobs that are
double counted will be subtracted off later in the program. */
do over tjob;
if r6job>0 then do;
tjob=r6job;
end;
if r6emp>0 then do;
tejob=r6emp;
end;
if r6self>0 then do;
tsjob=r6self;
end;
if r5job>0 then do;
tjob=r5job;
end;
if r5emp>0 then do;
tejob=r5emp;
end;
if r5self>0 then do;
tsjob=r5self;
end;
if r4job>0 and r5int=-5 then do;
tjob=r4job;
end;
if r4emp>0 and r5int=-5 then do;
tejob=r4emp;
end;
if r4self>0 and r5int=-5 then do;
tsjob=r4self;
end;
if r3job>0 and r4int=-5 and r5int=-5 then do;
tjob=r3job;
tejob=r3job;
end;
if r2job>0 and r3int=-5 and r4int=-5 and r3int=-5 and r5int=-5 then do;
tjob=r2job;
tejob=r2job;
end;
if r1job>0 and r2int=-5 and r3int=-5 and r4int=-5 and r5int=-5 and intwk>0 then
do;
tjob=r1job;
tejob=r1job;
end;
if r5job>0 and r6job>0 then do;
tjob=r5job+r6job;
end;
if r5emp>0 and r6emp>0 then do;
tejob=r5emp+r6emp;
end;
if r5self>0 and r6self>0 then do;
tsjob=r5self+r6self;
end;
if r4job>0 and r6job>0 and r5int=-5 then do;
tjob=r4job+r6job;
end;
if r4emp>0 and r6emp>0 and r5int=-5 then do;
tejob=r4emp+r6emp;
end;
if r4self>0 and r6self>0 and r5int=-5 then do;
tsjob=r4self+r6self;
end;
if r3job>0 and r6job>0 and r4int=-5 and r5int=-5 then do;
tjob=r3job+r6job;
end;
if r3job>0 and r6emp>0 and r4int=-5 and r5int=-5 then do;
tejob=r3job+r6emp;
end;
if r2job>0 and r6job>0 and r3int=-5 and r4int=-5 and r5int=-5 then do;
tjob=r2job+r6job;
end;
if r2job>0 and r6emp>0 and r3int=-5 and r4int=-5 and r5int=-5 then do;
tejob=r2job+r6emp;
end;
if r1job>0 and r6job>0 and r2int=-5 and r3int=-5 and r4int=-5 and r5int=-5 then
do;
tjob=r1job+r6job;
end;
if r1job>0 and r6emp>0 and r2int=-5 and r3int=-5 and r4int=-5 and r5int=-5 then
do;
tejob=r1job+r6emp;
end;
end;
/* Define negative values for the total created variable. */
do over tjob;
if r6job in (-1,-2,-3) then tjob=-3;
if r6self in (-1,-2,-3) then tsjob=-3;
if r6emp in (-1,-2,-3) then tejob=-3;
if r5job in (-1,-2,-3) then tjob=-3;
if r5self in (-1,-2,-3) then tsjob=-3;
if r5emp in (-1,-2,-3) then tejob=-3;
if r4job in (-1,-2,-3) and r5int=-5 then tjob=-3;
if r4self in (-1,-2,-3) and r5int=-5 then tsjob=-3;
if r4emp in (-1,-2,-3) and r5int=-5 then tejob=-3;
if r3job in (-1,-2,-3) and r4int=-5 and r5int=-5 then do;
tjob=-3;
tejob=-3;
end;
if r2job in (-1,-2,-3) and r3int=-5 and r4int=-5 and r5int=-5 and intwk>0 then
do;
tjob=-3;
tejob=-3;
end;
if r1job in (-1,-2,-3) and r2int=-5 and r3int=-5 and r4int=-5 and r5int=-5 and
intwk>0 then do;
tjob=-3;
tejob=-3;
end;
end;
/* When matching jobs from Round 5 to Round 6 (for example), we only need to
worry about jobs in Round 6 with a UID
beginning with "2001" or earlier since only those jobs could have been worked in
more than 1 round. */
array r1uid (i) r1uid1-r1uid9 r1uid10 r1uid11;
array r2uid (i) r2uid1-r2uid9 r2uid10 r2uid11;
array r3uid (i) r3uid1-r3uid9 r3uid10 r3uid11;
array r4uid (i) r4uid1-r4uid9 r4uid10 r4uid11;
array r5uid (i) r5uid1-r5uid9 r5uid10 r5uid11;
array r6uid (i) uid01-uid11;
array r4slf (i) r4slf1-r4slf9 r4slf10 r4slf11; /* 1-9-03 Dummy var. for
self-employed job in Round 4. */
array r5slf (i) r5slf1-r5slf9 r5slf10 r5slf11;
array self (i) self01-self11;
array match1 (i) match1_1-match1_11;
array match2 (i) match2_1-match2_11;
array match3 (i) match3_1-match3_11;
array match4 (i) match4_1-match4_11;
array match5 (i) match5_1-match5_11;
array match6 (i) match6_1-match6_11;
array match7 (i) match7_1-match7_11;
array match8 (i) match8_1-match8_11;
array match9 (i) match9_1-match9_11;
do i=1 to 11;
match1=0; match2=0; match3=0; match4=0; match5=0; match6=0; match7=0; match8=0;
match9=0;
end;
/* Define match14 as the dummy variable that equals one when the first job on
the Round1 UID roster and the fourth job on
the Round2 roster have the same UID. There are upto 9 possible matches as of
round 6 - in round 7 the max will be 11 to
incorporate the round 6 jobs. Round 1 only has 7 jobs which is why the last two
job matches don't include r1 components. */
do over r6uid; /* If any UID from the first position in dli Round matches with
any UID in Round 6 */
if r5uid1>0 and r6uid>0 and r5int>0 and intwk>0 then do;
if r5uid1=r6uid then do;
match1=1;
end;
end;
if r4uid1>0 and r6uid>0 and r5int=-5 and intwk>0 then do;
if r4uid1=r6uid then do;
match1=1;
end;
end;
if r3uid1>0 and r6uid>0 and r5int=-5 and r4int=-5 and intwk>0 then do;
if r3uid1=r6uid then do;
match1=1;
end;
end;
if r2uid1>0 and r6uid>0 and r5int=-5 and r4int=-5 and r3int=-5 and intwk>0 then
do;
if r2uid1=r6uid then do;
match1=1;
end;
end;
if r1uid1>0 and r6uid>0 and r5int=-5 and r4int=-5 and r3int=-5 and r2int=-5 and
intwk>0 then do;
if r1uid1=r6uid then do;
match1=1;
end;
end;
end;
do over r6uid; /* If any UID from the second position in dli Round matches with
any UID in Round 6 */
if r5uid2>0 and r6uid>0 and r5int>0 and intwk>0 then do;
if r5uid2=r6uid then do;
match2=1;
end;
end;
if r4uid2>0 and r6uid>0 and r5int=-5 and r4int>0 and intwk>0 then do;
if r4uid2=r6uid then do;
match2=1;
end;
end;
if r3uid2>0 and r6uid>0 and r5int=-5 and r4int=-5 and r3int>0 and intwk>0 then
do;
if r3uid2=r6uid then do;
match2=1;
end;
end;
if r2uid2>0 and r6uid>0 and r5int=-5 and r4int=-5 and r3int=-5 and intwk>0 then
do;
if r2uid2=r6uid then do;
match2=1;
end;
end;
if r1uid2>0 and r6uid>0 and r5int=-5 and r4int=-5 and r3int=-5 and r2int=-5 and
intwk>0 then do;
if r1uid2=r6uid then do;
match2=1;
end;
end;
end;
/*repeat above code for UIDs in positions 3-9 in dli round*/
/* Define "same98" as a counter variable that adds up how many matching UIDs are
in the respondent's UID roster. This will
be subtracted from the total number of jobs created variable to avoid double
counting the same job. Begin by initializing
the "same" variables to zero. */
same97=0;
same98=0;
same99=0;
same00=0;
same01=0;
same02=0;
ssame97=0;
ssame98=0;
ssame99=0;
ssame00=0;
ssame01=0;
ssame02=0;
array r1j97 (i) r1j971 r1j972 r1j973 r1j974 r1j975 r1j976 r1j977 r1j978 r1j979
r1j9710 r1j9711;
array r1j98 (i) r1j981 r1j982 r1j983 r1j984 r1j985 r1j986 r1j987 r1j988 r1j989
r1j9810 r1j9811;
array r2j98 (i) r2j981 r2j982 r2j983 r2j984 r2j985 r2j986 r2j987 r2j988 r2j989
r2j9810 r2j9811;
array r2j99 (i) r2j991 r2j992 r2j993 r2j994 r2j995 r2j996 r2j997 r2j998 r2j999
r2j9910 r2j9911;
array r3j99 (i) r3j991 r3j992 r3j993 r3j994 r3j995 r3j996 r3j997 r3j998 r3j999
r3j9910 r3j9911;
array r3j00 (i) r3j001 r3j002 r3j003 r3j004 r3j005 r3j006 r3j007 r3j008 r3j009
r3j0010 r3j0011;
array r4j00 (i) r4j001 r4j002 r4j003 r4j004 r4j005 r4j006 r4j007 r4j008 r4j009
r4j0010 r4j0011;
array r4j01 (i) r4j011 r4j012 r4j013 r4j014 r4j015 r4j016 r4j017 r4j018 r4j019
r4j0110 r4j0111;
array r5j01 (i) r5j011 r5j012 r5j013 r5j014 r5j015 r5j016 r5j017 r5j018 r5j019
r5j0110 r5j0111;
array r5j02 (i) r5j021 r5j022 r5j023 r5j024 r5j025 r5j026 r5j027 r5j028 r5j029
r5j0210 r5j0211;
array r6j97 (i) r6j971 r6j972 r6j973 r6j974 r6j975 r6j976 r6j977 r6j978 r6j979
r6j9710 r6j9711;
array r6j98 (i) r6j981 r6j982 r6j983 r6j984 r6j985 r6j986 r6j987 r6j988 r6j989
r6j9810 r6j9811;
array r6j99 (i) r6j991 r6j992 r6j993 r6j994 r6j995 r6j996 r6j997 r6j998 r6j999
r6j9910 r6j9911;
array r6j00 (i) r6j001 r6j002 r6j003 r6j004 r6j005 r6j006 r6j007 r6j008 r6j009
r6j0010 r6j0011;
array r6j01 (i) r6j011 r6j012 r6j013 r6j014 r6j015 r6j016 r6j017 r6j018 r6j019
r6j0110 r6j0111;
array r6j02 (i) r6j021 r6j022 r6j023 r6j024 r6j025 r6j026 r6j027 r6j028 r6j029
r6j0210 r6j0211;
array r6j03 (i) r6j031 r6j032 r6j033 r6j034 r6j035 r6j036 r6j037 r6j038 r6j039
r6j0310 r6j0311;
/* Consider the respondents with a Round 1 interview date in 1997, non-interview
cases only. */
if r1int_y=1997 and r2int=-5 and r3int=-5 and r4int=-5 and r5int=-5 and intwk>0
then do;
do over match1;
if match1=1 and r6j97=1 and r1j971=1 then do;
same97=same97+1;
end;
end;
do over match2;
if match2=1 and r6j97=1 and r1j972=1 then do;
same97=same97+1;
end;
end;
/*repeat for match3-match9*/
end;
/* Consider the respondents with a Round 1 interview date in 1998, non-interview
cases only. */
if r1int_y=1998 and r2int=-5 and r3int=-5 and r4int=-5 and r5int=-5 and intwk>0
then do;
do over match1;
if match1=1 and r6j98=1 and r1j981=1 then do;
same98=same98+1;
end;
end;
do over match2;
if match2=1 and r6j98=1 and r1j982=1 then do;
same98=same98+1;
end;
end;
/*repeat for match3-match9*/
end;
/* Consider the respondents with a Round 2 interview date in 1998. */
if r2int_y=1998 and r3int=-5 and r4int=-5 and r5int=-5 and intwk>0 then do;
do over match1;
if match1=1 and r6j98=1 and r2j981=1 then do;
same98=same98+1;
end;
end;
do over match2;
if match2=1 and r6j98=1 and r2j982=1 then do;
same98=same98+1;
end;
end;
/*repeat for match3-match9*/
end;
/* Consider the respondents with a Round 2 interview date in 1999. */
if r2int_y=1999 and r3int=-5 and r4int=-5 and r5int=-5 and intwk>0 then do;
do over match1;
if match1=1 and r6j99=1 and r2j991=1 then do;
same99=same99+1;
end;
end;
do over match2;
if match2=1 and r6j99=1 and r2j992=1 then do;
same99=same99+1;
end;
end;
/*repeat for match3-match9*/
end;
/* Consider the respondents with a Round 3 interview date in 1999. */
if r3int_y=1999 and r4int=-5 and r5int=-5 and intwk>0 then do;
do over match1;
if match1=1 and r6j99=1 and r3j991=1 then do;
same99=same99+1;
end;
end;
do over match2;
if match2=1 and r6j99=1 and r3j992=1 then do;
same99=same99+1;
end;
end;
/*repeat for match3-match9*/
end;
/* Consider the respondents with a Round 3 interview date in 2000. */
if r3int_y=2000 and r4int=-5 and r5int=-5 and intwk>0 then do;
do over match1;
if match1=1 and r6j00=1 and r3j001=1 then do;
same00=same00+1;
end;
end;
do over match2;
if match2=1 and r6j00=1 and r3j002=1 then do;
same00=same00+1;
end;
end;
/*repeat for match3-match9*/
end;
/* Consider the respondents with a Round 5 interview date in 2002. */
/* 1-9-03 "ssame" refers to a match of self-employed jobs, only needed for Round
4 and beyond since there were no self-employed jobs
on the roster before Round 4. Need to add back5=1 condition to account for
backreporters who reported jobs before the
interview year. */
if (r5int_y=2002 and intwk>0) or back5=1 then do;
do over match1;
if match1=1 and r6j02=1 and r5j021=1 then do;
same02=same02+1;
end;
if match1=1 and r6j02=1 and r5j021=1 and self=1 and r5slf1=1 then do;
ssame02=ssame02+1;
end;
end;
do over match2;
if match2=1 and r6j02=1 and r5j022=1 then do;
same02=same02+1;
end;
if match2=1 and r6j02=1 and r5j022=1 and self=1 and r5slf2=1 then do;
ssame02=ssame02+1;
end;
end;
/*repeat for match3-match9*/
end;
/* Consider the respondents with a Round 5 interview date in 2001. */
if r5int_y=2001 and intwk>0 then do;
do over match1;
if match1=1 and r6j01=1 and r5j011=1 then do;
same01=same01+1;
end;
if match1=1 and r6j01=1 and r5j011=1 and self=1 and r5slf1=1 then do;
ssame01=ssame01+1;
end;
end;
do over match2;
if match2=1 and r6j01=1 and r5j012=1 then do;
same01=same01+1;
end;
if match2=1 and r6j01=1 and r5j012=1 and self=1 and r5slf2=1 then do;
ssame01=ssame01+1;
end;
end;
/*repeat for match3-match9*/
end;
/* Consider the respondents with a Round 4 interview date in 2000. */
if (r4int_y=2000 and intwk>0) or back4=1 then do;
do over match1;
if match1=1 and r6j00=1 and r4j001=1 then do;
same00=same00+1;
end;
if match1=1 and r6j00=1 and r4j001=1 and self=1 and r4slf1=1 then do;
ssame00=ssame00+1;
end;
end;
do over match2;
if match2=1 and r6j00=1 and r4j002=1 then do;
same00=same00+1;
end;
if match2=1 and r6j00=1 and r4j002=1 and self=1 and r4slf2=1 then do;
ssame00=ssame00+1;
end;
end;
/*repeat for match3-match9*/
end;
/* Consider the respondents with a Round 4 interview date in 2001. */
if r4int_y=2001 and intwk>0 then do;
do over match1;
if match1=1 and r6j01=1 and r4j011=1 then do;
same01=same01+1;
end;
if match1=1 and r6j01=1 and r4j011=1 and self=1 and r4slf1=1 then do;
ssame01=ssame01+1;
end;
end;
do over match2;
if match2=1 and r6j01=1 and r4j012=1 then do;
same01=same01+1;
end;
if match2=1 and r6j01=1 and r4j012=1 and self=1 and r4slf2=1 then do;
ssame01=ssame01+1;
end;
end;
/*repeat for match3-match9*/
end;
/* 1-9-03 This checks finds those with matching jobs that were self-employed in
one year and then not the next. */
do over match1;
if match1=1 then do;
if (self=1 and r5slf1=0) or (self=0 and r5slf1=1) then do;
trouble=1;
end;
end;
if match2=1 then do;
if (self=1 and r5slf2=0) or (self=0 and r5slf2=1) then do;
trouble=1;
end;
end;
/*repeat for match3-match9*/
end;
/* 1-9-03 By construction of the same variable, employeee-type same must be the
difference between total and self-employed
same. This variable is only necessary for Round 4 (years 00 and 01) since
self-employed jobs were not on the roster until
Round 4. */
esame00=0;
esame01=0;
esame02=0;
esame00=same00-ssame00;
esame01=same01-ssame01;
esame02=same02-ssame02;
/* Now subtract the "same" count variable from the total created variable
computed above. */
if tjob97=>0 then do;
tjob97=tjob97-same97;
end;
if tejob97=>0 then do;
tejob97=tejob97-same97;
end;
if tjob98=>0 then do;
tjob98=tjob98-same98;
end;
if tejob98=>0 then do;
tejob98=tejob98-same98;
end;
if tjob99=>0 then do;
tjob99=tjob99-same99;
end;
if tejob99=>0 then do;
tejob99=tejob99-same99;
end;
if tjob00=>0 then do;
tjob00=tjob00-same00;
end;
if tejob00=>0 then do;
tejob00=tejob00-esame00;
end;
if tsjob00=>0 then do;
tsjob00=tsjob00-ssame00;
end;
if tjob01=>0 then do;
tjob01=tjob01-same01;
end;
if tejob01=>0 then do;
tejob01=tejob01-esame01;
end;
if tsjob01=>0 then do;
tsjob01=tsjob01-ssame01;
end;
if tjob02=>0 then do;
tjob02=tjob02-same02;
end;
if tejob02=>0 then do;
tejob02=tejob02-esame02;
end;
if tsjob02=>0 then do;
tsjob02=tsjob02-ssame02;
end;
/* Round 6 Non-interview cases */
do over tjob;
if uid01=-5 then do;
tjob=-5;
tejob=-5;
tsjob=-5;
end;
end;
endsas;
Variables Created: r6emp14
r6job14
r6emp20
r6job20
Programs Used
This program uses emp_begin.sas as input (follow hyperlink for details).
This program calculates the total number of employee-type jobs held by the respondent between the ages of 14 and 19. It then creates two variables for the total number of jobs held by the respondent since age 20: one for all jobs and one for employee-type jobs. See the introduction to this appendix for important information about the universes for each of these variables. The variables are only created for respondents who have worked at least one week in the applicable age range.
array job1wks (i) w1_1-w1_1253;
array job2wks (i) w2_1-w2_1253;
array job3wks (i) w3_1-w3_1253;
array job4wks (i) w4_1-w4_1253;
array job5wks (i) w5_1-w5_1253;
array job6wks (i) w6_1-w6_1253;
array job7wks (i) w7_1-w7_1253;
array job8wks (i) w8_1-w8_1253;
array job9wks (i) w9_1-w9_1253;
array job10wks (i) w10_1-w10_1253;
array job11wks (i) w11_1-w11_1253;
***************************************************************************
** Indicate if worked at least one week on a given job since age 14 & 20 **
***************************************************************************;
e141=0; j141=0; j201=0; e201=0;
e142=0; j142=0; j202=0; e202=0;
e143=0; j143=0; j203=0; e203=0;
e144=0; j144=0; j204=0; e204=0;
e145=0; j145=0; j205=0; e205=0;
e146=0; j146=0; j206=0; e206=0;
e147=0; j147=0; j207=0; e207=0;
e148=0; j148=0; j208=0; e208=0;
e149=0; j149=0; j209=0; e209=0;
e1410=0; j1410=0; j2010=0; e2010=0;
e1411=0; j1411=0; j2011=0; e2011=0;
* the ending week for the count "between age 14 and 20" depending on whether the
respondent turns to 20 or not;
end14wk=min(age20wk-1, 1253);
* the count for "between age 14 and 20"--all jobs;
do i=age14wk to end14wk;
if job1wks in (-3,1) then do;
j141=1;
end;
if job2wks in (-3,1) then do;
j142=1;
end;
/*and so on through*/
if job11wks in (-3,1) then do;
j1411=1;
end;
end;
* the count for "between age 14 and 20"--employee type jobs;
do i=age14wk to end14wk;
if job1wks in (-3,1) and self01=0 then do;
e141=1;
end;
if job2wks in (-3,1) and self02=0 then do;
e142=1;
end;
/*and so on through*/
if job11wks in (-3,1) and self11=0 then do;
e1411=1;
end;
end;
* the count for "since age 20" for those who are over 20 at interview date--all
jobs;
if age14wk>0 and age20wk<=1253 then do;
do i=age20wk to 1253;
if job1wks in (-3,1) then do;
j201=1;
end;
if job2wks in (-3,1) then do;
j202=1;
end;
/*and so on through*/
if job11wks in (-3,1) then do;
j2011=1;
end;
end;
end;
* the count for "since age 20" for those who are over 20 at interview
date--employee type jobs;
if age14wk>0 and age20wk<=1253 then do;
do i=age20wk to 1253;
if job1wks in (-3,1) and self01=0 then do;
e201=1;
end;
if job2wks in (-3,1) and self02=0 then do;
e202=1;
end;
/*and so on through*/
if job11wks in (-3,1) and self11=0 then do;
e2011=1;
end;
end;
end;
r6job14=sum(j141,j142,j143,j144,j145,j146,j147,j148,j149,j1410,j1411);
r6emp14=sum(e141,e142,e143,e144,e145,e146,e147,e148,e149,e1410,e1411);
r6job20=sum(j201,j202,j203,j204,j205,j206,j207,j208,j109,j2010,j2011);
r6emp20=sum(e201,e202,e203,e204,e205,e206,e207,e208,e209,e2010,e2011);
******** assign -3 to cases with unknown stop dates or unknown start dates;
array starw (k) starw01-starw11;
array stopw (k) stopw01-stopw11;
array starf (k) starf_1-starf_11;
array stopf (k) stopf_1-stopf_11;
array self (k) self01-self11;
do k=1 to 11;
if stopf=1 and starf ne 1 and starw<age14wk and stopw>age14wk and self=0 then
r6emp14=-3;
if stopf=1 and starf ne 1 and starw<age14wk and stopw>age14wk then r6job14=-3;
if stopf=1 and starf ne 1 and starw<age20wk and stopw>age20wk and age20wk<intwk
and self=0 then r6emp20=-3;
if stopf=1 and starf ne 1 and starw<age20wk and stopw>age20wk and age20wk<intwk
then r6job20=-3;
if starf=1 and stopf ne 1 and stopw>age20wk and starw<age20wk and self=0 then
r6emp14=-3;
if starf=1 and stopf ne 1 and stopw>age20wk and starw<age20wk then r6job14=-3;
end;
if e200=-5 then do;
r6emp14=-5;
r6job14=-5;
r6job20=-5;
r6emp20=-5;
end;
array job14 (i) job141-job148;
array job20 (i) job201-job208;
array r5j14 (i) r5j141-r5j148;
array r5j20 (i) r5j201-r5j208;
array self (i) self1-self8;
array r5self (i) r5self1-r5self8;
do over job14;
r5j14=job14;
r5j20=job20;
end;
do over self;
r5self=self;
end;
r5emp14=totemp14;
r5job20=totjob20;
r5emp20=totemp20;
/* 12-18-01 Initialize final created variable */
totemp14=0;
totjob20=0;
totemp20=0;
/* Begin by adding together the created variables from both rounds. Jobs that
are double counted will be subtracted off later in the program. */
if r6emp14>0 then do;
totemp14=r6emp14;
end;
if r5emp14>0 then do;
totemp14=r5emp14;
end;
if r4emp14>0 and r5int=-5 then do;
totemp14=r4emp14;
end;
if r3job14>0 and r4int=-5 and r5int=-5 then do;
totemp14=r3job14;
end;
if r2job14>0 and r3int=-5 and r4int=-5 and r5int=-5 and intwk>0 then do;
totemp14=r2job14;
end;
if r1job14>0 and r5int=-5 and r4int=-5 and r3int=-5 and r2int=-5 and intwk>0
then do;
totemp14=r1job14;
end;
if r5emp14>0 and r6emp14>0 then do;
totemp14=r5emp14+r6emp14;
end;
if r4emp14>0 and r6emp14>0 and r5int=-5 then do;
totemp14=r4emp14+r6emp14;
end;
if r3job14>0 and r6emp14>0 and r4int=-5 and r5int=-5 then do;
totemp14=r3job14+r6emp14;
end;
if r2job14>0 and r6emp14>0 and r3int=-5 and r4int=-5 and r5int=-5 then do;
totemp14=r2job14+r6emp14;
end;
if r1job14>0 and r6emp14>0 and r2int=-5 and r3int=-5 and r4int=-5 and r5int=-5
then do;
totemp14=r1job14+r6emp14;
end;
if r6job20>0 then do;
totjob20=r6job20;
end;
if r5job20>0 then do;
totjob20=r5job20;
end;
if r4job20>0 and r5int=-5 then do;
totjob20=r4job20;
end;
if r3job20>0 and r5int=-5 and r4int=-5 then do;
totjob20=r3job20;
end;
if r5job20>0 and r6job20>0 then do;
totjob20=r5job20+r6job20;
end;
if r4job20>0 and r6job20>0 and r5int=-5 then do;
totjob20=r4job20+r6job20;
end;
if r3job20>0 and r6job20>0 and r4int=-5 and r5int=-5 then do;
totjob20=r3job20+r6job20;
end;
if r6emp20>0 then do;
totemp20=r6emp20;
end;
if r5emp20>0 then do;
totemp20=r5emp20;
end;
if r4emp20>0 and r5int=-5 then do;
totemp20=r4emp20;
end;
if r3job20>0 and r4int=-5 and r5int=-5 then do;
totemp20=r3job20;
end;
if r5emp20>0 and r6emp20>0 then do;
totemp20=r5emp20+r6emp20;
end;
if r4emp20>0 and r6emp20>0 and r5int=-5 then do;
totemp20=r4emp20+r6emp20;
end;
if r3job20>0 and r6emp20>0 and r4int=-5 and r5int=-5 then do;
totemp20=r3job20+r6emp20;
end;
/* Jobs that are worked in 1998 or 1999 have the possibility of being double
counted since they are counted in
each Round's created variable programs. Here we will try to compare the UID's to
see which jobs are double counted. */
array r5j14 (i) r5j141-r5j149 r5j1410 r5j1411;
array r5j20 (i) r5j201-r5j209 r5j2010 r5j2011;
array job14 (i) e141-e149 e1410 e1411;
array job20 (i) j201-j209 j2010 j2011;
array r1uid (i) r1uid1-r1uid9 r1uid10 r1uid11;
array r2uid (i) r2uid1-r2uid9 r2uid10 r2uid11;
array r3uid (i) r3uid1-r3uid9 r3uid10 r3uid11;
array r4uid (i) r4uid1-r4uid9 r4uid10 r4uid11;
array r5uid (i) r5uid1-r5uid9 r5uid10 r5uid11;
array r6uid (i) uid01-uid11;
array r4slf (i) r4slf1-r4slf9 r4slf10 r4slf11; /* 1-9-03 Dummy var. for
self-employed job in Round 4. */
array r5slf (i) r5slf1-r5slf9 r5slf10 r5slf11;
array self (i) self01-self11;
array r5self (i) r5self1-r5self11;
array match1 (i) match1_1-match1_11;
array match2 (i) match2_1-match2_11;
array match3 (i) match3_1-match3_11;
array match4 (i) match4_1-match4_11;
array match5 (i) match5_1-match5_11;
array match6 (i) match6_1-match6_11;
array match7 (i) match7_1-match7_11;
array match8 (i) match8_1-match8_11;
array match9 (i) match9_1-match9_11;
do i=1 to 11;
match1=0; match2=0; match3=0; match4=0; match5=0; match6=0; match7=0; match8=0;
match9=0;
end;
/* Define match14 as the dummy variable that equals one when the first job on
the Round1 UID roster and the fourth job on
the Round2 roster have the same UID. There are upto 9 possible matches as of
round 6 - in round 7 the max will be 11 to
incorporate the round 6 jobs. Round 7 only has 7 jobs which is why the last two
job matches don't include r1 components. */
do over r6uid; /* If any UID from the first position in dli Round matches with
any UID in Round 6 */
if r5uid1>0 and r6uid>0 and r5int>0 and intwk>0 then do;
if r5uid1=r6uid then do;
match1=1;
end;
end;
if r4uid1>0 and r6uid>0 and r5int=-5 and intwk>0 then do;
if r4uid1=r6uid then do;
match1=1;
end;
end;
if r3uid1>0 and r6uid>0 and r5int=-5 and r4int=-5 and intwk>0 then do;
if r3uid1=r6uid then do;
match1=1;
end;
end;
if r2uid1>0 and r6uid>0 and r5int=-5 and r4int=-5 and r3int=-5 and intwk>0 then
do;
if r2uid1=r6uid then do;
match1=1;
end;
end;
if r1uid1>0 and r6uid>0 and r5int=-5 and r4int=-5 and r3int=-5 and r2int=-5 and
intwk>0 then do;
if r1uid1=r6uid then do;
match1=1;
end;
end;
end;
do over r6uid; /* If any UID from the second position in dli Round matches with
any UID in Round 6 */
if r5uid2>0 and r6uid>0 and r5int>0 and intwk>0 then do;
if r5uid2=r6uid then do;
match2=1;
end;
end;
if r4uid2>0 and r6uid>0 and r5int=-5 and r4int>0 and intwk>0 then do;
if r4uid2=r6uid then do;
match2=1;
end;
end;
if r3uid2>0 and r6uid>0 and r5int=-5 and r4int=-5 and r3int>0 and intwk>0 then
do;
if r3uid2=r6uid then do;
match2=1;
end;
end;
if r2uid2>0 and r6uid>0 and r5int=-5 and r4int=-5 and r3int=-5 and intwk>0 then
do;
if r2uid2=r6uid then do;
match2=1;
end;
end;
if r1uid2>0 and r6uid>0 and r5int=-5 and r4int=-5 and r3int=-5 and r2int=-5 and
intwk>0 then do;
if r1uid2=r6uid then do;
match2=1;
end;
end;
end;
/*repeat above code for UIDs in positions 3-9 in DLI round*/
/* Define "same" as a counted variable that adds up how many matching UIDs are
in the respondent's UID roster. This will
be subtracted from the total number of jobs created variable to avoid double
counting the same job. Begin by initializing
the "same" variables to zero. */
same14=0;
same20=0;
esame20=0;
do over match1;
if match1=1 and r5j141=1 and job14=1 and r5self1=0 and self=0 then do;
same14=same14+1;
end;
if match1=1 and r5j201=1 and job20=1 then do;
same20=same20+1;
end;
if match1=1 and r5j201=1 and job20=1 and r5self1=0 and self=0 then do;
esame20=esame20+1;
end;
/* round 4*/
if match1=1 and r4j141=1 and job14=1 and r4self1=0 and self=0 and r5int=-5 then
do;
same14=same14+1;
end;
if match1=1 and r4j201=1 and job20=1 and r5int=-5 then do;
same20=same20+1;
end;
if match1=1 and r4j201=1 and job20=1 and r4self1=0 and self=0 and r5int=-5 then
do;
esame20=esame20+1;
end;
/* 1-9-03 dli is Round 3, No need for to account for self employed jobs because
all jobs Round 3 and earlier are employee-type. */
if match1=1 and r3j141=1 and job14=1 and r5int=-5 and r4int=-5 then do;
same14=same14+1;
end;
if match1=1 and r3j201=1 and job20=1 and r5int=-5 and r4int=-5 then do;
same20=same20+1;
esame20=esame20+1;
end;
/* 1-9-03 dli is Round 2. No need for same20 here since everyone in the sample
was under 20 during Rounds 1 and 2. */
if match1=1 and job14=1 and r5int=-5 and r4int=-5 and r3int=-5 then do;
same14=same14+1;
end;
/* 1-9-03 dli is Round 1 */
if match1=1 and job14=1 and r5int=-5 and r4int=-5 and r3int=-5 and r2int=-5 then
do;
same14=same14+1;
end;
end;
do over match2;
if match2=1 and r5j141=1 and job14=1 and r5self1=0 and self=0 then do;
same14=same14+1;
end;
if match2=1 and r5j201=1 and job20=1 then do;
same20=same20+1;
end;
if match2=1 and r5j201=1 and job20=1 and r5self1=0 and self=0 then do;
esame20=esame20+1;
end;
/* round 4*/
if match2=1 and r4j141=1 and job14=1 and r4self1=0 and self=0 and r5int=-5 then
do;
same14=same14+1;
end;
if match2=1 and r4j201=1 and job20=1 and r5int=-5 then do;
same20=same20+1;
end;
if match2=1 and r4j201=1 and job20=1 and r4self1=0 and self=0 and r5int=-5 then
do;
esame20=esame20+1;
end;
/* 1-9-03 dli is Round 3, No need for to account for self employed jobs because
all jobs Round 3 and earlier are employee-type. */
if match2=1 and r3j141=1 and job14=1 and r5int=-5 and r4int=-5 then do;
same14=same14+1;
end;
if match2=1 and r3j201=1 and job20=1 and r5int=-5 and r4int=-5 then do;
same20=same20+1;
esame20=esame20+1;
end;
/* 1-9-03 dli is Round 2. No need for same20 here since everyone in the sample
was under 20 during Rounds 1 and 2. */
if match2=1 and job14=1 and r5int=-5 and r4int=-5 and r3int=-5 then do;
same14=same14+1;
end;
/* 1-9-03 dli is Round 1 */
if match2=1 and job14=1 and r5int=-5 and r4int=-5 and r3int=-5 and r2int=-5 then
do;
same14=same14+1;
end;
end;
/*repeat the above code for match3-match9*/
/* Now subtract the "same" count variable from the total created variable
computed above. */
if totemp14=>0 then do;
totemp14=totemp14-same14;
end;
if totjob20=>0 then do;
totjob20=totjob20-same20;
end;
if totemp20=>0 then do;
totemp20=totemp20-esame20;
end;
/* Define negative values for the total created variable. */
if r1job14 in (-1,-2,-3) and intwk>0 and r5int=-5 and r4int=-5 and r3int=-5 and
r2int=-5 then totemp14=-3;
if r2job14 in (-1,-2,-3) and intwk>0 and r5int=-5 and r4int=-5 and r3int=-5 then
totemp14=-3;
if r3job14 in (-1,-2,-3) and intwk>0 and r5int=-5 and r4int=-5 then totemp14=-3;
if r4emp14 in (-1,-2,-3) and intwk>0 and r5int=-5 then totemp14=-3;
if r5emp14 in (-1,-2,-3) then totemp14=-3;
if r6emp14 in (-1,-2,-3) then totemp14=-3;
if r3job20 in (-1,-2,-3) and r5int=-5 and r4int=-5 and intwk>0 then totjob20=-3;
if r4job20 in (-1,-2,-3) and r5int=-5 and intwk>0 then totjob20=-3;
if r5job20 in (-1,-2,-3) then totjob20=-3;
if r6job20 in (-1,-2,-3) then totjob20=-3;
if r3job20 in (-1,-2,-3) and r5int=-5 and r4int=-5 and intwk>0 then totemp20=-3;
if r4emp20 in (-1,-2,-3) and r5int=-5 and intwk>0 then totemp20=-3;
if r5emp20 in (-1,-2,-3) then totemp20=-3;
if r6emp20 in (-1,-2,-3) then totemp20=-3;
/* 2-25-02 For respondents younger than 20 at interview date, their thrs14 c.v.
will be -4. */
if age20wk>intwk and intwk>0 then do;
totjob20=-4;
totemp20=-4;
end;
if uid01=-5 then do;
totemp14=-5;
totjob20=-5;
totemp20=-5;
end;
endsas;
Variables Created: CV_JOB<13_WKS.01-.11
Variables Used
| E3770101-E3770111 | YEMP-37701.01-.11 |
| E37901B01-E37901B11 | YEMP-37901B.01-.11 |
| E5820101-E5820107 | YEMP-58201.01-.07 |
| E5990001-E5990007 | YEMP-59900.01-.07 |
| E5840101-E5840111 | YEMP-58401.01-.11 |
| pubid | PUBID |
This program is to create the dummy variable for each job length. Value "1"
to this dummy variable indicates that a job
lasts less than or equal to 13 weeks. And value "0" means that the job lasts
more than 13 weeks.
***** Define the arrays for the used variables;
array e37701 e3770101-e3770111;
array e58201 e5820101-e5820111;
array e37901b e37901b01-e37901b11;
array e59900 e5990001-e5990011;
array e58401 e5840101-e5840111;
***** Define the arrays for the created variables;
array jleng jleng01-jleng11;
***** initialize the variables;
do i=1 to 11;
jleng[i]=-4;
end;
***** Create the variables;
do i=1 to 11;
if e37701[i]=0 or e37901b[i]=0 then jleng[i]=1;
else if e58201[i]=0 or e59900[i]=0 then jleng[i]=1;
else if e58401[i]=1 then jleng[i]=1;
else if e37901b[i]=1 or e59900[i]=1 then jleng[i]=0;
else if e37901b[i] in (-1,-2,-3) or e59900[i] in (-1,-2,-3) then jleng[i]=-3;
/* Since people who answer e58401 already answer e37701(e37901b) or e58201(e59900), don't assign -3 based on the invalid answer to e58401. */
else if e3770101=-5 then jleng[i]=-5;
end;
endsas;