Appendix 2: Employment Variable Creation

Return to Table of Contents


Introduction

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.

Return to top


Job Length Less Than 13 Weeks

Variables Created: CV_JOB<13_WKS.01-.11

Variables Used

E3770101-E3770108 YEMP-37701.01-.08
E37901B01-E37901B09 YEMP-37901B.01-.09
E5820101-E5820110 YEMP-58201.01-.10
E5990001-E5990010 YEMP-59900.01-.10
E5840101-E5840110 YEMP-58401.01-.10
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 answeer e58401 already answer e37701(e37901b) or e58201(e59900), so here I don't assign
-3 based on the invalid answer to e58401. */
else if e3770101=-5 then jleng[i]=-5;
end;

endsas;

Return to top


Main Employment Program

All employer-related variables except rate of pay and job length <13 weeks are created using a single large program. This program is very long and is divided into several HTML files to speed downloads and viewing.  The main file sections are as follows (each contained in a separate file):

The input variables are also listed in a separate file. This file is in Acrobat PDF format. Users who need to access the variable list in a different format should contact NLS User Services.

Variables Created by Main Employment Program

Topic Question Name in Data Set Notes
Number of Weeks Worked during 19xx/20xx CV_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
This variable is created for each individual for each year of potential work activity (1980-2003) Respondents not working in a given year are given a default value of zero (0) weeks worked. Otherwise, the variable indicates the actual cumulative weeks worked on all jobs in that year.
Number of Weeks Worked since Last Interview CV_WKSWK_DLI_ALL
CV_WKSWK_DLI_ET
CV_WKSWK_DLI_SE
For each individual, this variable 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. Respondents not working in a given year are given a default value of zero.
Number of Weeks Worked Age 14-19, Weeks Worked at All Jobs Since Age 20, and Weeks Worked at Employee-Type Jobs Since Age 20 CV_WKSWK_TEEN
CV_WKSWK_ADULT_ET
CV_WKSWK_ADULT_ALL
For each respondent, this variable counts the number of weeks worked at any employee-type job between the ages of 14 and 19. Two additional variables count weeks worked from age 20 to the present; one totals all jobs and one presents only employee jobs. 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.
Weeks Worked at Employee Job #x during 19xx/20xx CV_WKSWK_JOB_YR.01.xx-CV_WKSWK_JOB_YR.11.xx Variables for each of the respondent's jobs count 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).
Total Tenure at Job #x as of the Survey Date CV_WKSWK_JOB_DLI.xx Variable for each job calculate 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).
Total Hours Worked in 19xx/20xx  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
These variables calculate 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 starting in round 4. 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.
Total Hours Worked Age 14-19, Hours Worked at All Jobs Since Age 20, and Hours Worked at Employee-Type Jobs Since Age 20 CV_HOURS_WK_TEEN
CV_HOURS_WK_ADULT_ALL
CV_HOURS_WK_ADULT_ET
One variable presents the number of hours worked by the respondent at all employee-type jobs between the ages of 14 and 19. There are two variables for the number of hours worked by the respondent since age 20: one for all jobs and one for employee-type jobs. 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.
Number of Jobs Held during 19xx/20xx CV_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
These variables count 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. These variables are created only for respondents who have worked at least one week in the applicable calendar year.
Total Number of Jobs Held Age 14-19, Number of Employee Jobs Held since Age 20, and Number of All Jobs Held since Age 20 CV_TTL_JOBS_TEEN
CV_TTL_JOBS_ADULT_ET
CV_ TTL_JOBS_ADULT_ALL
One variable presents the total number of employee-type jobs held by the respondent between the ages of 14 and 19. There are 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. The variables are only created for respondents who have worked at least one week in the applicable age range.

 

Return to top


Hourly Rate of Pay

Variables Created:  CV_HRLY_PAY.xx

Variables Used

Name in Program Question Name   Name in Program Question Name   Name in Program Question Name
E1920001-E1920008 YEMP-19200.01-.08   E22604022 YEMP-22604.02~000002   E8710005 YEMP-87100.05
E2290001-E2290008 YEMP-22900.01-.08   E22604031 YEMP-22604.03~000001   E8800001-E8800010 YEMP-88000.01-.10
E2300001-E2300008 YEMP-23000.01-.08   E22604032 YEMP-22604.03~000002   E9730001-E9730006 YEMP-97300.01-.06
E2320001 YEMP-23200.01   E22604041 YEMP-22604.04~000001   E9740001 YEMP-97400.01
E2320002 YEMP-23200.02   E22604042 YEMP-22604.04~000002   E9740002 YEMP-97400.02
E2320003 YEMP-23200.03   E2260901 YEMP-22609.01.01   E9740003 YEMP-97400.03
E2320004 YEMP-23200.04   E2260903 YEMP-22609.03.01   E9740004 YEMP-97400.04
E2390001 YEMP-23900.01   E2261001 YEMP-22610.01.02   E9740005 YEMP-97400.05
E2390002 YEMP-23900.02   E2261002 YEMP-22610.02.02   E9750001 YEMP-97500.01
E2390101-E2390108 YEMP-23901.01-.08   E2261003 YEMP-22610.03.02   E9750002 YEMP-97500.02
E3340001-E3340006 YEMP-33400.01-.06   E2262601 YEMP-22626.01.01   E9750003 YEMP-97500.03
E3350001 YEMP-33500.01   E2262603 YEMP-22626.03.01   E9750004 YEMP-97500.04
E3350002 YEMP-33500.02   E38000B01-E38000B08 YEMP-38000B.01-.08   E9830001 YEMP-98300.01
E3350003 YEMP-33500.03   E38000F01-E38000F09 YEMP-38000F.01-.09   E9830002 YEMP-98300.02
E3350004 YEMP-33500.04   E3800201 YEMP-38002.01   E9840201-E9840206 YEMP-98402.01-.06
E3350005 YEMP-33500.05   E3800202 YEMP-38002.02   E98402CAA01-E98402CAA06 YEMP-98402CAA.01-.06
E3360001 YEMP-33600.01   E3800203 YEMP-38002.03   E98402CAB01-E98402CAB06 YEMP-98402CAB.01-.06
E3360002 YEMP-33600.02   E3800204 YEMP-38002.04   E98402D01 YEMP-98402D.01
E3360003 YEMP-33600.03   E3801301-E3801309 YEMP-38013.01-.09   E98402D02 YEMP-98402D.02
E3360004 YEMP-33600.04   E3801401-E3801409 YEMP-38014.01-.09   E98402D03 YEMP-98402D.03
E3440201-E3440206 YEMP-34402.01-.06   E3802301-E3802309 YEMP-38023.01-.09   E98402D04 YEMP-98402D.04
E34402AAB01 YEMP-34402AAB.01   E38024B01 YEMP-38024B.01   E9842901 YEMP-98429.01
E34402AAB02 YEMP-34402AAB.02   E38024B02 YEMP-38024B.02   E9842902 YEMP-98429.02
E34402AAB03 YEMP-34402AAB.03   E38024C01 YEMP-38024C.01   E9842903 YEMP-98429.03
E34402AAB04 YEMP-34402AAB.04   E38024C02 YEMP-38024C.02   E9842904 YEMP-98429.04
E34402AAB05 YEMP-34402AAB.05   E3802701 YEMP-38027.01   E9950001 YEMP-99500.01
E34402AAD01 YEMP-34402AAD.01   E3802702 YEMP-38027.02   E9950002 YEMP-99500.02
E34402AAD02 YEMP-34402AAD.02   E3810201 YEMP-38102.01   E9950003 YEMP-99500.03
E34402AAD03 YEMP-34402AAD.03   E3810202 YEMP-38102.02   E9950004 YEMP-99500.04
E34402AAD04 YEMP-34402AAD.04   E3810203 YEMP-38102.03   E10000001 YEMP-100000.01
E34402AAD05 YEMP-34402AAD.05   E3810204 YEMP-38102.04   E10000002 YEMP-100000.02
E34402AB01 YEMP-34402AB.01   E3810301 YEMP-38103.01   E10000003 YEMP-100000.03
E34402AB02 YEMP-34402AB.02   E3810302 YEMP-38103.02   E10000005 YEMP-100000.05
E34402AB03 YEMP-34402AB.03   E3810303 YEMP-38103.03   E10010001-E10010006 YEMP-100100.01-.06
E34402AB04 YEMP-34402AB.04   E3810304 YEMP-38103.04   E100225011 YEMP-100225.01~000001
E3442801 YEMP-34428.01   E3810601 YEMP-38106.01   E100225012 YEMP-100225.01~000002
E3442802 YEMP-34428.02   E3810602 YEMP-38106.02   E100225021 YEMP-100225.02~000001
E3442803 YEMP-34428.03   E3810603 YEMP-38106.03   E100225022 YEMP-100225.02~000002
E3560001 YEMP-35600.01   E3810604 YEMP-38106.04   E100225031 YEMP-100225.03~000001
E3560002 YEMP-35600.02   E3810605 YEMP-38106.05   E100225032 YEMP-100225.03~000002
E3560003 YEMP-35600.03   E3810701 YEMP-38107.01   E100225041 YEMP-100225.04~000001
E3610001 YEMP-36100.01   E3810702 YEMP-38107.02   E100225042 YEMP-100225.04~000002
E3610002 YEMP-36100.02   E3810703 YEMP-38107.03   E10023001 YEMP-100230.01.01
E3610003 YEMP-36100.03   E3810704 YEMP-38107.04   E10023002 YEMP-100230.02.01
E3610004 YEMP-36100.04   E3811601 YEMP-38116.01   E10023004 YEMP-100230.04.01
E3610005 YEMP-36100.05   E3811602 YEMP-38116.02   E10023101 YEMP-100231.01.02
E3620001 YEMP-36200.01   E3811603 YEMP-38116.03   E10023102 YEMP-100231.02.02
E3620002 YEMP-36200.02   E3811604 YEMP-38116.04   E10024801 YEMP-100248.01.01
E3620003 YEMP-36200.03   E8310001-E8310010 YEMP-83100.01-.10   E10024802 YEMP-100248.02.01
E3620004 YEMP-36200.04   E8680001-E8680008 YEMP-86800.01-.08   E10024804 YEMP-100248.04.01
E3620005 YEMP-36200.05   E8690001-E8690010 YEMP-86900.01-.10   MILFLAG01-MILFLAG10 YEMP_MILFLAG.01-.10
E22604011 YEMP-22604.01~000001   E8710001 YEMP-87100.01   EUID01-EUID10 YEMP_UID.01-.10
E22604012 YEMP-22604.01~000002   E8710002 YEMP-87100.02   PUBID PUBID
E22604021 YEMP-22604.02~000001   E8710003 YEMP-87100.03      

This program created the hourly wage for each job, where the maximum number of jobs is 11. If a job lasts less than or equal to 13 weeks. We use the hourly wage when the job starts. Otherwise, we use the hourly wage when job ends or most recent hourly wage.


/* declaring the arrays to be later used in the program */

 

  array e19200 e1920001-e1920011;

  array e22900 e2290001-e2290011;

  array e23000 e2300001-e2300011;

  array e23200 e2320001-e2320011;

  array e23900 e2390001-e2390011;

  array e33400 e3340001-e3340011;

  array e34402 e3440201-e3440211;

  array e34402ab e34402ab01-e34402ab11;

  array e33600 e3360001-e3360011;

  array e33500 e3350001-e3350011;

  array e34428 e3442801-e3442811;

  array e34430 e3443001-e3443011;

  array e38013 e3801301-e3801311;

  array e38014 e3801401-e3801411;

  array e38023 e3802301-e3802311;

  array e38106 e3810601-e3810611;

  array e38107 e3810701-e3810711;

  array e38116 e3811601-e3811611;

  array e3800b e38000b01-e38000b11;

  array e38027 e3802701-e3802711;

  array e23901 e2390101-e2390111;

  array e3800f e38000f01-e38000f11;

  array e38102 e3810201-e3810211;

  array e38103 e3810301-e3810311;

  array e83100 e8310001-e8310011;

  array e86800 e8680001-e8680011;

  array e86900 e8690001-e8690011;

  array e87100 e8710001-e8710011;

  array e87800 e8780001-e8780011;

  array e88000 e8800001-e8800011;

  array e97300 e9730001-e9730011;

  array e97400 e9740001-e9740011;

  array e97500 e9750001-e9750011;

  array e98300 e9830001-e9830011;

  array e98402 e9840201-e9840211;

  array e98402d e98402d01-e98402d11;

  array e98429 e9842901-e9842911;

  array e98429l e98429l01-e98429l11;

  array e99500 e9950001-e9950011;

  array e38002 e3800201-e3800211;

  array e35600 e3560001-e3560011;

  array e22609 e2260901-e2260911;

  array e22610 e2261001-e2261011;

  array e22626 e2262601-e2262611;

  array e100230 e10023001-e10023011;

  array e100231 e10023101-e10023111;

  array e100248 e10024801-e10024811;

  array e38116b e38116b01-e38116b11;

  array e34400 e3440001-e3440011;

  array e36100 e3610001-e3610011;

  array e36200 e3620001-e3620011;

  array e100000 e10000001-e10000011;

  array e100100 e10010001-e10010011;

  array od2comp od2comp01-od2comp11;

  array od2pay od2pay01-od2pay11;

 

  array e226041 e22604011 e22604021 e22604031 e22604041 e22604051 e22604061 e22604071 e22604081 e22604091 e22604101 e22604111;

  array e226042 e22604012 e22604022 e22604032 e22604042 e22604052 e22604062 e22604072 e22604082 e22604092 e22604102 e22604112;

 

  array e102251 e100225011 e100225021 e100225031 e100225041 e100225051 e100225061 e100225071 e100225081 e100225091 e100225101 e100225111;

  array e102252 e100225012 e100225022 e100225032 e100225042 e100225052 e100225062 e100225072 e100225082 e100225092 e100225102 e100225112;

 

 

  /* arrays added in round 4 */

  array e34402aab e34402aab01-e34402aab11;

  array e34402aad e34402aad01-e34402aad11;

  array e98402caa e98402caa01-e98402caa11;

  array e98402cab e98402cab01-e98402cab11;

  array e22626c e22626c01-e22626c11;

  array e22626cb e22626cb01-e22626cb11;

  array e22626e e22626e01-e22626e11;

  array e100248c e100248c01-e100248c11;

  array e100248cb e100248cb01-e100248cb11;

  array e100248e e100248e01-e100248e11;

  array e38024b e38024b01-e38024b11;

  array e38024c e38024c01-e38024c11;

  array endhr1 endhr101-endhr111;

  array endhr2 endhr201-endhr211;

  array e38116aaa e38116aaa01-e38116aaa11;

  array e38116aab e38116aab01-e38116aab11;

 

  /* variables generated in this program */

  array unit unit01-unit11;

  array days days01-days11;

  array daysa daysa01-daysa11; /*number of days per week if they answer per job*/

  array weeks weeks01-weeks11;

  array perjobu perjobu01-perjobu11;

  array perjobt perjobt01-perjobt11;

  array hourly hourly01-hourly11;

  array weekly weekly01-weekly11;

  array amount amount01-amount11; /* which is the amount in the time unit other than hourly.*/

  array hoursb hoursb01-hoursb11;

  array hours hours01-hours11;

  array hrwg hrwg01-hrwg11;

 

  do i=1 to 11;

   if e34402[i]>-4 then e34428[i]=-4;

  end;

 

 

  /*----- Initialize the variables ------*/

 

  do i=1 to 11;

   unit[i]=-4;

   days[i]=-4;

   weeks[i]=-4;

   perjobu[i]=-4;

   perjobt[i]=-4;

   hourly[i]=-4;

   weekly[i]=-4;

   amount[i]=-4;

   hoursb[i]=-4;

   hours[i]=-4;

  end;

 

  /*------------------------------------------------------------------------------------------------

 

  ------------------------------------------------ The variables will be created as the following:

 

   The final created variable is called "Hourly", which is the hourly pay. I also what to create the variables

   "hours" in this program, which is the number of regular hours a person works per week. This is the variable

   that we need in order to calculate hourly compensation later.

 

 

   For the people who answer "per hour" time unit or answer "per hour" or "per minute" in "pay by item or by job'

   I create "hourly" directly. For the people who answer all the other time units. I will calculate "weekly", which

   is their weekly pay, and "hours", which is the number of hours they work per week. Dividing "weekly" by "hours",

   I can calculate "hourly" for these people.

 

 

  ----------------------------------------------------------------------------------------------------

 

  ----------------------------------------------------------------------------------------------------*/

  ***** Time Unit;

  do i=1 to 11;

   if e19200[i] not in (., -4, -5) then unit[i]=e19200[i];

   if e22609[i] not in (., -4, -5) then unit[i]=e22609[i];

   ELSE IF E226041[I] LT 0 AND E226041[I] NOT IN (.,-4,-5) THEN UNIT[I]=-3;

 

   if e83100[i] not in (., -4, -5) then unit[i]=e83100[i];

   if e100230[i] not in (., -4, -5) then unit[i]=e100230[i];

   ELSE IF E102251[I] LT 0 AND E102251[I] NOT IN (.,-4,-5) THEN UNIT[I]=-3;

 

   if e38014[i] not in (., -4, -5) then unit[i]=e38014[i];

   ELSE IF E38013[I] LT 0 AND E38013[I] NOT IN (.,-4,-5) THEN UNIT[I]=-3;

   if e38107[i] not in (., -4, -5) then unit[i]=e38107[i];

   ELSE IF E38106[I] LT 0 AND E38106[I] NOT IN (.,-4,-5) THEN UNIT[I]=-3;

  end;

 

  ***** Number of Days Per Week except e34430 and e98429l because they are not used in "per job" unit;

  do i=1 to 11;

   if e34402ab[i] not in (.,-4,-5) then daysa[i]=e34402ab[i];

   *if e34430[i] not in (.,-4,-5) then daysa[i]=e34430[i];

   if e22626e[i] not in (.,-4,-5) then daysa[i]=e22626e[i];

   if e98402d[i] not in (.,-4,-5) then daysa[i]=e98402d[i];

   *if e98429l[i] not in (.,-4,-5) then daysa[i]=e98429l[i];

   if e100248e[i] not in (.,-4,-5) then daysa[i]=e100248e[i];

   if e38027[i] not in (.,-4,-5) then daysa[i]=e38027[i];

   if e38116b[i] not in (.,-4,-5) then daysa[i]=e38116b[i];

  end;

 

  ***** Number of Days Per Week including e34430 and e98429l;

  do i=1 to 11;

   if e34402ab[i] not in (.,-4,-5) then days[i]=e34402ab[i];

   if e34430[i] not in (.,-4,-5) then days[i]=e34430[i];

   if e22626e[i] not in (.,-4,-5) then days[i]=e22626e[i];

   if e98402d[i] not in (.,-4,-5) then days[i]=e98402d[i];

   if e98429l[i] not in (.,-4,-5) then days[i]=e98429l[i];

   if e100248e[i] not in (.,-4,-5) then days[i]=e100248e[i];

   if e38027[i] not in (.,-4,-5) then days[i]=e38027[i];

   if e38116b[i] not in (.,-4,-5) then days[i]=e38116b[i];

  end;

 

 

  ***** Number of Weeks Per Year;

  do i=1 to 11;

   if e35600[i] not in (.,-4,-5) then weeks[i]=e35600[i];

   if e99500[i] not in (.,-4,-5) then weeks[i]=e99500[i];

  end;

 

  ***** Time Unit to Finish One Item or Job if reporting "Per Item" or "Per Job";

  do i=1 to 11;

   if e34402aab[i] not in (.,-4,-5) then perjobu[i]=e34402aab[i];

   if e22626c[i] not in (.,-4,-5) then perjobu[i]=e22626c[i];

   if e98402caa[i] not in (.,-4,-5) then perjobu[i]=e98402caa[i];

   if e100248c[i] not in (.,-4,-5) then perjobu[i]=e100248c[i];

   if e38024b[i] not in (.,-4,-5) then perjobu[i]=e38024b[i];

   if e38116aaa[i] not in (.,-4,-5) then perjobu[i]=e38116aaa[i];

  end;

 

  ***** Amount of Time to Finish One Item or Job if Reporting "Per Item" or "Per Job";

  do i=1 to 11;

   if e34402aad[i] not in (.,-4,-5) then perjobt[i]=e34402aad[i];

   if e22626cb[i] not in (.,-4,-5) then perjobt[i]=e22626cb[i];

   if e98402cab[i] not in (.,-4,-5) then perjobt[i]=e98402cab[i];

   if e100248cb[i] not in (.,-4,-5) then perjobt[i]=e100248cb[i];

   if e38024c[i] not in (.,-4,-5) then perjobt[i]=e38024c[i];

   if e38116aab[i] not in (.,-4,-5) then perjobt[i]=e38116aab[i];

  end;

 

  ***** Amount;

  do i=1 to 11;

   if e22900[i] not in (.,-4,-5) then amount[i]=e22900[i];

   if e23000[i] not in (.,-4,-5) then amount[i]=e23000[i];

   if e23200[i] not in (.,-4,-5) then amount[i]=e23200[i];

   if e23900[i] not in (.,-4,-5) then amount[i]=e23900[i];

 

   if e33400[i] not in (.,-4,-5) then amount[i]=e33400[i];

   if e33500[i] not in (.,-4,-5) then amount[i]=e33500[i];

   if e33600[i] not in (.,-4,-5) then amount[i]=e33600[i];

   if e34400[i] not in (.,-4,-5) then amount[i]=e34400[i];

   if e22626[i] not in (.,-4,-5) then amount[i]=e22626[i];

 

   if e86800[i] not in (.,-4,-5) then amount[i]=e86800[i];

   if e86900[i] not in (.,-4,-5) then amount[i]=e86900[i];

   if e87100[i] not in (.,-4,-5) then amount[i]=e87100[i];

   if e87800[i] not in (.,-4,-5) then amount[i]=e87800[i];

 

   if e97300[i] not in (.,-4,-5) then amount[i]=e97300[i];

   if e97400[i] not in (.,-4,-5) then amount[i]=e97400[i];

   if e97500[i] not in (.,-4,-5) then amount[i]=e97500[i];

   if e98300[i] not in (.,-4,-5) then amount[i]=e98300[i];

 

   if e100248[i] not in (.,-4,-5) then amount[i]=e100248[i];

 

   if e38023[i] not in (.,-4,-5) then amount[i]=e38023[i];

 

   if e38116[i] not in (.,-4,-5) then amount[i]=e38116[i];

 

  end;

 

  ***** Hours Per Week;

 

  do i=1 to 11;

   if e23901[i] not in (.,-4,-5) then hoursb[i]=e23901[i];

   if e34402[i] not in (.,-4,-5) then hoursb[i]=e34402[i];

   if e34428[i] not in (.,-4,-5) then hoursb[i]=e34428[i];

 

   if e22610[i] not in (.,-4,-5) then hoursb[i]=e22610[i];

   else if e226042[i] lt 0 and e226042[i] not in (.,-4,-5) then hoursb[i]=-3;

 

   if e88000[i] not in (.,-4,-5) then hoursb[i]=e88000[i];

   if e98402[i] not in (.,-4,-5) then hoursb[i]=e98402[i];

   if e98429[i] not in (.,-4,-5) then hoursb[i]=e98429[i];

 

   if e100231[i] not in (.,-4,-5) then hoursb[i]=e100231[i];

   else if e102252[i] lt 0 and e102252[i] not in (.,-4,-5) then hoursb[i]=-3;

 

   if e3800f[i] not in (.,-4,-5) then hoursb[i]=e3800f[i];

 

   if e38002[i] in (.,-4,0) then hours[i]=hoursb[i];

   else if e38002[i] lt 0 and e38002[i] ne -5 then hours[i]=-3;

   else if e38002[i] gt 0 then do;

    if hoursb[i] gt 0 then hours[i]=hoursb[i]-e38002[i];

    else hours[i]=-3;

   end;

 

 

   if e3800b[i] lt 0 and e3800b[i] not in (-4,-5,.) then hours[i]=-3;

 

   if e38102[i] in (1,3) and e38103[i] not in (.,-4,-5) then hours[i]=e38103[i];

   if e38102[i] lt 0 and e38102[i] not in (-4,-5, .) then hours[i]=-3;

  end;

 

  ***** Hourly Wage by Time Unit;

 

  do i=1 to 11;

   if unit[i]=-4 then hourly[i]=-4;

   else if unit[i]=1 and hours[i] ne 0 then hourly[i]=amount[i];

 

   else if amount[i] ge 0 and unit[i] in (12,13) and  perjobu[i] in (1,2) and hours[i] ne 0 then do;

     if perjobu[i]=1 and perjobt[i]>0 then hourly[i]=(amount[i]/perjobt[i])*60;

     else if perjobu[i]=2 and perjobt[i]>0 then hourly[i]=amount[i]/perjobt[i];

     else hourly[i]=-3;

   end;

 

   else if amount[i] ge 0 and hours[i] gt 0 then do;

 

    if unit[i]=2 then do;

      if days[i] gt 0 then hourly[i]=amount[i]*days[i]/hours[i];

      else hourly[i]=-3;

    end;

 

    else if unit[i] in (3, 7, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 28, 999,-1,-2) then hourly[i]=amount[i]/hours[i];

    else if unit[i]=4 then hourly[i]=amount[i]/(2*hours[i]);

    else if unit[i]=5 then hourly[i]=amount[i]/(4.3*hours[i]);

 

    else if unit[i] =6 then do;

     if weeks[i] gt 0 then hourly[i]=amount[i]/(weeks[i]*hours[i]);

     else hourly[i]=-3;

    end;

 

    else if unit[i]=8 then hourly[i]=amount[i]/(2.15*hours[i]);

 

    else if unit[i] in (12,13) then do;

      if perjobt[i]>0 then do;

        if perjobu[i]=3 then do;

          if daysa[i]>=0 then hourly[i]=(amount[i]*daysa[i])/(hours[i]*perjobt[i]);

          else hourly[i]=-3;

        end;

        else if perjobu[i]=4 then hourly[i]=amount[i]/(perjobt[i]*hours[i]);

        else if perjobu[i]=5 then hourly[i]=amount[i]/(perjobt[i]*4.3*hours[i]);

        else hourly[i]=-3;

      end;

      else hourly[i]=-3;

    end;

 

    else hourly[i]=-3;

 

   end;

 

 

   else if amount[i] ne -4 or hours[i] le 0 then hourly[i]=-3;

 

   if unit[i] in (9,14) then hourly[i]=0;

  end;

 

  ***** final wrapping;

 

  do i=1 to 11;

   if hourly[i] in (-1,-2,-3) then hourly[i]=-3;

   hrwg[i]=round(hourly[i],1);

   if e200a=-5 then do;

    hourly[i]=-5;

    hrwg[i]=-5;

   end;

  end;

 

  ***** Use e36100 e36200 e100000 e100100 answers;

 

  array stilhr stilhr01-stilhr11;

 

  do i=1 to 11;

   stilhr[i]=-4;

    if e36100[i] not in (.,-5,-4) or e36200[i]  not in (.,-5,-4) or e100000[i]  not in (.,-5,-4) or e100100[i]  not in (.,-5,-4) then do;

      if e36100[i] not in (.,-5,-4) then stilhr[i]=e36100[i];

      else if e36200[i] not in (.,-5,-4) then stilhr[i]=e36200[i];

      else if e100000[i] not in (.,-5,-4) then stilhr[i]=e100000[i];

      else if e100100[i] not in (.,-5,-4) then stilhr[i]=e100100[i];

    end;

    else if e36100[i] in (.,-4) and e36200[i] in (.,-4) and e100000[i] in (.,-4) and e100100[i] in (.,-4) then stilhr[i]=-4 ;

    else stilhr[i]=-5;

  end;

 

  f4lag=0;

  do i=1 to 11;

    if stilhr[i]>0 and hours[i] ne 0 and

       (e226041[i] in (.,-4,0) and e226042[i] in (.,-4,0)) and (e102251[i] in (.,-4,0) and e102252[i] in (.,-4,0)) and

       (e38013[i] in (.,-4,0) and e38106[i] in (.,-4,0) and e3800b[i] in (.,-4,1) and e38102[i] in (.,-4,2))

    then do;

      hourly[i]=stilhr[i];

      hrwg[i]=round(stilhr[i],1);

      f4lag=1;

    end;

  end;

 

 

  infile '/nlsdata/nlsy97/binary.dat' lrecl=2048 recfm=f;

  /* *start*

   S1523200  YEMP_UID.01

   S1523300  YEMP_UID.02

   S1523400  YEMP_UID.03

   S1523500  YEMP_UID.04

   S1523600  YEMP_UID.05

   S1523700  YEMP_UID.06

   S1523800  YEMP_UID.07

   S1523900  YEMP_UID.08

   S1524000  YEMP_UID.09

   S1524100  YEMP_UID.10

   S1524200  YEMP_UID.11

   S1524500  NORCID

   S1548300  CV_HRLY_COMPENSATION.01

   S1548400  CV_HRLY_COMPENSATION.02

   S1548500  CV_HRLY_COMPENSATION.03

   S1548600  CV_HRLY_COMPENSATION.04

   S1548700  CV_HRLY_COMPENSATION.05

   S1548800  CV_HRLY_COMPENSATION.06

   S1548900  CV_HRLY_COMPENSATION.07

   S1549000  CV_HRLY_COMPENSATION.08

   S1549100  CV_HRLY_COMPENSATION.09

   S1549200  CV_HRLY_COMPENSATION.10

   S1549300  CV_HRLY_COMPENSATION.11

   S1549400  CV_HRLY_PAY.01

   S1549500  CV_HRLY_PAY.02

   S1549600  CV_HRLY_PAY.03

   S1549700  CV_HRLY_PAY.04

   S1549800  CV_HRLY_PAY.05

   S1549900  CV_HRLY_PAY.06

   S1550000  CV_HRLY_PAY.07

   S1550100  CV_HRLY_PAY.08

   S1550200  CV_HRLY_PAY.09

   S1550300  CV_HRLY_PAY.10

   S1550400  CV_HRLY_PAY.11

     *finish*  */

  pubid=S1524500;

 

  array old   S1523200 -- S1524200 S1549400 -- S1550400 S1548300 -- S1549300;

  array new   r6euid01-r6euid11 r6wage01-r6wage11 r6comp01-r6comp11;

  do over old; new=old; end;

  keep pubid r6euid01-r6euid11 r6wage01-r6wage11 r6comp01-r6comp11;

 

  run;

 

 

  *** For those who have a job UID but not wage info.;

  array euid euid01-euid11;

  array hrwg hrwg01-hrwg11;

  array milflag milflag01-milflag11;

  array jleng jleng01-jleng11;

 

  array r1euid r1euid1-r1euid7;

  array r1wage r1wage1-r1wage7;

  array r1comp r1comp1-r1comp7;

  array r2euid r2euid1-r2euid9;

  array r2wage r2wage1-r2wage9;

  array r2comp r2comp1-r2comp9;

  array r3euid r3euid1-r3euid9;

  array r3wage r3wage1-r3wage9;

  array r3comp r3comp1-r3comp9;

  array r4euid r4euid1-r4euid9;

  array r4wage r4wage1-r4wage9;

  array r4comp r4comp1-r4comp9;

  array r5euid r5euid1-r5euid9;

  array r5wage r5wage1-r5wage9;

  array r5comp r5comp1-r5comp9;

 

  array r6euid r6euid01-r6euid11;

  array r6wage r6wage01-r6wage11;

  array r6comp r6comp01-r6comp11;

 

  array oldcomp oldcomp01-oldcomp11;

 

  do i=1 to 11;

    oldcomp[i]=-99;

  end;

 

 

  flagg1=0; flagg2=0; flagg3=0; flagg4=0;

  do i=1 to 11;

   if milflag[i] ne 1 and euid[i]>0 and hrwg[i]=-4 then do;

     flagg1=1;

     /* 335 people have flagg1=1.*/

     if jleng[i]=1 then do;

 

       if 9700 lt euid[i] lt 9800 then do;

          do j1=1 to 7;

            if euid[i]=r1euid[j1] then do;

              hrwg[i]=r1wage[j1];

              oldcomp[i]=r1comp[j1];

            end;

          end;

       end;

 

       else if 9800 lt euid[i] lt 9900 then do;

          do j2=1 to 9;

            if euid[i]=r2euid[j2] then do;

              hrwg[i]=r2wage[j2];

              oldcomp[i]=r2comp[j2];

            end;

          end;

       end;

 

       else if 199900 lt euid[i] lt 200000 then do;

         do j3=1 to 9;

           if euid[i]=r3euid[j3] then do;

             hrwg[i]=r3wage[j3];

             oldcomp[i]=r3comp[j3];

           end;

         end;

       end;

 

       else if 200000 lt euid[i] lt 200100 then do;

         do j4=1 to 9;

           if euid[i]=r4euid[j4] then do;

             hrwg[i]=r4wage[j4];

             oldcomp[i]=r4comp[j4];

           end;

         end;

       end;

 

       else if 200100 lt euid[i] lt 200200 then do;

         do j5=1 to 9;

           if euid[i]=r5euid[j5] then do;

             hrwg[i]=r5wage[j5];

             oldcomp[i]=r5comp[j5];

           end;

         end;

       end;

 

       else if 200200 lt euid[i] lt 200300 then do;

         do j6=1 to 11;

           if euid[i]=r6euid[j6] then do;

             hrwg[i]=r6wage[j6];

             oldcomp[i]=r6comp[j6];

           end;

         end;

       end;

 

       else if euid[i] gt 200300 then do;

        flagg2=1;

        /* Nobody has flagg2=1. */

        hrwg[i]=-3;

        oldcomp[i]=-3;

       end;

 

     end;

 

     else if jleng[i]=0 or -4<jleng[i]<0 then do;

       flagg3=1;

       /* 11 people has flagg3=1.*/

       hrwg[i]=-3;

       oldcomp[i]=-3;

     end;

 

     else if jleng[i]=-4 then do;

       flagg4=1;

       /* Nobody has flagg4=1. */

       hrwg[i]=-4;

       oldcomp[i]=-4;

     end;

 

   end;

  end;

 

  *** check those whose hourly wage is still -4 and job uid is not -4 after this;

 

  flagg5=0;

  do i=1 to 11;

   if milflag[i] ne 1 and euid[i]>0 and hrwg[i]=-4 then do;

     flagg5=1;

     /* 8 people has flagg5=1. */

   end;

  end;

 

  do i=1 to 11;

   if milflag[i] ne 1 and euid[i]>0 and hrwg[i]=-4 then do;

     hrwg[i]=-3;

     oldcomp[i]=-3;

   end;

  end;

   

  if PUBID=4328 then do;

    hrwg02=66;

    oldcomp02=66;

  end;

 

endsas;

 

Return to top


Hourly Monetary Compensation

Variables Created:  CV_HRLY_COMPENSATION.xx

Variables Used

Name in Program Question Name   Name in Program Question Name   Name in Program Question Name
E21200011-E21200016 YEMP-21200.01~000001-6   E3841603 YEMP-38416.03.01   E38416I01 YEMP-38416I.01.02
E21200021-E21200026 YEMP-21200.02~000001-6   E3841603 YEMP-38416.03.02   E38416I01 YEMP-38416I.01.04
E21200031-E21200036 YEMP-21200.03~000001-6   E2261301 YEMP-22613.01.05   E38416I02 YEMP-38416I.02.02
E21200041-E21200046 YEMP-21200.04~000001-6   E2261303 YEMP-22613.03.05   E38416IB01 YEMP-38416IB.01.02
E21200051-E21200056 YEMP-21200.05~000001-6   E2261304 YEMP-22613.04.05   E38416IB01 YEMP-38416IB.01.04
E21200061-E21200066 YEMP-21200.06~000001-6   E2261401 YEMP-22614.01.06   E38416IB02 YEMP-38416IB.02.02
E21200071-E21200076 YEMP-21200.07~000001-6   E2261501 YEMP-22615.01.07   E38416K01 YEMP-38416K.01.01
E21200081-E21200086 YEMP-21200.08~000001-6   E2261502 YEMP-22615.02.07   E38416K01 YEMP-38416K.01.02
E2450101-E2450108 YEMP-24501.01-.08   E2261701 YEMP-22617.01.09   E38416K02 YEMP-38416K.02.01
E2450201-E2450208 YEMP-24502.01-.08   E2261702 YEMP-22617.02.09   E8850101-E8850107 YEMP-88501.01-.07
E2451401-E2451408 YEMP-24514.01-.08   E2261703 YEMP-22617.03.09   E8850201-E8850207 YEMP-88502.01-.07
E24514B08 YEMP-24514B.08   E2262701 YEMP-22627.01.04   E8851201-E8851206 YEMP-88512.01-.06
E3440301 YEMP-34403.01   E2262801 YEMP-22628.01.05   E9840301 YEMP-98403.01
E3440302 YEMP-34403.02   E2262803 YEMP-22628.03.05   E9840302 YEMP-98403.02
E3440303 YEMP-34403.03   E2262804 YEMP-22628.04.05   E9840303 YEMP-98403.03
E3440401 YEMP-34404.01   E22628E04 YEMP-22628E.04.05   E9840304 YEMP-98403.04
E3440402 YEMP-34404.02   E2262901 YEMP-22629.01.06   E98404A01 YEMP-98404A.01
E3440403 YEMP-34404.03   E2263001 YEMP-22630.01.07   E98404A02 YEMP-98404A.02
E34413C01 YEMP-34413C.01   E2263002 YEMP-22630.02.07   E98404A03 YEMP-98404A.03
E34413C02 YEMP-34413C.02   E2263201 YEMP-22632.01.09   E98404A04 YEMP-98404A.04
E34413C03 YEMP-34413C.03   E2263202 YEMP-22632.02.09   E9841401 YEMP-98414.01
E34413E01 YEMP-34413E.01   E2263203 YEMP-22632.03.09   E9841402 YEMP-98414.02
E3560001 YEMP-35600.01   E22632C03 YEMP-22632C.03.09   E9841403 YEMP-98414.03
E3560002 YEMP-35600.02   E22632CB03 YEMP-22632CB.03.09   E9841404 YEMP-98414.04
E3560003 YEMP-35600.03   E3800201 YEMP-38002.01   E98414AAA01 YEMP-98414AAA.01
E21600012-E21600016 YEMP-21600.01.02-.06   E3800202 YEMP-38002.02   E98414AAB01 YEMP-98414AAB.01
E21600022-E21600026 YEMP-21600.02.02-.06   E3800203 YEMP-38002.03   E98414B01 YEMP-98414B.01
E21600032-E21600036 YEMP-21600.03.02-.06   E3800204 YEMP-38002.04   E9950001 YEMP-99500.01
E21600042 YEMP-21600.04.02   E3800301 YEMP-38003.01   E9950002 YEMP-99500.02
E21600043 YEMP-21600.04.03   E3800302 YEMP-38003.02   E9950003 YEMP-99500.03
E21600044 YEMP-21600.04.04   E3800303 YEMP-38003.03   E9950004 YEMP-99500.04
E21600045 YEMP-21600.04.05   E3800304 YEMP-38003.04   E100205012-E100205016 YEMP-100205.01.02-.06
E21600052 YEMP-21600.05.02   E3801201 YEMP-38012.01   E100205022-E100205026 YEMP-100205.02.02-.06
E21600053 YEMP-21600.05.03   E3801202 YEMP-38012.02   E100205032-E100205036 YEMP-100205.03.02-.06
E21600062 YEMP-21600.06.02   E3801203 YEMP-38012.03   E100205042-E100205046 YEMP-100205.04.02-.06
E21600063 YEMP-21600.06.03   E3801204 YEMP-38012.04   E100205052 YEMP-100205.05.02
E21600072 YEMP-21600.07.02   E38012B01 YEMP-38012B.01   E100205072 YEMP-100205.07.02
E21600082 YEMP-21600.08.02   E3810201 YEMP-38102.01   E100205082 YEMP-100205.08.02
E22500012-E22500016 YEMP-22500.01.02-.06   E3810202 YEMP-38102.02   E100214012-E100214016 YEMP-100214.01.02-.06
E22500022-E22500026 YEMP-22500.02.02-.06   E3810203 YEMP-38102.03   E100214022-E100214026 YEMP-100214.02.02-.06
E22500032-E22500036 YEMP-22500.03.02-.06   E3810204 YEMP-38102.04   E100214032-E100214036 YEMP-100214.03.02-.06
E22500042 YEMP-22500.04.02   E3810501 YEMP-38105.01   E100214042-E100214046 YEMP-100214.04.02-.06
E22500043 YEMP-22500.04.03   E3810502 YEMP-38105.02   E100214052 YEMP-100214.05.02
E22500044 YEMP-22500.04.04   E3810503 YEMP-38105.03   E100214072 YEMP-100214.07.02
E22500045 YEMP-22500.04.05   E3820101 YEMP-38201.01   E100214082 YEMP-100214.08.02
E22500052 YEMP-22500.05.02   E3820102 YEMP-38201.02   E100214AAA012 YEMP-100214AAA.01.02
E22500053 YEMP-22500.05.03   E3820103 YEMP-38201.03   E100214AAA013 YEMP-100214AAA.01.03
E22500062 YEMP-22500.06.02   E3820104 YEMP-38201.04   E100214AAA014 YEMP-100214AAA.01.04
E22500063 YEMP-22500.06.03   E3820201 YEMP-38202.01   E100214AAA016 YEMP-100214AAA.01.06
E22500072 YEMP-22500.07.02   E3820202 YEMP-38202.02   E100214AAA022 YEMP-100214AAA.02.02
E22500082 YEMP-22500.08.02   E3820203 YEMP-38202.03   E100214AAA023 YEMP-100214AAA.02.03
E22530012-E22530016 YEMP-22530.01.02-.06   E3820204 YEMP-38202.04   E100214AAA032 YEMP-100214AAA.03.02
E22530022 YEMP-22530.02.02   E3821101 YEMP-38211.01   E100214AAA033 YEMP-100214AAA.03.03
E22530023 YEMP-22530.02.03   E3821102 YEMP-38211.02   E100214AAA034 YEMP-100214AAA.03.04
E22530024 YEMP-22530.02.04   E3821103 YEMP-38211.03   E100214AAB012 YEMP-100214AAB.01.02
E22530025 YEMP-22530.02.05   E38211B01 YEMP-38211B.01   E100214AAB013 YEMP-100214AAB.01.03
E22530033 YEMP-22530.03.03   E38329B01 YEMP-38329B.01   E100214AAB014 YEMP-100214AAB.01.04
E22530034 YEMP-22530.03.04   E38329B02 YEMP-38329B.02   E100214AAB016 YEMP-100214AAB.01.06
E22530044 YEMP-22530.04.04   E38329B03 YEMP-38329B.03   E100214AAB022 YEMP-100214AAB.02.02
E22535012-E22535016 YEMP-22535.01.02-.06   E38329B04 YEMP-38329B.04   E100214AAB023 YEMP-100214AAB.02.03
E22535022 YEMP-22535.02.02   E38329D01 YEMP-38329D.01   E100214AAB032 YEMP-100214AAB.03.02
E22535023 YEMP-22535.02.03   E38329D02 YEMP-38329D.02   E100214AAB033 YEMP-100214AAB.03.03
E22535024 YEMP-22535.02.04   E38329D03 YEMP-38329D.03   E100214AAB034 YEMP-100214AAB.03.04
E22535025 YEMP-22535.02.05   E38329D04 YEMP-38329D.04   E100214B012-E100214B016 YEMP-100214B.01.02-.06
E22535033 YEMP-22535.03.03   E38329I01 YEMP-38329I.01   E100214B022 YEMP-100214B.02.02
E22535034 YEMP-22535.03.04   E38329I02 YEMP-38329I.02   E100214B023 YEMP-100214B.02.03
E22535044 YEMP-22535.04.04   E38329IB01 YEMP-38329IB.01   E100214B024 YEMP-100214B.02.04
E22550012-E22550016 YEMP-22550.01.02-.06   E38329IB02 YEMP-38329IB.02   E100214B032 YEMP-100214B.03.02
E22550022 YEMP-22550.02.02   E38329K01 YEMP-38329K.01   E100214B033 YEMP-100214B.03.03
E22550023 YEMP-22550.02.03   E38329K02 YEMP-38329K.02   E100214B034 YEMP-100214B.03.04
E22550024 YEMP-22550.02.04   E38329K03 YEMP-38329K.03   E100214B042 YEMP-100214B.04.02
E22550025 YEMP-22550.02.05   E3840701 YEMP-38407.01.01   E100214B052 YEMP-100214B.05.02
E22550032 YEMP-22550.03.02   E3840701 YEMP-38407.01.02   E100225013 YEMP-100225.01~000003
E22550033 YEMP-22550.03.03   E3840701 YEMP-38407.01.03   E100225014 YEMP-100225.01~000004
E22550034 YEMP-22550.03.04   E3840701 YEMP-38407.01.04   E100225023 YEMP-100225.02~000003
E22550035 YEMP-22550.03.05   E3840701 YEMP-38407.01.05   E100225024 YEMP-100225.02~000004
E22550042 YEMP-22550.04.02   E3840702 YEMP-38407.02.01   E100225033 YEMP-100225.03~000003
E22550043 YEMP-22550.04.03   E3840702 YEMP-38407.02.02   E100225034 YEMP-100225.03~000004
E22550052 YEMP-22550.05.02   E3840702 YEMP-38407.02.03   E100225043 YEMP-100225.04~000003
E22550062 YEMP-22550.06.02   E3840702 YEMP-38407.02.04   E100225044 YEMP-100225.04~000004
E22550072 YEMP-22550.07.02   E3840702 YEMP-38407.02.05   E10023301 YEMP-100233.01.04
E22550082 YEMP-22550.08.02   E3840703 YEMP-38407.03.01   E10023302 YEMP-100233.02.04
E22604013 YEMP-22604.01~000003   E3840703 YEMP-38407.03.02   E10023401 YEMP-100234.01.05
E22604014 YEMP-22604.01~000004   E3841601 YEMP-38416.01.01   E10023502 YEMP-100235.02.06
E22604023 YEMP-22604.02~000003   E3841601 YEMP-38416.01.02   E10023601 YEMP-100236.01.07
E22604024 YEMP-22604.02~000004   E3841601 YEMP-38416.01.03   E10024901 YEMP-100249.01.04
E22604033 YEMP-22604.03~000003   E3841601 YEMP-38416.01.04   E10024902 YEMP-100249.02.04
E22604034 YEMP-22604.03~000004   E3841601 YEMP-38416.01.05   E10025001 YEMP-100250.01.05
E22604043 YEMP-22604.04~000003   E3841602 YEMP-38416.02.01   E10025102 YEMP-100251.02.06
E22604044 YEMP-22604.04~000004   E3841602 YEMP-38416.02.02   E10025201 YEMP-100252.01.07
E2261101 YEMP-22611.01.03   E3841602 YEMP-38416.02.03   ECURR01-ECURR10 YEMP_CURFLAG.01-.10
E2261102 YEMP-22611.02.03   E3841602 YEMP-38416.02.04   EUID01-EUID10 YEMP_UID.01-.10
E2261201 YEMP-22612.01.04   E3841602 YEMP-38416.02.05   PUBID PUBID

Based on the hourly wage and regular hours variables created in the previous program, this program creates the hourly compensation. We first go through the overtime and create overtime hours and weekly overtime pay. Then we go through the other compensations, for which we only need to create weekly payments. Hours info. is not asked about the other compensation, so we assume they make the other compensation in every hour they work, regular hours or overtime hours.


  ***** Define arrays used in the overtime part;

 

  array e24501 e2450101-e2450111;

  array e24502 e2450201-e2450211;

  array e24514 e2451401-e2451411;

  array e24514b e24514b01-e24514b11;

  array e24514aab e24514aab01-e24514aab11;

  array e24514aabb e24514aabb01-e24514aabb11;

  array e34403 e3440301-e3440311;

  array e34404 e3440401-e3440411;

  array e34413c e34413c01-e34413c11;

  array e34413e e34413e01-e34413e11;

  array e34413cc e34413cc01-e34413cc11;

  array e34413cd e34413cd01-e34413cd11;

  array e35600 e3560001-e3560011;

  array e22611 e2261101-e2261111;

  array e22627 e2262701-e2262711;

  array e22627e e22627e01-e22627e11;

  array e22627c e22627c01-e22627c11;

  array e22627cb e22627cb01-e22627cb11;

  array e22612 e2261201-e2261211;

  array e226044 e22604014 e22604024 e22604034 e22604044 e22604054 e22604064 e22604074 e22604084 e22604094 e22604104 e22604114;

  array e226043 e22604013 e22604023 e22604033 e22604043 e22604053 e22604063 e22604073 e22604083 e22604093 e22604103 e22604113;

  array e38002 e3800201-e3800211;

  array e38003 e3800301-e3800311;

  array e38012 e3801201-e3801211;

  array e38012b e38012b01-e38012b11;

  array e38012aaa e38012aaa01-e38012aaa11;

  array e38012aab e38012aab01-e38012aab11;

  array e38102 e3810201-e3810211;

  array e38105 e3810501-e3810511;

  array e38201 e3820101-e3820111;

  array e38202 e3820201-e3820211;

  array e38211 e3821101-e3821111;

  array e38211b e38211b01-e38211b11;

  array e38211aaa e38211aaa01-e38211aaa11;

  array e38211aab e38211aab01-e38211aab11;

  array e88501 e8850101-e8850111;

  array e88502 e8850201-e8850211;

  array e88512 e8851201-e8851211;

  array e88512b e88512b01-e88512b11;

  array e88512aaa e88512aaa01-e88512aaa11;

  array e88512aab e88512aab01-e88512aab11;

  array e98403 e9840301-e9840311;

  array e98404a e98404a01-e98404a11;

  array e98414 e9841401-e9841411;

  array e98414b e98414b01-e98414b11;

  array e98414aaa e98414aaa01-e98414aaa11;

  array e98414aab e98414aab01-e98414aab11;

  array e99500 e9950001-e9950011;

  array e100232 e1023201-e1023211;

  array e100233 e1023301-e1023311;

  array e100249 e1024901-e1024911;

  array e100249e e10249e01-e10249e11;

  array e100249c e10249c01-e10249c11;

  array e100249cb e10249cb01-e10249cb11;

  array ecurr ecurr01-ecurr11;

  array euid euid01-euid11;

  *array wkswk wkswk01-wkswk11;

  array e102253 e100225013 e100225023 e100225033 e100225043 e100225053 e100225063 e100225073 e100225083 e100225093

                e100225103 e100225113 ;

  array e102254 e100225014 e100225024 e100225034 e100225044 e100225054 e100225064 e100225074 e100225084 e100225094

                e100225104 e100225114 ;

 

 

  flagot16=0; /* flag for the cases whose overtime unit is 16, since "number of weeks worked" is not available. */

  flagcp16=0; /* flag for the cases whose other comp. time unit is 16 */

 

  /*--------------------------------------------------------------------------------------------------------*/

 

  /*---------------------------------overtime hours and overtime payment------------------------------------*/

 

  /*--------------------------------------------------------------------------------------------------------*/

 

  array hourly hourly01-hourly11;

 

  array otunit otunit01-otunit11;

  array otdays otdays01-otdays11;

  array otwks otwks01-otwks11;

  array otperju otperju01-otperju11;

  array otperjt otperjt01-otperjt11;

  array othrly othrly01-othrly11;

  array otamt otamt01-otamt11; /* which is the amount in the time unit other thna hourly.*/

  array othours othrs01-othrs11;

 

  /*----- Initialize the variables ------*/

 

  do i=1 to 11;

   otunit[i]=-4;

   otdays[i]=-4;

   otwks[i]=-4;

   otperju[i]=-4;

   otperjt[i]=-4;

   othrly[i]=-4;

   otamt[i]=-4;

   othours[i]=-4;

  end;

 

  /*--------------------------------------------------------------------------------------------------------*/

 

  /* Overtime is asked in the following places:

     beginning with 19200 (two branches depends on if regualr pay is hourly or non-hourly),

     beginning correction with 19200,

     beginning with 83100 (two baranches depends on if regular pay is hourly or non-hourly),

     beginning correction with 83100, ending if no overtime reported in the beginning,

     ending if no overtime reported in the beginning,

     ending if overtime reported in the beginning. */

 

 

  /*--------------------------------------------------------------------------------------------------------*/

 

  ***** Time Unit;

  do i=1 to 11;

   if e24502[i] not in (.,-4,-5) then otunit[i]=e24502[i];

   if e34404[i] not in (.,-4,-5) then otunit[i]=e34404[i];

   if e22612[i] not in (.,-4,-5) then otunit[i]=e22612[i];

   else if e226044[i] lt 0 and e226043[i] not in (.,-4,-5) then otunit[i]=-3;

   if e88502[i] not in (.,-4,-5) then otunit[i]=e88502[i];

   if e98404a[i] not in (.,-4,-5) then otunit[i]=e98404a[i];

   if e100233[i] not in (.,-4,-5) then otunit[i]=e100233[i];

   else if e102254[i] lt 0 and e102254[i] not in (.,-4,-5) then otunit[i]=-3;

   if e38003[i] not in (.,-4,-5) then otunit[i]=e38003[i];

   if e38202[i] not in (.,-4,-5) then otunit[i]=e38202[i];

   else if e38201[i] lt 0 and e38201[i] not in (.,-4,-5) then otunit[i]=-3;

 

  end;

 

 

  ***** Number of Days Per Week;

  do i=1 to 11;

   if e24514b[i] not in (.,-4,-5) then otdays[i]=e24514b[i];

   if e34413e[i] not in (.,-4,-5) then otdays[i]=e34413e[i];

   if e22627e[i] not in (.,-4,-5) then otdays[i]=e22627e[i];

   if e88512b[i] not in (.,-4,-5) then otdays[i]=e88512b[i];

   if e98414b[i] not in (.,-4,-5) then otdays[i]=e98414b[i];

   if e100249e[i] not in (.,-4,-5) then otdays[i]=e100249e[i];

   if e38012b[i] not in (.,-4,-5) then otdays[i]=e38012b[i];

   if e38211b[i] not in (.,-4,-5) then otdays[i]=e38211b[i];

  end;

 

 

  ***** Number of Weeks Per Year;

  do i=1 to 11;

   if e35600[i] not in (.,-4,-5) then otwks[i]=e35600[i];

   if e99500[i] not in (.,-4,-5) then otwks[i]=e99500[i];

  end;

 

  ***** Time Unit to Finish One Item or Job if reporting "Per Item" or "Per Job";

  do i=1 to 11;

   if e24514aab[i] not in (.,-4,-5) then otperju[i]=e24514aab[i];

   if e34413cc[i] not in (.,-4,-5) then otperju[i]=e34413cc[i];

   if e22627c[i] not in (.,-4,-5) then otperju[i]=e22627c[i];

   if e88512aaa[i] not in (.,-4,-5) then otperju[i]=e88512aaa[i];

   if e98414aaa[i] not in (.,-4,-5) then otperju[i]=e98414aaa[i];

   if e100249c[i] not in (.,-4,-5) then otperju[i]=e100249c[i];

   if e38012aaa[i] not in (.,-4,-5) then otperju[i]=e38012aaa[i];

   if e38211aaa[i] not in (.,-4,-5) then otperju[i]=e38211aaa[i];

  end;

 

  ***** Amount of Time to Finish One Item or Job if Reporting "Per Item" or "Per Job";

  do i=1 to 11;

   if e24514aabb[i] not in (.,-4,-5) then otperjt[i]=e24514aabb[i];

   if e34413cd[i] not in (.,-4,-5) then otperjt[i]=e34413cd[i];

   if e22627cb[i] not in(.,-4,-5) then otperjt[i]=e22627cb[i];

   if e88512aab[i] not in (.,-4,-4) then otperjt[i]=e88512aab[i];

   if e98414aab[i] not in (.,-4,-5) then otperjt[i]=e98414aab[i];

   if e100249cb[i] not in (.,-4,-5) then otperjt[i]=e100249cb[i];

   if e38012aab[i] not in (.,-4,-5) then otperjt[i]=e38012aab[i];

   if e38211aab[i] not in (.,-4,-5) then otperjt[i]=e38211aab[i];

  end;

 

  ***** Amount;

  do i=1 to 11;

   if e24514[i] not in (.,-4,-5) then otamt[i]=e24514[i];

   if e34413c[i] not in (.,-4,-5) then otamt[i]=e34413c[i];

   if e22627[i] not in (.,-4,-5) then otamt[i]=e22627[i];

   if e88512[i] not in (.,-4,-5) then otamt[i]=e88512[i];

   if e98414[i] not in (.,-4,-5) then otamt[i]=e98414[i];

   if e100249[i] not in (.,-4,-5) then otamt[i]=e100249[i];

   if e38012[i] not in (.,-4,-5) then otamt[i]=e38012[i];

   if e38211[i] not in (.,-4,-5) then otamt[i]=e38211[i];

 

  end;

 

  ***** Hours Per Week;

 

  do i=1 to 11;

   if e24501[i] not in (.,-4,-5) then othours[i]=e24501[i];

   if e34403[i] not in (.,-4,-5) then othours[i]=e34403[i];

   if e22611[i] not in (.,-4,-4) then othours[i]=e22611[i];

   else if e226043[i] lt 0 and e226043[i] not in (.,-4,-5) then othours[i]=-3;

   if e88501[i] not in (.,-4,-5) then othours[i]=e88501[i];

   if e98403[i] not in (.,-4,-5) then othours[i]=e98403[i];

   if e100232[i] not in (.,-4,-5) then othours[i]=e100232[i];

   else if e102253[i] lt 0 and e102253[i] not in (.,-4,-5) then othours[i]=-3;

   if e38002[i] not in (.,-4,-5) then othours[i]=e38002[i];

   if e38105[i] not in (.,-4,-5) then othours[i]=e38105[i];

   else if e38102[i] lt 0 and e38102[i] not in (.,-4,-5) then othours[i]=-3;

  end;

 

  ***** Hourly overtime pay;

 

  do i=1 to 11;

   if otunit[i]=-4 then othrly[i]=-4;

   else if otunit[i]=0 then othrly[i]=-3;

   else if otunit[i]=10 then othrly[i]=hourly[i]*1.5;

   else if otunit[i]=11 then othrly[i]=hourly[i]*2;

   else if otunit[i] in (9,14) then othrly[i]=0;

   else if otunit[i] in (1,21) then othrly[i]=otamt[i];

 

   else if otamt[i] ge 0 and otunit[i] in (12,13) and  otperju[i] in (1,2) then do;

     if otperju[i]=1 and otperjt[i]>0 then othrly[i]=(otamt[i]/otperjt[i])*60;

     else if otperju[i]=2 and otperjt[i]>0 then othrly[i]=otamt[i]/otperjt[i];

     else othrly[i]=-3;

   end;

 

   else if otamt[i] ge 0 and othours[i] gt 0 then do;

 

    if otunit[i] in (2,22) then do;

      if otdays[i] gt 0 then othrly[i]=otamt[i]*otdays[i]/othours[i];

      else othrly[i]=-3;

    end;

 

    else if otunit[i] in (3,23) then othrly[i]=otamt[i]/othours[i];

    else if otunit[i] in (4,24) then othrly[i]=otamt[i]/(2*othours[i]);

    else if otunit[i] in (5,25) then othrly[i]=otamt[i]/(4.3*othours[i]);

 

    else if otunit[i] in (6,26) then do;

     if otwks[i] gt 0 then othrly[i]=otamt[i]/(otwks[i]*othours[i]);

     else othrly[i]=-3;

    end;

 

    else if otunit[i] in (8,28) then othrly[i]=otamt[i]/(2.15*othours[i]);

 

    else if otunit[i] in (12,13) then do;

      if otperjt[i]>0 then do;

        if otperju[i]=3 then do;

          if otdays[i]>0 then othrly[i]=(otamt[i]*otdays[i])/(othours[i]*otperjt[i]);

          else othrly[i]=-3;

        end;

        else if otperju[i]=4 then othrly[i]=otamt[i]/(otperjt[i]*othours[i]);

        else if otperju[i]=5 then othrly[i]=otamt[i]/(otperjt[i]*4.3*othours[i]);

        else othrly[i]=-3;

      end;

      else othrly[i]=-3;

    end;

 

    /*

    else if otunit[i]=16 then do;

      flagot16=1;

      if ecurr[i] ne 1 and euid[i] ge 200101 and wkswk[i]>0 then othrly[i]=otamt[i]/(wkswk[i]*othours[i]);

      else othrly[i]=-3;

    end;

    */

  ***Because we don't have the created variable "number of weeks worked" yet, so I flag these cases for now;

    else if otunit[i]=16 then do;

      flagot16=1;

      othrly[i]=-3;

    end;

 

    else othrly[i]=-3;

 

   end;

 

 

   else if otamt[i] ne -4 or othours[i] le 0 then othrly[i]=-3;

 

 

  end;

 

  *** bad overtime unit;

 

  unit7ot=0;

  unit16ot=0;

  unit9ot=0;

 

  do i=1 to 11;

    if otunit[i]=7 then unit7ot=1;

    if otunit[i]=16 then unit16ot=1;

    if otunit[i]=999 then unit9ot=1;

  end;

 

 

 

  /*--------------------------------------------------------------------------------------------------------*/

 

  /*---------------------------------Weekly Pay for Other Compensations ------------------------------------*/

 

  /*--------------------------------------------------------------------------------------------------------*/

 

 

 

  /*--------------------------------------------------------------------------------------------------------*/

 

  /* There are five types of other compensations: tips, bonus, commission, incentive pay and others.

     Each type is asked to 9 jobs. So I am going to use double array for compensation. One level for type and

     other level is for job.

 

     Other compensations are also asked in six places:

     Beginning compensation with E19200;

     Correction to beginning compensation with E19200;

     Beginning compensation with E83100;

     Correction to beginning compensation with E83100;

     Ending compensation if there is only one type of other compensation reported in the beginning;

     Ending compensation otherwise.

  */

 

  /*--------------------------------------------------------------------------------------------------------*/

 

 

  /*-------- Define arrays and initialize the variables: t indicates type and j indicates job --------*/

 

  ***** Variables used;

 

  **** Second level of arrays, for 9 jobs;

 

  ARRAY E212002 (j) E21200012 E21200022 E21200032 E21200042 E21200052 E21200062 E21200072 E21200082 E21200092 E21200102 E21200112;

  ARRAY E212003 (j) E21200013 E21200023 E21200033 E21200043 E21200053 E21200063 E21200073 E21200083 E21200093 E21200103 E21200113;

  ARRAY E212004 (j) E21200014 E21200024 E21200034 E21200044 E21200054 E21200064 E21200074 E21200084 E21200094 E21200104 E21200114;

  ARRAY E212005 (j) E21200015 E21200025 E21200035 E21200045 E21200055 E21200065 E21200075 E21200085 E21200095 E21200105 E21200115;

  ARRAY E212006 (j) E21200016 E21200026 E21200036 E21200046 E21200056 E21200066 E21200076 E21200086 E21200096 E21200106 E21200116;

 

  ARRAY E216001 (j) E21600012 E21600022 E21600032 E21600042 E21600052 E21600062 E21600072 E21600082 E21600092 E21600102 E21600112;

  ARRAY E216002 (j) E21600013 E21600023 E21600033 E21600043 E21600053 E21600063 E21600073 E21600083 E21600093 E21600103 E21600113;

  ARRAY E216003 (j) E21600014 E21600024 E21600034 E21600044 E21600054 E21600064 E21600074 E21600084 E21600094 E21600104 E21600114;

  ARRAY E216004 (j) E21600015 E21600025 E21600035 E21600045 E21600055 E21600065 E21600075 E21600085 E21600095 E21600105 E21600115;

  ARRAY E216005 (j) E21600016 E21600026 E21600036 E21600046 E21600056 E21600066 E21600076 E21600086 E21600096 E21600106 E21600116;

 

  ARRAY E225001 (j) E22500012 E22500022 E22500032 E22500042 E22500052 E22500062 E22500072 E22500082 E22500092 E22500102 E22500112;

  ARRAY E225002 (j) E22500013 E22500023 E22500033 E22500043 E22500053 E22500063 E22500073 E22500083 E22500093 E22500103 E22500113;

  ARRAY E225003 (j) E22500014 E22500024 E22500034 E22500044 E22500054 E22500064 E22500074 E22500084 E22500094 E22500104 E22500114;

  ARRAY E225004 (j) E22500015 E22500025 E22500035 E22500045 E22500055 E22500065 E22500075 E22500085 E22500095 E22500105 E22500115;

  ARRAY E225005 (j) E22500016 E22500026 E22500036 E22500046 E22500056 E22500066 E22500076 E22500086 E22500096 E22500106 E22500116;

 

  ARRAY E225501 (j) E22550012 E22550022 E22550032 E22550042 E22550052 E22550062 E22550072 E22550082 E22550092 E22550102 E22550112;

  ARRAY E225502 (j) E22550013 E22550023 E22550033 E22550043 E22550053 E22550063 E22550073 E22550083 E22550093 E22550103 E22550113;

  ARRAY E225503 (j) E22550014 E22550024 E22550034 E22550044 E22550054 E22550064 E22550074 E22550084 E22550094 E22550104 E22550114;

  ARRAY E225504 (j) E22550015 E22550025 E22550035 E22550045 E22550055 E22550065 E22550075 E22550085 E22550095 E22550105 E22550115;

  ARRAY E225505 (j) E22550016 E22550026 E22550036 E22550046 E22550056 E22550066 E22550076 E22550086 E22550096 E22550106 E22550116;

 

  ARRAY E225301 (j) E22530012 E22530022 E22530032 E22530042 E22530052 E22530062 E22530072 E22530082 E22530092 E22530102 E22530112;

  ARRAY E225302 (j) E22530013 E22530023 E22530033 E22530043 E22530053 E22530063 E22530073 E22530083 E22530093 E22530103 E22530113;

  ARRAY E225303 (j) E22530014 E22530024 E22530034 E22530044 E22530054 E22530064 E22530074 E22530084 E22530094 E22530104 E22530114;

  ARRAY E225304 (j) E22530015 E22530025 E22530035 E22530045 E22530055 E22530065 E22530075 E22530085 E22530095 E22530105 E22530115;

  ARRAY E225305 (j) E22530016 E22530026 E22530036 E22530046 E22530056 E22530066 E22530076 E22530086 E22530096 E22530106 E22530116;

 

  ARRAY E225351 (j) E22535012 E22535022 E22535032 E22535042 E22535052 E22535062 E22535072 E22535082 E22535092 E22535102 E22535112;

  ARRAY E225352 (j) E22535013 E22535023 E22535033 E22535043 E22535053 E22535063 E22535073 E22535083 E22535093 E22535103 E22535113;

  ARRAY E225353 (j) E22535014 E22535024 E22535034 E22535044 E22535054 E22535064 E22535074 E22535084 E22535094 E22535104 E22535114;

  ARRAY E225354 (j) E22535015 E22535025 E22535035 E22535045 E22535055 E22535065 E22535075 E22535085 E22535095 E22535105 E22535115;

  ARRAY E225355 (j) E22535016 E22535026 E22535036 E22535046 E22535056 E22535066 E22535076 E22535086 E22535096 E22535106 E22535116;

 

  ARRAY E22613 (j) E2261301-E2261311;

  ARRAY E22614 (j) E2261401-E2261411;

  ARRAY E22615 (j) E2261501-E2261511;

  ARRAY E22616 (j) E2261601-E2262611;

  ARRAY E22617 (j) E2261701-E2261711;

 

  ARRAY E22628 (j) E2262801-E2262811;

  ARRAY E22629 (j) E2262901-E2262911;

  ARRAY E22630 (j) E2263001-E2263011;

  ARRAY E22631 (j) E2263101-E2263111;

  ARRAY E22632 (j) E2263201-E2263211;

 

  ARRAY E22628e (j) E22628e01-E22628e11;

  ARRAY E22629e (j) E22629e01-E22629e11;

  ARRAY E22630e (j) E22630e01-E22630e11;

  ARRAY E22631e (j) E22631e01-E22631e11;

  ARRAY E22632e (j) E22632e01-E22632e11;

 

  ARRAY E22628c (j) E22628c01-E22628c11;

  ARRAY E22629c (j) E22629c01-E22629c11;

  ARRAY E22630c (j) E22630c01-E22630c11;

  ARRAY E22631c (j) E22631c01-E22631c11;

  ARRAY E22632c (j) E22632c01-E22632c11;

 

  ARRAY E22628cb (j) E22628cb01-E22628cb11;

  ARRAY E22629cb (j) E22629cb01-E22629cb11;

  ARRAY E22630cb (j) E22630cb01-E22630cb11;

  ARRAY E22631cb (j) E22631cb01-E22631cb11;

  ARRAY E22632cb (j) E22632cb01-E22632cb11;

 

  ARRAY E102051 (j) E100205012 E100205022 E100205032 E100205042 E100205052 E100205062 E100205072 E100205082 E100205092 E100205102 E100205112;

  ARRAY E102052 (j) E100205013 E100205023 E100205033 E100205043 E100205053 E100205063 E100205073 E100205083 E100205093 E100205103 E100205113;

  ARRAY E102053 (j) E100205014 E100205024 E100205034 E100205044 E100205054 E100205064 E100205074 E100205084 E100205094 E100205104 E100205114;

  ARRAY E102054 (j) E100205015 E100205025 E100205035 E100205045 E100205055 E100205065 E100205075 E100205085 E100205095 E100205105 E100205115;

  ARRAY E102055 (j) E100205016 E100205026 E100205036 E100205046 E100205056 E100205066 E100205076 E100205086 E100205096 E100205106 E100205116;

 

  ARRAY E102141 (j) E100214012 E100214022 E100214032 E100214042 E100214052 E100214062 E100214072 E100214082 E100214092 E100214102 E100214112;

  ARRAY E102142 (j) E100214013 E100214023 E100214033 E100214043 E100214053 E100214063 E100214073 E100214083 E100214093 E100214103 E100214113;

  ARRAY E102143 (j) E100214014 E100214024 E100214034 E100214044 E100214054 E100214064 E100214074 E100214084 E100214094 E100214104 E100214114;

  ARRAY E102144 (j) E100214015 E100214025 E100214035 E100214045 E100214055 E100214065 E100214075 E100214085 E100214095 E100214105 E100214115;

  ARRAY E102145 (j) E100214016 E100214026 E100214036 E100214046 E100214056 E100214066 E100214076 E100214086 E100214096 E100214106 E100214116;

 

  ARRAY E10214b1 (j) E100214b012 E100214b022 E100214b032 E100214b042 E100214b052 E100214b062 E100214b072 E100214b082 E100214b092 E100214b102 E100214b112;

  ARRAY E10214b2 (j) E100214b013 E100214b023 E100214b033 E100214b043 E100214b053 E100214b063 E100214b073 E100214b083 E100214b093 E100214b103 E100214b113;

  ARRAY E10214b3 (j) E100214b014 E100214b024 E100214b034 E100214b044 E100214b054 E100214b064 E100214b074 E100214b084 E100214b094 E100214b104 E100214b114;

  ARRAY E10214b4 (j) E100214b015 E100214b025 E100214b035 E100214b045 E100214b055 E100214b065 E100214b075 E100214b085 E100214b095 E100214b105 E100214b115;

  ARRAY E10214b5 (j) E100214b016 E100214b026 E100214b036 E100214b046 E100214b056 E100214b066 E100214b076 E100214b086 E100214b096 E100214b106 E100214b116;

 

  ARRAY E10214aaa1 (j) E100214aaa012 E100214aaa022 E100214aaa032 E100214aaa042 E100214aaa052 E100214aaa062 E100214aaa072 E100214aaa082 E10214aaa092 E100214aaa102 E10214aaa112;

  ARRAY E10214aaa2 (j) E100214aaa013 E100214aaa023 E100214aaa033 E100214aaa043 E100214aaa053 E100214aaa063 E100214aaa073 E100214aaa083 E10214aaa093 E100214aaa103 E10214aaa113;

  ARRAY E10214aaa3 (j) E100214aaa014 E100214aaa024 E100214aaa034 E100214aaa044 E100214aaa054 E100214aaa064 E100214aaa074 E100214aaa084 E10214aaa094 E100214aaa104 E10214aaa114;

  ARRAY E10214aaa4 (j) E100214aaa015 E100214aaa025 E100214aaa035 E100214aaa045 E100214aaa055 E100214aaa065 E100214aaa075 E100214aaa085 E10214aaa095 E100214aaa105 E10214aaa115;

  ARRAY E10214aaa5 (j) E100214aaa016 E100214aaa026 E100214aaa036 E100214aaa046 E100214aaa056 E100214aaa066 E100214aaa076 E100214aaa086 E10214aaa096 E100214aaa106 E10214aaa116;

 

  ARRAY E10214aab1 (j) E100214aab012 E100214aab022 E100214aab032 E100214aab042 E100214aab052 E100214aab062 E100214aab072 E100214aab082 E10214aab092 E100214aab102 E10214aab112;

  ARRAY E10214aab2 (j) E100214aab013 E100214aab023 E100214aab033 E100214aab043 E100214aab053 E100214aab063 E100214aab073 E100214aab083 E10214aab093 E100214aab103 E10214aab113;

  ARRAY E10214aab3 (j) E100214aab014 E100214aab024 E100214aab034 E100214aab044 E100214aab054 E100214aab064 E100214aab074 E100214aab084 E10214aab094 E100214aab104 E10214aab114;

  ARRAY E10214aab4 (j) E100214aab015 E100214aab025 E100214aab035 E100214aab045 E100214aab055 E100214aab065 E100214aab075 E100214aab085 E10214aab095 E100214aab105 E10214aab115;

  ARRAY E10214aab5 (j) E100214aab016 E100214aab026 E100214aab036 E100214aab046 E100214aab056 E100214aab066 E100214aab076 E100214aab086 E10214aab096 E100214aab106 E10214aab116;

 

  ARRAY E100234 (j) E10023401-E10023411;

  ARRAY E100235 (j) E10023501-E10023511;

  ARRAY E100236 (j) E10023601-E10023611;

  ARRAY E100237 (j) E10023701-E10023711;

  ARRAY E100239 (j) E10023901-E10023911;

 

  ARRAY E100250 (j) E10025001-E10025011;

  ARRAY E100251 (j) E10025101-E10025111;

  ARRAY E100252 (j) E10025201-E10025211;

  ARRAY E100253 (j) E10025301-E10025311;

  ARRAY E100254 (j) E10025401-E10025411;

 

  ARRAY E100250e (j) E100250e01-E100250e11;

  ARRAY E100251e (j) E100251e01-E100251e11;

  ARRAY E100252e (j) E100252e01-E100252e11;

  ARRAY E100253e (j) E100253e01-E100253e11;

  ARRAY E100254e (j) E100254e01-E100254e11;

 

  ARRAY E100250c (j) E100250c01-E100250c11;

  ARRAY E100251c (j) E100251c01-E100251c11;

  ARRAY E100252c (j) E100252c01-E100252c11;

  ARRAY E100253c (j) E100253c01-E100253c11;

  ARRAY E100254c (j) E100254c01-E100254c11;

 

  ARRAY E100250cb (j) E100250cb01-E100250cb11;

  ARRAY E100251cb (j) E100251cb01-E100251cb11;

  ARRAY E100252cb (j) E100252cb01-E100252cb11;

  ARRAY E100253cb (j) E100253cb01-E100253cb11;

  ARRAY E100254cb (j) E100254cb01-E100254cb11;

 

  ARRAY E384071 (j) E38407011 E38407021 E38407031 E38407041 E38407051 E38407061 E38407071 E38407081 E38407091 E38407101 E38407111;

  ARRAY E384072 (j) E38407012 E38407022 E38407032 E38407042 E38407052 E38407062 E38407072 E38407082 E38407092 E38407102 E38407112;

  ARRAY E384073 (j) E38407013 E38407023 E38407033 E38407043 E38407053 E38407063 E38407073 E38407083 E38407093 E38407103 E38407113;

  ARRAY E384074 (j) E38407014 E38407024 E38407034 E38407044 E38407054 E38407064 E38407074 E38407084 E38407094 E38407104 E38407114;

  ARRAY E384075 (j) E38407015 E38407025 E38407035 E38407045 E38407055 E38407065 E38407075 E38407085 E38407095 E38407105 E38407115;

 

  ARRAY E384161 (j) E38416011 E38416021 E38416031 E38416041 E38416051 E38416061 E38416071 E38416081 E38416091 E38416101 E38416111;

  ARRAY E384162 (j) E38416012 E38416022 E38416032 E38416042 E38416052 E38416062 E38416072 E38416082 E38416092 E38416102 E38416112;

  ARRAY E384163 (j) E38416013 E38416023 E38416033 E38416043 E38416053 E38416063 E38416073 E38416083 E38416093 E38416103 E38416113;

  ARRAY E384164 (j) E38416014 E38416024 E38416034 E38416044 E38416054 E38416064 E38416074 E38416084 E38416094 E38416104 E38416114;

  ARRAY E384165 (j) E38416015 E38416025 E38416035 E38416045 E38416055 E38416065 E38416075 E38416085 E38416095 E38416105 E38416115;

 

  ARRAY E38416K1 (j) E38416K011 E38416K021 E38416K031 E38416K041 E38416K051 E38416K061 E38416K071 E38416K081 E38416K091 E38416K101 E38416K111;

  ARRAY E38416K2 (j) E38416K012 E38416K022 E38416K032 E38416K042 E38416K052 E38416K062 E38416K072 E38416K082 E38416K092 E38416K102 E38416K112;

  ARRAY E38416K3 (j) E38416K013 E38416K023 E38416K033 E38416K043 E38416K053 E38416K063 E38416K073 E38416K083 E38416K093 E38416K103 E38416K113;

  ARRAY E38416K4 (j) E38416K014 E38416K024 E38416K034 E38416K044 E38416K054 E38416K064 E38416K074 E38416K084 E38416K094 E38416K104 E38416K114;

  ARRAY E38416K5 (j) E38416K015 E38416K025 E38416K035 E38416K045 E38416K055 E38416K065 E38416K075 E38416K085 E38416K095 E38416K105 E38416K115;

 

  ARRAY E38416I1 (j) E38416I011 E38416I021 E38416I031 E38416I041 E38416I051 E38416I061 E38416I071 E38416I081 E38416I091 E38416I101 E38416I111;

  ARRAY E38416I2 (j) E38416I012 E38416I022 E38416I032 E38416I042 E38416I052 E38416I062 E38416I072 E38416I082 E38416I092 E38416I102 E38416I112;

  ARRAY E38416I3 (j) E38416I013 E38416I023 E38416I033 E38416I043 E38416I053 E38416I063 E38416I073 E38416I083 E38416I093 E38416I103 E38416I113;

  ARRAY E38416I4 (j) E38416I014 E38416I024 E38416I034 E38416I044 E38416I054 E38416I064 E38416I074 E38416I084 E38416I094 E38416I104 E38416I114;

  ARRAY E38416I5 (j) E38416I015 E38416I025 E38416I035 E38416I045 E38416I055 E38416I065 E38416I075 E38416I085 E38416I095 E38416I105 E38416I115;

 

  ARRAY E38416IB1 (j) E38416IB011 E38416IB021 E38416IB031 E38416IB041 E38416IB051 E38416IB061 E38416IB071 E38416IB081 E38416IB091 E38416IB101 E38416IB111;

  ARRAY E38416IB2 (j) E38416IB012 E38416IB022 E38416IB032 E38416IB042 E38416IB052 E38416IB062 E38416IB072 E38416IB082 E38416IB092 E38416IB102 E38416IB112;

  ARRAY E38416IB3 (j) E38416IB013 E38416IB023 E38416IB033 E38416IB043 E38416IB053 E38416IB063 E38416IB073 E38416IB083 E38416IB093 E38416IB103 E38416IB113;

  ARRAY E38416IB4 (j) E38416IB014 E38416IB024 E38416IB034 E38416IB044 E38416IB054 E38416IB064 E38416IB074 E38416IB084 E38416IB094 E38416IB104 E38416IB114;

  ARRAY E38416IB5 (j) E38416IB015 E38416IB025 E38416IB035 E38416IB045 E38416IB055 E38416IB065 E38416IB075 E38416IB085 E38416IB095 E38416IB105 E38416IB115;

 

 

  *** Define the faked sub-arrays for 38329 variables for each of the 5 comp. types, the variables in the five

  related sub-arrays are same because the 38329 variables are only about the single comp. type reported in the beginning;

 

  array e383291b (j) e38329b01-e38329b11;

  array e383292b (j) e38329b01-e38329b11;

  array e383293b (j) e38329b01-e38329b11;

  array e383294b (j) e38329b01-e38329b11;

  array e383295b (j) e38329b01-e38329b11;

 

  array e383291d (j) e38329d01-e38329d11;

  array e383292d (j) e38329d01-e38329d11;

  array e383293d (j) e38329d01-e38329d11;

  array e383294d (j) e38329d01-e38329d11;

  array e383295d (j) e38329d01-e38329d11;

 

  array e383291k (j) e38329k01-e38329k11;

  array e383292k (j) e38329k01-e38329k11;

  array e383293k (j) e38329k01-e38329k11;

  array e383294k (j) e38329k01-e38329k11;

  array e383295k (j) e38329k01-e38329k11;

 

  array e383291i (j) e38329i01-e38329i11;

  array e383292i (j) e38329i01-e38329i11;

  array e383293i (j) e38329i01-e38329i11;

  array e383294i (j) e38329i01-e38329i11;

  array e383295i (j) e38329i01-e38329i11;

 

  array e383291ib (j) e38329ib01-e38329ib11;

  array e383292ib (j) e38329ib01-e38329ib11;

  array e383293ib (j) e38329ib01-e38329ib11;

  array e383294ib (j) e38329ib01-e38329ib11;

  array e383295ib (j) e38329ib01-e38329ib11;

 

 

  **** First level of arrays, for 5 comp. types;

 

  array e21200 (t) e212002-e212006;

 

  array e21600 (t) e216001-e216005;

  array e22500 (t) e225001-e225005;

  array e22550 (t) e225501-e225505;

  array e22530 (t) e225301-e225305;

  array e22535 (t) e225351-e225355;

 

  array ct1unit (t) e22613-e22617;

  array ct1amt  (t) e22628-e22632;

  array ct1days (t) e22628e e22629e e22630e e22631e e22632e;

  array ct1prju  (t) e22628c e22629c e22630c e22631c e22632c;

  array ct1prjt  (t) e22628cb e22629cb e22630cb e22631cb e22632cb;

 

  array e10205 (t) e102051-e102055;

  array e10214 (t) e102141-e102145;

  array e10214b (t) e10214b1-e10214b5;

  array e10214aaa (t) e10214aaa1-e10214aaa5;

  array e10214aab (t) e10214aab1-e10214aab5;

 

  array ct2unit (t) e100234 e100235 e100236 e100237 e100239;

  array ct2amt  (t) e100250-e100254;

  array ct2days (t) e100250e e100251e e100252e e100253e e100254e;

  array ct2prju  (t) e100250c e100251c e100252c e100253c e100254c;

  array ct2prjt  (t) e100250cb e100251cb e100252cb e100253cb e10025cb;

 

  array e38329b (t) e383291b e383292b e383293b e383294b e3832995b;

  array e38329d (t) e383291d e383292d e383293d e383294d e383295d;

  array e38329k (t) e383291k e383292k e383293k e383294k e383295k;

  array e38329i (t) e383291i e383292i e383293i e383294i e383295i;

  array e38329ib (t) e383291ib e383292ib e383293ib e383294ib e383295ib;

 

  array e38407 (t) e384071-e384075;

  array e38416 (t) e384161-e384165;

  array e38416k (t) e38416k1-e38416k5;

  array e38416i (t) e38416i1-e38416i5;

  array e38416ib (t) e38416ib1-e38416ib5;

 

  array e22510 (t) e225101-e225105;

 

  ***** Define the faked arrays for variables ECURR, EUID and WKSWK;

  array ecur1 (j) ecurr01-ecurr11;

  array ecur2 (j) ecurr01-ecurr11;

  array ecur3 (j) ecurr01-ecurr11;

  array ecur4 (j) ecurr01-ecurr11;

  array ecur5 (j) ecurr01-ecurr11;

 

  array euidd1 (j) euid01-euid11;

  array euidd2 (j) euid01-euid11;

  array euidd3 (j) euid01-euid11;

  array euidd4 (j) euid01-euid11;

  array euidd5 (j) euid01-euid11;

 

  array ecur (t) ecur1-ecur5;

  array euidd (t) euidd1-euidd5;

 

  ***** Variables created;

 

  **** Second level of arrays: for nine jobs;

 

  array cpunit1 (j) cpunit101-cpunit111;

  array cpunit2 (j) cpunit201-cpunit211;

  array cpunit3 (j) cpunit301-cpunit311;

  array cpunit4 (j) cpunit401-cpunit411;

  array cpunit5 (j) cpunit501-cpunit511;

 

  array cpdays1 (j) cpdays101-cpdays111;

  array cpdays2 (j) cpdays201-cpdays211;

  array cpdays3 (j) cpdays301-cpdays311;

  array cpdays4 (j) cpdays401-cpdays411;

  array cpdays5 (j) cpdays501-cpdays511;

 

  array cpprju1 (j) cpprju101-cpprju111;

  array cpprju2 (j) cpprju201-cpprju211;

  array cpprju3 (j) cpprju301-cpprju311;

  array cpprju4 (j) cpprju401-cpprju411;

  array cpprju5 (j) cpprju501-cpprju511;

 

  array cpprjt1 (j) cpprjt101-cpprjt111;

  array cpprjt2 (j) cpprjt201-cpprjt211;

  array cpprjt3 (j) cpprjt301-cpprjt311;

  array cpprjt4 (j) cpprjt401-cpprjt411;

  array cpprjt5 (j) cpprjt501-cpprjt511;

 

  array cpamt1 (j) cpamt101-cpamt111;

  array cpamt2 (j) cpamt201-cpamt211;

  array cpamt3 (j) cpamt301-cpamt311;

  array cpamt4 (j) cpamt401-cpamt411;

  array cpamt5 (j) cpamt501-cpamt511;

 

  array cpwkly1 (j) cpwkly101-cpwkly111;

  array cpwkly2 (j) cpwkly201-cpwkly211;

  array cpwkly3 (j) cpwkly301-cpwkly311;

  array cpwkly4 (j) cpwkly401-cpwkly411;

  array cpwkly5 (j) cpwkly501-cpwkly511;

 

  **** First level of arrays: for five comp. types;

 

  array cpunit (t) cpunit1-cpunit5;

  array cpdays (t) cpdays1-cpdays5;

  array cpprju (t) cpprju1-cpprju5;

  array cpprjt (t)cpprjt1-cpprjt5;

  array cpamt (t) cpamt1-cpamt5;

  array cpwkly (t) cpwkly1-cpwkly5;

 

 

  ***** Intialize variables;

 

  do t=1 to 5;

    do j=1 to 11;

      cpunit=-4;

      cpamt=-4;

      cpdays=-4;

      cpprju=-4;

      cpprjt=-4;

      cpwkly=-4;

    end;

  end;

 

 

  /*------------------------------  The process to create weekly compensation --------------------------*/

 

 

 

  ***** Time Unit;

  do t=1 to 5;

    do j=1 to 11;

      if e21600 not in (.,-4,-5) then cpunit=e21600;

      if ct1unit not in (.,-4,-5) then cpunit=ct1unit;

      if e10205 not in (.,-4,-5) then cpunit=e10205;

      if ct2unit not in (.,-4,-5) then cpunit=ct2unit;

      if e38329b not in (.,-4,-5) and e21200=1 then cpunit=e38329b;

      if e38407 not in (.,-4,-5) then cpunit=e38407;

    end;

  end;

 

 

  ***** Number of Days Per Week;

  do t=1 to 5;

    do j=1 to 11;

      if e22550 not in (.,-4,-5) then cpdays=e22550;

      if ct1days not in (.,-4,-5) then cpdays=ct1days;

      if e10214b not in (.,-4,-5) then cpdays=e10214b;

      if ct2days not in (.,-4,-5) then cpdays=ct2days;

      if e38329k not in (.,-4,-5) and e21200=1 then cpdays=e38329k;

      if e38416k not in (.,-4,-5) then cpdays=e38416k;

    end;

  end;

 

 

 

  ***** Time Unit to Finish One Item or Job if reporting "Per Item" or "Per Job";

  do t=1 to 5;

    do j=1 to 11;

      if e22530 not in (.,-4,-5) then cpprju=e22530;

      if ct1prju not in (.,-4,-5) then cpprju=ct1prju;

      if e10214aaa not in (.,-4,-5) then cpprju=e10214aaa;

      if ct2prju not in (.,-4,-5) then cpprju=ct2prju;

      if e38329i not in (.,-4,-5) and e21200=1 then cpprju=e38329i;

      if e38416i not in (.,-4,-5) then cpprju=e38416i;

    end;

  end;

 

 

  ***** Amount of Time to Finish One Item or Job if Reporting "Per Item" or "Per Job";

  do t=1 to 5;

    do j=1 to 11;

      if e22535 not in (.,-4,-5) then cpprjt=e22535;

      if ct1prjt not in (.,-4,-5) then cpprjt=ct1prjt;

      if e10214aab not in (.,-4,-5) then cpprjt=e10214aab;

      if ct2prjt not in (.,-4,-5) then cpprjt=ct2prjt;

      if e38329ib not in (.,-4,-5) and e21200=1 then cpprjt=e38329ib;

      if e38416ib not in (.,-4,-5) then cpprjt=e38416ib;

    end;

  end;

 

  ***** Amount;

  do t=1 to 5;

    do j=1 to 11;

      if e22500 not in (.,-4,-5) then cpamt=e22500;

      if ct1amt not in (.,-4,-5) then cpamt=ct1amt;

      if e10214 not in (.,-4,-5) then cpamt=e10214;

      if ct2amt not in (.,-4,-5) then cpamt=ct2amt;

      if e38329d not in (.,-4,-5) and e21200=1 then cpamt=e38329d;

      if e38416 not in (.,-4,-5) then cpamt=e38416;

    end;

  end;

 

 

  ***** Weekly compensation pay;

 

  **** First, define and calculate total hours, which will be the no. of hours worked for other comp.;

 

  array tt1hrs (j) tthrs01-tthrs11;

  array tt2hrs (j) tthrs01-tthrs11;

  array tt3hrs (j) tthrs01-tthrs11;

  array tt4hrs (j) tthrs01-tthrs11;

  array tt5hrs (j) tthrs01-tthrs11;

 

  array hour1s (j) hours01-hours11;

  array hour2s (j) hours01-hours11;

  array hour3s (j) hours01-hours11;

  array hour4s (j) hours01-hours11;

  array hour5s (j) hours01-hours11;

 

  array ot1hrs (j) othrs01-othrs11;

  array ot2hrs (j) othrs01-othrs11;

  array ot3hrs (j) othrs01-othrs11;

  array ot4hrs (j) othrs01-othrs11;

  array ot5hrs (j) othrs01-othrs11;

 

  array tthrs (t) tt1hrs tt2hrs tt3hrs tt4hrs tt5hrs;

  array hours (t) hour1s hour2s hour3s hour4s hour5s;

  array othrs (t) ot1hrs ot2hrs ot3hrs ot4hrs ot5hrs;

 

  do t=1 to 5;

    do j=1 to 11;

      tthrs=-4;

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

      else if hours=-4 and othrs=-4 then tthrs=-4;

      else if hours=-4 and othrs ge 0  then tthrs=othrs;

      else if othrs=-4 and hours ge 0  then tthrs=hours;

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

    end;

  end;

 

  **** No. of weeks per year;

 

  array cpwks1 (j) otwks01-otwks11;

  array cpwks2 (j) otwks01-otwks11;

  array cpwks3 (j) otwks01-otwks11;

  array cpwks4 (j) otwks01-otwks11;

  array cpwks5 (j) otwks01-otwks11;

 

  array cpwks (t) cpwks1-cpwks5;

 

  **** Calculate the Weekly Compensation Pay;

 

  do t=1 to 5;

    do j=1 to 11;

      if cpunit=-4 then cpwkly=-4;

      else if cpunit in (9,14) then cpwkly=0;

      else if cpunit in (1,21) then do;

        if cpamt ge 0 and tthrs ge 0 then cpwkly=cpamt*tthrs;

        else cpwkly=-3;

      end;

      else if cpamt ge 0 and cpunit in (12,13) and cpprju in (1,2) then do;

        if cpprju=1 and cpprjt>0 and tthrs ge 0 then cpwkly=(cpamt/cpprjt)*60*tthrs;

        else if cpprju=2 and cpprjt>0 and tthrs ge 0 then cpwkly=(cpamt/cpprjt)*tthrs;

        else cpwkly=-3;

      end;

 

      else if cpamt ge 0 then do;

        if cpunit in (2,22) then do;

          if cpdays gt 0 then cpwkly=cpamt*cpdays;

          else cpwkly=-3;

        end;

 

        else if cpunit in (3,23) then cpwkly=cpamt;

        else if cpunit in (4,24) then cpwkly=cpamt/2;

        else if cpunit in (5,25) then cpwkly=cpamt/4.3;

        else if cpunit in (6,26) then do;

          if cpwks gt 0 then cpwkly=cpamt/cpwks;

          else cpwkly=-3;

        end;

        else if cpunit in (8,28) then cpwkly=cpamt/2.15;

 

        else if cpunit in (12,13) then do;

          if cpprjt gt 0 then do;

            if cpprju=3 then do;

              if cpdays gt 0 then cpwkly=(cpamt/cpprjt)*cpdays;

              else cpwkly=-3;

            end;

            else if cpprju=4 then cpwkly=cpamt/cpprjt;

            else if cpprju=5 then cpwkly=cpamt/(cpprjt*4.3);

            else cpwkly=-3;

          end;

          else cpwkly=-3;

        end;

        else if cpunit=16 then do;

          flagcp16=1;

          cpwkly=-3;

        end;

 

        else cpwkly=-3;

      end;

 

      else if cpamt ne -4 then cpwkly=-3;

 

    end;

  end;

 

  *** bad time unit for compensations;

 

  perjobck=0;

 

  unit7cp=0;

  unit16cp=0;

  unit9cp=0;

 

  do t=1 to 5;

    do j=1 to 11;

      if cpunit=7 then unit7cp=1;

      if cpunit=16 then unit16cp=1;

      if cpunit=999 then unit9cp=1;

 

    end;

  end;

 

 

 

 

  /*--------------------------------------------------------------------------------------------------------*/

 

  /*---------------------------------Hourly Total compensation for Each Job---------------------------------*/

 

  /*--------------------------------------------------------------------------------------------------------*/

 

 

  /*--------------------------------------------------------------------------------------------------------*/

 

  /* After computing the hourly overtime payment and hourly other compensation payment. Putting these info.

     together with hourly regular pay and working hours, the hourly total compensation will be created. */

 

  /*--------------------------------------------------------------------------------------------------------*/

 

   ***** Redefine the arrays that are going to be used in this last step so the format will be unified;

 

   array hrly hrly01-hrly11;

   array hrs hrs01-hrs11;

   array ot ot01-ot11;

   array othr othr01-othr11;

   array comp1 comp101-comp111;

   array comp2 comp201-comp211;

   array comp3 comp301-comp311;

   array comp4 comp401-comp411;

   array comp5 comp501-comp511;

 

   array ttcomp ttcomp01-ttcomp11;

 

   array ttlhrs tthrs01-tthrs11;

 

   **** Change the created hours or payment info. with value -4 to value 0;

   array var hourly01-hourly11 hours01-hours11 othrly01-othrly11 othrs01-othrs11

             cpwkly101-cpwkly111 cpwkly201-cpwkly211 cpwkly301-cpwkly311 cpwkly401-cpwkly411 cpwkly501-cpwkly511;

   array temp  hrly01-hrly11 hrs01-hrs11 ot01-ot11 othr01-othr11

               comp101-comp111 comp201-comp211 comp301-comp311 comp401-comp411 comp501-comp511;

   do over var;

     temp=var;

     if var=-4 then temp=0;

   end;

 

 

   ***** Initialize the total hourly compensation;

   do i=1 to 11;

     ttcomp[i]=-4;

   end;

 

   ***** Calculate the total compensation;

 

   do i=1 to 11;

    if -4<hrly[i]<0 or -4<ot[i]<0 or -4<comp1[i]<0 or -4<comp2[i]<0 or -4<comp3[i]<0 or -4<comp4[i]<0 or

       -4<comp5[i]<0 or -4<hrs[i]<0 or -4<othr[i]<0  then ttcomp[i]=-3;

    else if ttlhrs[i]=0 then ttcomp[i]=-3;

    else if ttlhrs[i] ne -4 then ttcomp[i]

            =( hrly[i]*hrs[i] + ot[i]*othr[i]+ comp1[i]+comp2[i]+comp3[i]+comp4[i]+comp5[i])/ttlhrs[i];

   end;

 

 

  *** Cases whose job UID is not -4, it's not a military job, but they didn't answer the wage or compensation related

      questions in this round. We use flag variable "flagg1" created in hourly wage program to identify these people.

      And "oldcompe" created in hourly wage program is ued as ttcomp;

 

  array oldcomp oldcomp01-oldcomp11;

 

  flagg2=0;

  if flagg1=1 then do;

    do i=1 to 11;

      if oldcomp[i] ne -99 then do;

        ttcomp[i]=oldcomp[i];

        flagg2=1;

      end;

    end;

  end;

 

  *** Not interviewed;

 

  do i=1 to 11;

    if e21200011=-5 then ttcomp[i]=-5;

  end;

endsas;


Return to top Return to Table of Contents