Skip to main content

NLSY79

NLSY79 Appendix 8: Highest Grade Completed & Enrollment Status Variable Creation

Introduction

Data releases since 2018 have included a created variable depicting the Highest Grade Ever Completed (HGC_EVER), found in the KEY VARIABLES area of interest. This XRND variable incorporates information through the respondent's most recent interview and will be updated each round. The program that created this variable is accessible through a link at the end of this appendix.

The Highest Grade Completed variables for individual survey years are still available from 1979-2016. The series of programming statements used to create the Highest Grade Completed variables from 1990-2016 and Enrollment Status as of May 1st Survey Year from 1990-2006 are also accessible through a link at the end of this appendix. These programs created the original version of these variables. A review conducted in 1993-1994, resulted in the survey year variables Highest Grade Completed (Revised) (HGCREV) and Enrollment Status as of May 1 Survey Year (Revised) (ENROLLMTREV). While the programs accessible in this appendix created the original variables, the individual revisions are not included in the programs.

The general sources of error addressed in the survey year revised versions of the variables (HGCREV and ENROLLMTREV) are:

  • grade "reversals," in which a respondent completed a lower grade in a later year, rather than staying in the same grade or advancing: The programs accessible through this appendix do not account the individual corrections that were made for these cases, the largest source of which have been respondents enrolled in college;
  • respondents with incomplete or ambiguous school information, preventing the computation in a given year of an HGCREV or ENROLLMTREV variable (a problem which can then continue through subsequent years, even if the respondent reported attending school in later survey years).

Decision rules for adjustments reflected in the revised variables include:

  • Cases with grade reversals were coded as the highest grade completed previously reported by the respondent;
  • A minimum HGCREV code of 12 was assigned to cases in which no high school diploma or GED had been received, but some college attendance was reported;
  • An HGCREV code of 16 was assigned to cases in which a four-year degree had obviously been earned in 5 or more years;
  • Cases in which the highest grade completed was reported as "ungraded" were assigned the previous highest grade completed reported by the respondent;
  • HGCREV values were evaluated in comparison to the May 1st of survey year date where possible and corrected if necessary;
  • Cases in which the longitudinal record is highly erratic and HGCREV could not be computed or revised reliably were assigned a code of "-3" (invalid missing)

Program statements

Programs that create the XRND variable HGC_EVER and the survey year HGCREV and ENROLLMTREV variables can be accessed by clicking below:

 HIGHEST GRADE EVER COMPLETED AS OF MOST RECENT INTERVIEW

hgcrev20 = -4;
if (q3_4_2020 = -5) then hgcrev20 = -5;
else if (q3_1_2020 = 1 & q3_4_2020 >= 12 & q3_4_2020 < 95) then hgcrev20 = q3_4_2020;
else if (q3_1_2020 = 1 & q3_7_2020 = 1 & q3_4_2020 < 12) then hgcrev20 = 12;
else if (q3_1_2020 = 1 & q3_4_2020 > 0 & q3_4_2020 < 12) then hgcrev20 = q3_4_2020;
else if (q3_1_2020 = 1 & q3_4_2020 = 95) then hgcrev20 = -3;
else if (q3_1_2020 = 0 & hgc_ever_xrnd > -4) then hgcrev20 = hgc_ever_xrnd;
else if (q3_1_2020 = 0 & hgcrev16c > -4) then hgcrev20 = hgcrev16c;
else if (q3_1_2020 = 0 & hgcrev14c > -4) then hgcrev20 = hgcrev14c;
else if (q3_1_2020 = 0 & hgcrev12c > -4) then hgcrev20 = hgcrev12c;
else if (q3_1_2020 = 0 & hgcrev10c > -4) then hgcrev20 = hgcrev10c;
else if (q3_1_2020 = 0 & hgcrev08c > -4) then hgcrev20 = hgcrev08c;
else if (q3_1_2020 = 0 & hgcrev06c > -4) then hgcrev20 = hgcrev06c;
else if (q3_1_2020 = 0 & hgcrev04c > -4) then hgcrev20 = hgcrev04c;
else if (q3_1_2020 = 0 & hgcrev02c > -4) then hgcrev20 = hgcrev02c;
else if (q3_1_2020 = 0 & hgcrev00c > -4) then hgcrev20 = hgcrev00c;
else if (q3_1_2020 = 0 & hgcrev98c > -4) then hgcrev20 = hgcrev98c;
else if (q3_1_2020 = 0 & hgcrev96c > -4) then hgcrev20 = hgcrev96c;
else if (q3_1_2020 = 0 & hgcrev94c > -4) then hgcrev20 = hgcrev94c;
else if (q3_1_2020 = 0 & hgcrev93c > -4) then hgcrev20 = hgcrev93c;
else if (q3_1_2020 = 0 & hgcrev92c > -4) then hgcrev20 = hgcrev92c;
else if (q3_1_2020 = 0 & hgcrev91c > -4) then hgcrev20 = hgcrev91c;
else if (q3_1_2020 = 0 & hgcrev90c > -4) then hgcrev20 = hgcrev90c;
else if (q3_1_2020 = 0 & hgcrev89c > -4) then hgcrev20 = hgcrev89c;
else if (q3_1_2020 = 0 & hgcrev88c > -4) then hgcrev20 = hgcrev88c;
else if (q3_1_2020 = 0 & hgcrev87c > -4) then hgcrev20 = hgcrev87c;
else if (q3_1_2020 = 0 & hgcrev86c > -4) then hgcrev20 = hgcrev86c;
else if (q3_1_2020 = 0 & hgcrev85c > -4) then hgcrev20 = hgcrev85c;
else if (q3_1_2020 = 0 & hgcrev84c > -4) then hgcrev20 = hgcrev84c;
else if (q3_1_2020 = 0 & hgcrev83c > -4) then hgcrev20 = hgcrev83c;
else if (q3_1_2020 = 0 & hgcrev82c > -4) then hgcrev20 = hgcrev82c;
else if (q3_1_2020 = 0 & hgcrev81c > -4) then hgcrev20 = hgcrev81c;
else if (q3_1_2020 = 0 & hgcrev80c > -4) then hgcrev20 = hgcrev80c;
else if (q3_1_2020 = 0 & hgcrev79c > -4) then hgcrev20 = hgcrev79c;

hgc_ever=-4;
if (hgcrev20 > -4) then hgc_ever = hgcrev20;
else if (hgc_ever_xrnd > -4) then hgc_ever = hgc_ever_xrnd; /* hgc_ever is best info thru dli - so use as dli hgc */
else if (hgcrev16c > -4) then hgc_ever = hgcrev16c;
else if (hgcrev14c > -4) then hgc_ever = hgcrev14c;
else if (hgcrev12c > -4) then hgc_ever = hgcrev12c;
else if (hgcrev10c > -4) then hgc_ever = hgcrev10c;
else if (hgcrev08c > -4) then hgc_ever = hgcrev08c;
else if (hgcrev06c > -4) then hgc_ever = hgcrev06c;
else if (hgcrev04c > -4) then hgc_ever = hgcrev04c;
else if (hgcrev02c > -4) then hgc_ever = hgcrev02c;
else if (hgcrev00c > -4) then hgc_ever = hgcrev00c;
else if (hgcrev98c > -4) then hgc_ever = hgcrev98c;
else if (hgcrev96c > -4) then hgc_ever = hgcrev96c;
else if (hgcrev94c > -4) then hgc_ever = hgcrev94c;
else if (hgcrev93c > -4) then hgc_ever = hgcrev93c;
else if (hgcrev92c > -4) then hgc_ever = hgcrev92c;
else if (hgcrev91c > -4) then hgc_ever = hgcrev91c;
else if (hgcrev90c > -4) then hgc_ever = hgcrev90c;
else if (hgcrev89c > -4) then hgc_ever = hgcrev89c;
else if (hgcrev88c > -4) then hgc_ever = hgcrev88c;
else if (hgcrev87c > -4) then hgc_ever = hgcrev87c;
else if (hgcrev86c > -4) then hgc_ever = hgcrev86c;
else if (hgcrev85c > -4) then hgc_ever = hgcrev85c;
else if (hgcrev84c > -4) then hgc_ever = hgcrev84c;
else if (hgcrev83c > -4) then hgc_ever = hgcrev83c;
else if (hgcrev82c > -4) then hgc_ever = hgcrev82c;
else if (hgcrev81c > -4) then hgc_ever = hgcrev81c;
else if (hgcrev80c > -4) then hgc_ever = hgcrev80c;
else if (hgcrev79c > -4) then hgc_ever = hgcrev79c;

HIGHEST GRADE COMPLETED and ENROLLMENT STATUS as of May 1, 1990

/*  THE FOLLOWING SPSS CODE IS APPLIED TO THE DATA BEFORE THE PLI PROGRAM */ 
/*  IS EXECUTED.  THE PURPOSE OF THE CODE IS TO APPROPRIATELY RECODE      */ 
/*  SELECTED 1979 AND 1980 VARIABLES.                                     */ 
/*                                                                        */ 
/*  DO IF (R2283 EQ 0 OR R2282 EQ 0)                                      */ 
/*  COMPUTE DLEMO79=R2287                                                 */ 
/*  COMPUTE DLEYR79=R2288                                                 */ 
/*  ELSE                                                                  */ 
/*  COMPUTE DLEMO79=R169                                                  */ 
/*  COMPUTE DLEYR79=R170                                                  */ 
/*  END IF                                                                */ 
/*  DO IF (R4052 GT 0 AND R2283 NE 0 AND R2282 NE 0)                      */ 
/*  COMPUTE DLEMO80=R2287                                                 */ 
/*  COMPUTE DLEYR80=R2288                                                 */ 
/*  END IF                                                                */ 
/*  DO IF (R2275 EQ 0 OR R2276 EQ 0)                                      */ 
/*  COMPUTE GRADE79=R2277                                                 */ 
/*  ELSE                                                                  */ 
/*  COMPUTE GRADE79=R2286                                                 */ 
/*  END IF                                                                */ 
/*  DO IF (R2280 GE 0)                                                    */ 
/*  COMPUTE HGCS79=R2280                                                  */ 
/*  ELSE                                                                  */ 
/*  COMPUTE HGCS79=R173                                                   */ 
/*  END IF                                                                */ 
/*  IF (R2276 EQ 0 AND R2286 GT 0) R156=1                                 */
/**************************************************************************/
 
 DCL 1 INREC7989,                                                            
 
     2 CURAT(79:89)  PIC '------9',
          /*  R(  156.) R( 2285.) R( 4168.) R( 6639.) R( 9053.) R(12052.)  */
          /*  R(16045.) R(19050.) R(23059.) R(25084.) R(29075.)            */
 
     2 DIP(79:89)    PIC '------9',
          /*  R(  183.) R( 2300.) R( 4182.) R( 6653.) R( 9067.) R(12066.)  */
          /*  R(16059.) R(19061.) R(23070.) R(25095.) R(29086.)            */
 
     2 DLEMO(79:89)  PIC '------9',
          /*  DLEMO79   DLEMO80   R( 4170.) R( 6641.) R( 9055.) R(12054.)  */
          /*  R(16047.) R(19052.) R(23061.) R(25086.) R(29077.)            */
 
     2 DLEYR(79:89)  PIC '------9',
          /*  DLEYR79   DLEYR80   R( 4171.) R( 6642.) R( 90546) R(12055.)  */
          /*  R(16048.) R(19053.) R(23062.) R(25087.) R(29078.)            */
 
     2 GRADE(79:89)  PIC '------9',
          /*  GRADE79   R( 2286.) R( 4169.) R( 6640.) R( 9054.) R(12053.)  */
          /*  R(16046.) R(19051.) R(23060.) R(25085.) R(29076.)            */
 
 
     2 HGA(79:89)    PIC '------9',
          /*  R(  172.) R( 2291.) R( 4173.) R( 6644.) R( 9058.) R(12057.)  */
          /*  R(16050.) R(19055.) R(23064.) R(25089.) R(29080.)            */
 
     2 HGC(79:89)    PIC '------9',
          /*  R( 2167.) R( 4064.) R( 6189.) R( 8982.) R(11450.) R(15202.)  */
          /*  R(18909.) R(22580.) R(24454.) R(28711.) R(30748.)            */
 
     2 HGCS(79:89)   PIC '------9',
          /*  HGCS79    R( 2292.) R( 4174.) R( 6645.) R( 9059.) R(12058.)  */
          /*  R(16051.) R(19056.) R(23065.) R(25090.) R(29081.)            */
 
     2 INTMO(79:89)  PIC '------9',
          /*  R( 1725.) R( 3292.) R( 5307.) R( 8099.) R(10457.) R(14275.)  */
          /*  R(17946.) R(21562.) R(23657.) R(27425.) R(29861.)            */
 
     2 WEIGHT(79:89) PIC '9999999';
          /*  R( 2161.) R( 4052.) R( 6146.) R( 8967.) R(11444.) R(15196.)  */
          /*  R(18902.) R(22573.) R(24445.) R(28700.) R(30738.)            */
 
 DCL 1 INREC90,
     2 WEIGHT_90    PIC '9999999',  /*  R(34002.)  */
     2 SCHOOL_90,
       5 ASLI_90    PIC '------9',  /*  R(31070.)  */
       5 CURAT_90   PIC '------9',  /*  R(31096.)  */
       5 DIP_90     PIC '------9',  /*  R(31107.)  */
       5 DLEMO_90   PIC '------9',  /*  R(31098.)  */
       5 DLEYR_90   PIC '------9',  /*  R(31099.)  */
       5 GRADE_90   PIC '------9',  /*  R(31097.)  */
       5 HGA_90     PIC '------9',  /*  R(31101.)  */
       5 HGCS_90    PIC '------9',  /*  R(31102.)  */
       5 INTMO_90   PIC '------9',  /*  R(33025.)  */
       5 HAVEDIP_90 PIC '------9',  /*  R(31106.)  */
       5 ATTCOL_90  PIC '------9';  /*  COMPUTE ATTCOL_91=0                */
                                    /*  IF R(31103.)>3 THEN ATTCOL_91=1    */
       5 GRA_90     PIC '------9',  /*  COMPUTE GRA_91=-3                  */
                                    /*  IF R(31096.)=1                     */
                                    /*  THEN GRA_91=R(31097.)              */
                                    /*  ELSE IF R(31096.)=0                */
                                    /*  THEN GRA_91=R(31101.)              */
                                    /*  ELSE IF R(31070.)=0                */
                                    /*  THEN GRA_91=-4                     */
 
 /*  CREATION OF HIGHEST GRADE COMPLETED AND ENROLLMENT STATUS      */
 /*  AS OF 5-1-90                                                   */
 
    HGC_90=-4;
    ENROLL_90=-4;
    DO I=80 TO 89;
       IF WEIGHT(I)=0 THEN DO;
          HGCS(I)=-5;
          GRADE(I)=-5;
       END;    
    END;
    IF WEIGHT_90=0 THEN DO;
       HGCS_90=-5;
       GRADE_90=-5;
       ENROLL_90=-5;
       HGC_90=-5;
    END;
 
  IF WEIGHT_90>0 THEN DO;
    IF ASLI_90=0 & (HAVEDIP_90=-4 ! HAVEDIP_90=0) THEN DO;
        IF WEIGHT(89)>0 THEN DO;
           IF INTMO(89)>=5 & (CURAT(89)=1 ! (DLEMO(89)>=5 & DLEYR(89)=89)) &
              HGCS(89)>HGC(89) THEN HGC_90=HGCS(89);
           ELSE HGC_90=HGC(89);
        END;
        ELSE IF WEIGHT(88)>0 THEN DO;
           IF INTMO(88)>=5 & (CURAT(88)=1 ! (DLEMO(88)>=5 & DLEYR(88)=88)) &
              HGCS(88)>HGC(88) THEN HGC_90=HGCS(88);
           ELSE HGC_90=HGC(88);
        END;
        ELSE IF WEIGHT(87)>0 THEN DO;
           IF INTMO(87)>=5 & (CURAT(87)=1 ! (DLEMO(87)>=5 & DLEYR(87)=87)) &
              HGCS(87)>HGC(87) THEN HGC_90=HGCS(87);
           ELSE HGC_90=HGC(87);
        END;
        ELSE IF WEIGHT(86)>0 THEN DO;
           IF INTMO(86)>=5 & (CURAT(86)=1 ! (DLEMO(86)>=5 & DLEYR(86)=86)) &
              HGCS(86)>HGC(86) THEN HGC_90=HGCS(86);
           ELSE HGC_90=HGC(86);
        END;
        ELSE IF WEIGHT(85)>0 THEN DO;
           IF INTMO(85)>=5 & (CURAT(85)=1 ! (DLEMO(85)>=5 & DLEYR(85)=85)) &
              HGCS(85)>HGC(85) THEN HGC_90=HGCS(85);
           ELSE HGC_90=HGC(85);
        END;
        ELSE IF WEIGHT(84)>0 THEN DO;
           IF INTMO(84)>=5 & (CURAT(84)=1 ! (DLEMO(84)>=5 & DLEYR(84)=84)) &
              HGCS(84)>HGC(84) THEN HGC_90=HGCS(84);
           ELSE HGC_90=HGC(84);
        END;
        ELSE IF WEIGHT(83)>0 THEN DO;
           IF INTMO(83)>=5 & (CURAT(83)=1 ! (DLEMO(83)>=5 & DLEYR(83)=83)) &
              HGCS(83)>HGC(83) THEN HGC_90=HGCS(83);
           ELSE HGC_90=HGC(83);
        END;
        ELSE IF WEIGHT(82)>0 THEN DO;
           IF INTMO(82)>=5 & (CURAT(82)=1 ! (DLEMO(82)>=5 & DLEYR(82)=82)) &
              HGCS(82)>HGC(82) THEN HGC_90=HGCS(82);
           ELSE HGC_90=HGC(82);
        END;
        ELSE IF WEIGHT(81)>0 THEN DO;
           IF INTMO(81)>=5 & (CURAT(81)=1 ! (DLEMO(81)>=5 & DLEYR(81)=81)) &
              HGCS(81)>HGC(81) THEN HGC_90=HGCS(81);
           ELSE HGC_90=HGC(81);
        END;
        ELSE IF WEIGHT(80)>0 THEN DO;
           IF INTMO(80)>=5 & (CURAT(80)=1 ! (DLEMO(80)>=5 & DLEYR(80)=80)) &
              HGCS(80)>HGC(80) THEN HGC_90=HGCS(80);
           ELSE HGC_90=HGC(80);
        END;
        ELSE DO;
           IF INTMO(79)>=5 & (CURAT(79)=1 ! (DLEMO(79)>=5 & DLEYR(79)=79)) &
              HGCS(79)>HGC(79) THEN HGC_90=HGCS(79);
           ELSE HGC_90=HGC(79);
        END;
        IF HGC_90>=12 THEN ENROLL_90=4;
        ELSE IF HGC_90>=0 THEN ENROLL_90=1;
     END;
     ELSE IF ASLI_90=1 THEN DO;
        IF HGCS_90<=0 THEN DO;
           IF CURAT_90=1 & GRADE_90>=1 THEN DO;
              HGC_90=GRADE_90-1;
              IF HGC_90>=12 THEN ENROLL_90=3;
              ELSE ENROLL_90=2;
           END;
           ELSE IF CURAT_90=0 & HGA_90>=1 THEN DO;
              IF DLEYR_90<90 ! DLEMO_90<5 THEN DO;
                 HGC_90=HGA_90;
                 IF HGC_90>=12 THEN ENROLL_90=4;
                 ELSE ENROLL_90=1;
              END;
              ELSE DO;
                 HGC_90=HGA_90-1;
                 IF HGC_90>=12 THEN ENROLL_90=4;
                 ELSE ENROLL_90=1;
              END;
           END;
        END;
        ELSE DO;
           IF HGCS_90=HGA_90 ! HGCS_90=GRADE_90 THEN DO;
              IF (DLEYR_90=90 & DLEMO_90>=5) ! (INTMO_90>=5 &
                 CURAT_90=1) THEN DO;
                 HGC_90=HGCS_90-1;
                 IF HGC_90>=12 THEN ENROLL_90=3;
                 ELSE ENROLL_90=2;
              END;
              ELSE HGC_90=HGCS_90;
           END;
           IF HGCS_90=HGA_90-1 ! HGCS_90=GRADE_90-1 THEN
              HGC_90=HGCS_90;
           ELSE IF (HGCS_90<HGA_90 & HGA_90>0 & HGA_90<20) !
              (HGCS_90<GRADE_90 & GRADE_90>0 & GRADE_90<20) THEN
              HGC_90=HGCS_90;
           IF ENROLL_90=-4 & CURAT_90=1 & HGC_90>=0 THEN DO;
              IF HGC_90>=12 THEN ENROLL_90=3;
              ELSE ENROLL_90=2;
           END;
           IF ENROLL_90=-4 & CURAT_90=0 & HGC_90>=0 THEN DO;
              IF HGC_90>=12 THEN ENROLL_90=4;
              ELSE ENROLL_90=1;
           END;
        END;
     END;
     IF ((HGC_90=10 ! HGC_90=11) & (HAVEDIP_90=1 ! ATTCOL_90=1)) !
       (DIP_90=2 & HGC_90<12) ! (HGC_90=-4 & (DIP_90=1 ! DIP_90=3))
        THEN DO;
        HGC_90=12;
        IF ENROLL_90>0 THEN ENROLL_90=5-ENROLL_90;
        ELSE IF CURAT_90=1 ! (DLEYR_90=90 & DLEMO_90>=5) THEN ENROLL_90=3;
        ELSE ENROLL_90=4;
     END;
     ELSE IF HGC_90<0 & DIP_90=-3 THEN DO;
        HGC_90=-3;
        ENROLL_90=-3;
     END;
     IF HGC_90>20 THEN DO;
        HGC_90=-3;
        ENROLL_90=-3;
     END;
     IF HGC_90>HGC(89)+3 & HGC(89)>0 & DIP_90^=2 & DIP_90^=3 THEN DO;
        HGC_90=-3;
        ENROLL_90=-3;
     END;
     IF HGC_90>0 & HGC_90<HGC(89)-1 ! (HGC(89)=12 & HGC_90=11) THEN DO;
        HGC_90=-3;
        ENROLL_90=-3;
     END;
     IF (DIP(79)>1 ! DIP(80)>1 ! DIP(81)>1 ! DIP(82)>1 ! DIP(83)>1 ! 
         DIP(84)>1 ! DIP(85)>1 ! DIP(86)>1 ! DIP(87)>1 ! DIP(88)>1 ! 
         DIP(89)>1) & HGC_90<12 THEN DO;
        HGC_90 =12;
        IF ENROLL_90=1 ! ENROLL_90<0 THEN ENROLL_90=4;
     END;
     IF HGC_90=-3 & ENROLL_90=-4 THEN ENROLL_90=-3;
     ELSE IF HGC_90=-4 & ENROLL_90=-4 THEN DO;
        HGC_90=-3;
        ENROLL_90=-3;
     END;
 END;
 
 HGC_90=R(34015.)
 ENROLL_90=R(34016.)
 
 /*  EACH INSTANCE OF -3 FOR HIGHEST GRADE COMPLETED AND ENROLLMENT STATUS      */
 /*  IS REVIEWED BY CHECKING SELECTED SCHOOL VARIABLES.  VALUES OF -3 ARE       */
 /*  RECODED TO VALID VALUES WHERE AUXILLIARY INFORMATION INDICATES.            */
 /*  HOWEVER, THERE ARE A NUMBER OF -3'S COMPUTED FOR HIGHEST GRADE             */
 /*  COMPLETED AND ENROLLMENT STATUS THAT REMAIN.                               */

HIGHEST GRADE COMPLETED and ENROLLMENT STATUS as of May 1, 1991

/*  THE FOLLOWING SPSS CODE IS APPLIED TO THE DATA BEFORE THE PLI PROGRAM       */
/*  IS EXECUTED.  THE PURPOSE OF THE CODE IS TO APPROPRIATELY RECODE SELECTED   */
/*  1979 AND 1980 VARIABLES.                                                    */
/*                                                                              */
/*  DO IF (R2283 EQ 0 OR R2282 EQ 0)                                            */
/*  COMPUTE DLEMO79=R2287                                                       */
/*  COMPUTE DLEYR79=R2288                                                       */
/*  ELSE                                                                        */
/*  COMPUTE DLEMO79=R169                                                        */
/*  COMPUTE DLEYR79=R170                                                        */
/*  END IF                                                                      */
/*  DO IF (R4052 GT 0 AND R2283 NE 0 AND R2282 NE 0)                            */
/*  COMPUTE DLEMO80=R2287                                                       */
/*  COMPUTE DLEYR80=R2288                                                       */
/*  END IF                                                                      */
/*  DO IF (R2275 EQ 0 OR R2276 EQ 0)                                            */
/*  COMPUTE GRADE79=R2277                                                       */
/*  ELSE                                                                        */
/*  COMPUTE GRADE79=R2286                                                       */
/*  END IF                                                                      */
/*  DO IF (R2280 GE 0)                                                          */
/*  COMPUTE HGCS79=R2280                                                        */
/*  ELSE                                                                        */
/*  COMPUTE HGCS79=R173                                                         */
/*  END IF                                                                      */
/*  IF (R2276 EQ 0 AND R2286 GT 0) R156=1                                       */
/********************************************************************************/
 
 DCL 1 INREC7990,                                                            
 
     2 CURAT(79:90)  PIC '------9',
          /*  R(  156.) R( 2285.) R( 4168.) R( 6639.) R( 9053.) R(12052.)  */
          /*  R(16045.) R(19050.) R(23059.) R(25084.) R(29075.) R(31096.)  */
 
     2 DIP(79:90)    PIC '------9',
          /*  R(  183.) R( 2300.) R( 4182.) R( 6653.) R( 9067.) R(12066.)  */
          /*  R(16059.) R(19061.) R(23070.) R(25095.) R(29086.) R(31107.)  */
 
     2 DLEMO(79:90)  PIC '------9',
          /*  DLEMO79   DLEMO80   R( 4170.) R( 6641.) R( 9055.) R(12054.)  */
          /*  R(16047.) R(19052.) R(23061.) R(25086.) R(29077.) R(31098.)  */
 
     2 DLEYR(79:90)  PIC '------9',
          /*  DLEYR79   DLEYR80   R( 4171.) R( 6642.) R( 90546) R(12055.)  */
          /*  R(16048.) R(19053.) R(23062.) R(25087.) R(29078.) R(31099.)  */
 
     2 GRADE(79:90)  PIC '------9',
          /*  GRADE79   R( 2286.) R( 4169.) R( 6640.) R( 9054.) R(12053.)  */
          /*  R(16046.) R(19051.) R(23060.) R(25085.) R(29076.) R(31097.)  */
 
     2 HGA(79:90)    PIC '------9',
          /*  R(  172.) R( 2291.) R( 4173.) R( 6644.) R( 9058.) R(12057.)  */
          /*  R(16050.) R(19055.) R(23064.) R(25089.) R(29080.) R(31101.)  */
 
     2 HGC(79:90)    PIC '------9',
          /*  R( 2167.) R( 4064.) R( 6189.) R( 8982.) R(11450.) R(15202.)  */
          /*  R(18909.) R(22580.) R(24454.) R(28711.) R(30748.) R(34015.)  */
 
     2 HGCS(79:90)   PIC '------9',
          /*  HGCS79    R( 2292.) R( 4174.) R( 6645.) R( 9059.) R(12058.)  */
          /*  R(16051.) R(19056.) R(23065.) R(25090.) R(29081.) R(31102.)  */
 
     2 INTMO(79:90)  PIC '------9',
          /*  R( 1725.) R( 3292.) R( 5307.) R( 8099.) R(10457.) R(14275.)  */
          /*  R(17946.) R(21562.) R(23657.) R(27425.) R(29861.) R(33025.)  */
 
     2 WEIGHT(79:90) PIC '9999999';
          /*  R( 2161.) R( 4052.) R( 6146.) R( 8967.) R(11444.) R(15196.)  */
          /*  R(18902.) R(22573.) R(24445.) R(28700.) R(30738.) R(34002.)  */
 
 DCL 1 INREC91,
     2 WEIGHT_91    PIC '9999999',  /*  R(36558.)  */
     2 SCHOOL_91,
       5 ASLI_91    PIC '------9',  /*  R(35070.)  */
       5 CURAT_91   PIC '------9',  /*  R(35096.)  */
       5 DIP_91     PIC '------9',  /*  R(35107.)  */
       5 DLEMO_91   PIC '------9',  /*  R(35098.)  */
       5 DLEYR_91   PIC '------9',  /*  R(35099.)  */
       5 GRADE_91   PIC '------9',  /*  R(35097.)  */
       5 HGA_91     PIC '------9',  /*  R(35101.)  */
       5 HGCS_91    PIC '------9',  /*  R(35102.)  */
       5 INTMO_91   PIC '------9',  /*  R(35734.)  */
       5 HAVEDIP_91 PIC '------9',  /*  R(35106.)  */
       5 ATTCOL_91  PIC '------9';  /*  COMPUTE ATTCOL_91=0                */
                                    /*  IF R(35103.)>3 THEN ATTCOL_91=1    */
       5 GRA_91     PIC '------9',  /*  COMPUTE GRA_91=-3                  */
                                    /*  IF R(35096.)=1                     */
                                    /*  THEN GRA_91=R(35097.)              */
                                    /*  ELSE IF R(35096.)=0                */
                                    /*  THEN GRA_91=R(35101.)              */
                                    /*  ELSE IF R(35070.)=0                */
                                    /*  THEN GRA_91=-4                     */
 
  /*  CREATION OF HIGHEST GRADE COMPLETED AND ENROLLMENT STATUS      */
  /*  AS OF 5-1-91                                                   */
 
    HGC_91=-4;
    ENROLL_91=-4;
    DO I=80 TO 90;
       IF WEIGHT(I)=0 THEN DO;
          HGCS(I)=-5;
          GRADE(I)=-5;
       END;    
    END;
    IF WEIGHT_91=0 THEN DO;
       HGCS_91=-5;
       GRADE_91=-5;
       ENROLL_91=-5;
       HGC_91=-5;
    END;
 
  IF WEIGHT_91>0 THEN DO;
    IF ASLI_91=0 & (HAVEDIP_91=-4 ! HAVEDIP_91=0) THEN DO;
       IF WEIGHT(90)>0 THEN DO;
           IF INTMO(90)>=5 & (CURAT(90)=1 ! (DLEMO(90)>=5 & DLEYR(90)=90)) &
              HGCS(90)>HGC(90) THEN HGC_91=HGCS(90);
           ELSE HGC_91=HGC(90);
        END;
       IF WEIGHT(89)>0 THEN DO;
           IF INTMO(89)>=5 & (CURAT(89)=1 ! (DLEMO(89)>=5 & DLEYR(89)=89)) &
              HGCS(89)>HGC(89) THEN HGC_91=HGCS(89);
           ELSE HGC_91=HGC(89);
        END;
        ELSE IF WEIGHT(88)>0 THEN DO;
           IF INTMO(88)>=5 & (CURAT(88)=1 ! (DLEMO(88)>=5 & DLEYR(88)=88)) &
              HGCS(88)>HGC(88) THEN HGC_91=HGCS(88);
           ELSE HGC_91=HGC(88);
        END;
        ELSE IF WEIGHT(87)>0 THEN DO;
           IF INTMO(87)>=5 & (CURAT(87)=1 ! (DLEMO(87)>=5 & DLEYR(87)=87)) &
              HGCS(87)>HGC(87) THEN HGC_91=HGCS(87);
           ELSE HGC_91=HGC(87);
        END;
        ELSE IF WEIGHT(86)>0 THEN DO;
           IF INTMO(86)>=5 & (CURAT(86)=1 ! (DLEMO(86)>=5 & DLEYR(86)=86)) &
              HGCS(86)>HGC(86) THEN HGC_91=HGCS(86);
           ELSE HGC_91=HGC(86);
        END;
        ELSE IF WEIGHT(85)>0 THEN DO;
           IF INTMO(85)>=5 & (CURAT(85)=1 ! (DLEMO(85)>=5 & DLEYR(85)=85)) &
              HGCS(85)>HGC(85) THEN HGC_91=HGCS(85);
           ELSE HGC_91=HGC(85);
        END;
        ELSE IF WEIGHT(84)>0 THEN DO;
           IF INTMO(84)>=5 & (CURAT(84)=1 ! (DLEMO(84)>=5 & DLEYR(84)=84)) &
              HGCS(84)>HGC(84) THEN HGC_91=HGCS(84);
           ELSE HGC_91=HGC(84);
        END;
        ELSE IF WEIGHT(83)>0 THEN DO;
           IF INTMO(83)>=5 & (CURAT(83)=1 ! (DLEMO(83)>=5 & DLEYR(83)=83)) &
              HGCS(83)>HGC(83) THEN HGC_91=HGCS(83);
           ELSE HGC_91=HGC(83);
        END;
        ELSE IF WEIGHT(82)>0 THEN DO;
           IF INTMO(82)>=5 & (CURAT(82)=1 ! (DLEMO(82)>=5 & DLEYR(82)=82)) &
              HGCS(82)>HGC(82) THEN HGC_91=HGCS(82);
           ELSE HGC_91=HGC(82);
        END;
        ELSE IF WEIGHT(81)>0 THEN DO;
           IF INTMO(81)>=5 & (CURAT(81)=1 ! (DLEMO(81)>=5 & DLEYR(81)=81)) &
              HGCS(81)>HGC(81) THEN HGC_91=HGCS(81);
           ELSE HGC_91=HGC(81);
        END;
        ELSE IF WEIGHT(80)>0 THEN DO;
           IF INTMO(80)>=5 & (CURAT(80)=1 ! (DLEMO(80)>=5 & DLEYR(80)=80)) &
              HGCS(80)>HGC(80) THEN HGC_91=HGCS(80);
           ELSE HGC_91=HGC(80);
        END;
        ELSE DO;
           IF INTMO(79)>=5 & (CURAT(79)=1 ! (DLEMO(79)>=5 & DLEYR(79)=79)) &
              HGCS(79)>HGC(79) THEN HGC_91=HGCS(79);
           ELSE HGC_91=HGC(79);
        END;
        IF HGC_91>=12 THEN ENROLL_91=4;
        ELSE IF HGC_91>=0 THEN ENROLL_90=1;
     END;
     ELSE IF ASLI_91=1 THEN DO;
        IF HGCS_91<=0 THEN DO;
           IF CURAT_91=1 & GRADE_91>=1 THEN DO;
              HGC_91=GRADE_91-1;
              IF HGC_91>=12 THEN ENROLL_91=3;
              ELSE ENROLL_91=2;
           END;
           ELSE IF CURAT_91=0 & HGA_91>=1 THEN DO;
              IF DLEYR_91<90 ! DLEMO_91<5 THEN DO;
                 HGC_91=HGA_91;
                 IF HGC_91>=12 THEN ENROLL_91=4;
                 ELSE ENROLL_91=1;
              END;
              ELSE DO;
                 HGC_91=HGA_91-1;
                 IF HGC_91>=12 THEN ENROLL_91=4;
                 ELSE ENROLL_91=1;
              END;
           END;
        END;
        ELSE DO;
           IF HGCS_91=HGA_91 ! HGCS_91=GRADE_91 THEN DO;
              IF (DLEYR_91=91 & DLEMO_91>=5) ! (INTMO_91>=5 &
                 CURAT_91=1) THEN DO;
                 HGC_91=HGCS_91-1;
                 IF HGC_91>=12 THEN ENROLL_91=3;
                 ELSE ENROLL_91=2;
              END;
              ELSE HGC_91=HGCS_91;
           END;
           IF HGCS_91=HGA_91-1 ! HGCS_91=GRADE_91-1 THEN
              HGC_91=HGCS_91;
           ELSE IF (HGCS_91<HGA_91 & HGA_91>0 & HGA_91<20) !
              (HGCS_91<GRADE_91 & GRADE_91>0 & GRADE_91<20) THEN
              HGC_91=HGCS_91;
           IF ENROLL_91=-4 & CURAT_91=1 & HGC_91>=0 THEN DO;
              IF HGC_91>=12 THEN ENROLL_91=3;
              ELSE ENROLL_91=2;
           END;
           IF ENROLL_91=-4 & CURAT_91=0 & HGC_91>=0 THEN DO;
              IF HGC_91>=12 THEN ENROLL_91=4;
              ELSE ENROLL_91=1;
           END;
        END;
     END;
     IF ((HGC_91=10 ! HGC_91=11) & (HAVEDIP_91=1 ! ATTCOL_91=1)) !
       (DIP_91=2 & HGC_91<12) ! (HGC_91=-4 & (DIP_91=1 ! DIP_91=3))
        THEN DO;
        HGC_91=12;
        IF ENROLL_91>0 THEN ENROLL_91=5-ENROLL_90;
        ELSE IF CURAT_91=1 ! (DLEYR_91=91 & DLEMO_91>=5) THEN ENROLL_91=3;
        ELSE ENROLL_91=4;
     END;
     ELSE IF HGC_91<0 & DIP_91=-3 THEN DO;
        HGC_91=-3;
        ENROLL_91=-3;
     END;
     IF HGC_91>20 THEN DO;
        HGC_91=-3;
        ENROLL_91=-3;
     END;
     IF HGC_91>HGC(90)+3 & HGC(90)>0 & DIP_91^=2 & DIP_91^=3 THEN DO;
        HGC_91=-3;
        ENROLL_91=-3;
     END;
     IF HGC_91>0 & HGC_91<HGC(90)-1 ! (HGC(90)=12 & HGC_91=11) THEN DO;
        HGC_91=-3;
        ENROLL_91=-3;
     END;
     IF (DIP(79)>1 ! DIP(80)>1 ! DIP(81)>1 ! DIP(82)>1 ! DIP(83)>1 ! 
         DIP(84)>1 ! DIP(85)>1 ! DIP(86)>1 ! DIP(87)>1 ! DIP(88)>1 ! 
         DIP(89)>1 ! DIP(90)>1) & HGC_91<12 THEN DO;
        HGC_91=12;
        IF ENROLL_91=1 ! ENROLL_91<0 THEN ENROLL_91=4;
     END;
     IF HGC_91=-3 & ENROLL_91=-4 THEN ENROLL_91=-3;
     ELSE IF HGC_91=-4 & ENROLL_91=-4 THEN DO;
        HGC_91=-3;
        ENROLL_91=-3;
     END;
 END;
 
 HGC_91=R(36569.)
 ENROLL_91=R(36570.)
 
 /*  EACH INSTANCE OF -3 FOR HIGHEST GRADE COMPLETED AND ENROLLMENT STATUS      */
 /*  IS REVIEWED BY CHECKING SELECTED SCHOOL VARIABLES.  VALUES OF -3           */
 /*  ARE RECODED TO VALID VALUES WHERE AUXILLIARY INFORMATION INDICATES.        */
 /*  HOWEVER, THERE ARE A NUMBER OF -3'S COMPUTED FOR HIGHEST GRADE             */
 /*  COMPLETED AND ENROLLMENT STATUS THAT REMAIN.                               */

HIGHEST GRADE COMPLETED and ENROLLMENT STATUS as of May 1, 1992

 /*  THE FOLLOWING CODE IS APPLIED TO THE DATA BEFORE THE PLI PROGRAM           */
 /*  IS EXECUTED.  THE PURPOSE OF THE CODE IS TO APPROPRIATELY RECODE SELECTED  */
 /*  1979 AND 1980 VARIABLES.                                                   */
 /*                                                                             */
 /* IF (R2283 EQ 0 OR R2282 EQ 0) THEN DO; DLEMO79=R2287; DLEYR79=R2288; END;   */
 /*  ELSE DO; DLEMO79=R169; DLEYR79=R170; END;                                  */
 /* IF (R4052 GT 0 AND R2283 NE 0 AND R2282 NE 0) THEN DO;                      */
 /*  DLEMO80=R2287; DLEYR80=R2288; END;                                         */
 /*  IF (R2275 EQ 0 OR R2276 EQ 0) THEN GRADE79=R2277 ;                         */
 /*  ELSE GRADE79=R2286;                                                        */
 /*  IF (R2280 GE 0) THEN HGCS79=R2280;                                         */
 /*  ELSE                                                                       */
 /*  COMPUTE HGCS79=R173                                                        */
 /*  END IF                                                                     */
 /*  IF (R2276 EQ 0 AND R2286 GT 0) R156=1                                      */
/********************************************************************************/
 
 DCL 1 INREC79OLD,
 
     2 CURAT(79:LASTYR)  PIC '------9',
          /*  R(  156.) R( 2285.) R( 4168.) R( 6639.) R( 9053.) R(12052.)  */
          /*  R(16045.) R(19050.) R(23059.) R(25084.) R(29075.) R(31096.)  */
          /*  R(35096.)  */
     2 DIP(79:LASTYR)    PIC '------9',
          /*  R(  183.) R( 2300.) R( 4182.) R( 6653.) R( 9067.) R(12066.)  */
          /*  R(16059.) R(19061.) R(23070.) R(25095.) R(29086.) R(31107.)  */
          /*  R(35107.)  */
     2 DLEMO(79:LASTYR)  PIC '------9',
          /*  DLEMO79   DLEMO80   R( 4170.) R( 6641.) R( 9055.) R(12054.)  */
          /*  R(16047.) R(19052.) R(23061.) R(25086.) R(29077.) R(31098.)  */
          /*  R(35098.)  */
     2 DLEYR(79:LASTYR)  PIC '------9',
          /*  DLEYR79   DLEYR80   R( 4171.) R( 6642.) R( 90546) R(12055.)  */
          /*  R(16048.) R(19053.) R(23062.) R(25087.) R(29078.) R(31099.)  */
          /*  R(35099.)  */
     2 GRADE(79:LASTYR)  PIC '------9',
          /*  GRADE79   R( 2286.) R( 4169.) R( 6640.) R( 9054.) R(12053.)  */
          /*  R(16046.) R(19051.) R(23060.) R(25085.) R(29076.) R(31097.)  */
          /*  R(35097.)  */
     2 HGA(79:LASTYR)    PIC '------9',
          /*  R(  172.) R( 2291.) R( 4173.) R( 6644.) R( 9058.) R(12057.)  */
          /*  R(16050.) R(19055.) R(23064.) R(25089.) R(29080.) R(31101.)  */
          /*  R(35101.)  */
     2 HGC(79:LASTYR)    PIC '------9',
          /*  R( 2167.) R( 4064.) R( 6189.) R( 8982.) R(11450.) R(15202.)  */
          /*  R(18909.) R(22580.) R(24454.) R(28711.) R(30748.) R(34015.)  */
          /*  R(36569.) */
     2 HGCS(79:LASTYR)   PIC '------9',
          /*  HGCS79    R( 2292.) R( 4174.) R( 6645.) R( 9059.) R(12058.)  */
          /*  R(16051.) R(19056.) R(23065.) R(25090.) R(29081.) R(31102.)  */
          /*  R(35102.)  */
     2 INTMO(79:LASTYR)  PIC '------9',
          /*  R( 1725.) R( 3292.) R( 5307.) R( 8099.) R(10457.) R(14275.)  */
          /*  R(17946.) R(21562.) R(23657.) R(27425.) R(29861.) R(33025.)  */
          /*  R(35734.)  */
     2 WEIGHT(79:LASTYR) PIC '9999999',
          /*  R( 2161.) R( 4052.) R( 6146.) R( 8967.) R(11444.) R(15196.)  */
          /*  R(18902.) R(22573.) R(24445.) R(28700.) R(30738.) R(34002.)  */
          /*  R(36558.)  */
     2 WEIGHT92    PIC '9999999';  /*  R(36558.)  */
 
 DCL 1 INRECNEW ,
     2 NORCID_CUR PIC '------9',
     2 INTOB_CUR     PIC '9999999',   /*  DUMMY  */
     2 SCHOOL_CUR,
       5 ASLI_CUR    PIC '------9',  /*  R(37070.)  */
       5 CURAT_CUR   PIC '------9',  /*  R(37096.)  */
       5 DIP_CUR     PIC '------9',  /*  R(37107.)  */
       5 DLEMO_CUR   PIC '------9',  /*  R(37098.)  */
       5 DLEYR_CUR   PIC '------9',  /*  R(37099.)  */
       5 GRA_CUR     PIC '------9', /*  COMPUTE GRA_CUR=-3                  */
                                    /*  IF R(37096.)=1                      */
                                    /*  THEN GRA_CUR=R(37096.)              */
                                    /*  ELSE IF R(37096.)=0                 */
                                    /*  THEN GRA_CUR=R(37100.)              */
                                    /*  ELSE IF R(37070.)=0                 */
                                    /*  THEN GRA_CUR=-4                     */
       5 GRADE_CUR   PIC '------9',  /*  R(37097.)  */
       5 HGA_CUR     PIC '------9',  /*  R(37101.)  */
       5 HGCS_CUR    PIC '------9',  /*  R(37102.)  */
       5 INTMO_CUR   PIC '------9',  /*  R(39176.)  */
       5 HAVEDIP_CUR PIC '------9',  /*  R(37106.)  */
       5 ATTCOL_CUR  PIC '------9';  /*  COMPUTE ATTCOL_CUR=0                */
                                    /*  IF R(37102.)>3 THEN ATTCOL_CUR=1     */
 
 /*  CREATE OF HIGHEST GRADE COMPLETED AND ENROLLMENT STATUS
     AS OF 5-1-92 */
 
    HGC_CUR=-4;
    ENROLL_CUR=-4;
    DO I=80 TO LASTYR;
       IF WEIGHT(I)=0 THEN DO;
          HGCS(I)=-5;
          GRADE(I)=-5;
       END;    
    END;
  IF WEIGHT92 > 0 THEN DO;       
    IF ASLI_CUR=0 & (HAVEDIP_CUR=-4 | HAVEDIP_CUR=0) THEN DO;  /* ATT NO */
    DO I = LASTYR TO 79 BY -1 WHILE(HGC_CUR = -4);  /* SEARCH */
       IF WEIGHT(I) > 0 THEN DO;   /* SEARCH INT YES */ 
           IF INTMO(I)>=5 & (CURAT(I)=1 | (DLEMO(I)>=5 & DLEYR(I)=I)) &
              HGCS(I)>HGC(I) THEN HGC_CUR=HGCS(I);
           ELSE HGC_CUR=HGC(I);
        END;    /* SEARCH INT YES */ 
     END;   /* SEARCH */
        IF HGC_CUR>=12 THEN ENROLL_CUR=4;
        ELSE IF HGC_CUR>=0 THEN ENROLL_CUR=1;
   END; /* ATT NO */
     IF ASLI_CUR=1 THEN DO;     /*ASLI = YES */
        IF HGCS_CUR <=0 THEN DO;     /* HGC_CUR STILL -4 */
           IF CURAT_CUR=1 & GRADE_CUR>=1 THEN DO; /* CURAT AND GRADE */
              HGC_CUR=GRADE_CUR-1;
              IF HGC_CUR>=12 THEN ENROLL_CUR=3;
              ELSE ENROLL_CUR=2;
                                             END; /* CURAT AND GRADE */
           ELSE IF CURAT_CUR=0 & HGA_CUR>=1 THEN DO;  /* NOTCURAT BUT  GRADE */
              IF DLEYR_CUR<LASTYR | DLEMO_CUR<5 THEN DO;  /* DATES */
                 HGC_CUR=HGA_CUR;
                 IF HGC_CUR>=12 THEN ENROLL_CUR=4;
                 ELSE ENROLL_CUR=1;
                                                 END;   /* DATES */
              ELSE DO;                    
                 HGC_CUR=HGA_CUR-1;
                 IF HGC_CUR>=12 THEN ENROLL_CUR=4;
                 ELSE ENROLL_CUR=1;
              END;                                    /* DATES OK */
           END;                  /* NOTCURAT BUT  GRADE */   
        END;                         /* HGC_CUR STILL -4 */
        ELSE DO;               /*ENROLL  */
           IF HGCS_CUR=HGA_CUR | HGCS_CUR=GRADE_CUR THEN DO;
              IF (DLEYR_CUR=CURANTYR & DLEMO_CUR>=5) | (INTMO_CUR>=5 &
                 CURAT_CUR=1) THEN DO;
                 HGC_CUR=HGCS_CUR-1;
                 IF HGC_CUR>=12 THEN ENROLL_CUR=3;
                 ELSE ENROLL_CUR=2;
                                 END;
              ELSE HGC_CUR=HGCS_CUR; 
                                                         END;
           IF HGCS_CUR=HGA_CUR-1 | HGCS_CUR=GRADE_CUR-1 THEN 
              HGC_CUR=HGCS_CUR;
           ELSE IF (HGCS_CUR<HGA_CUR & HGA_CUR>0 & HGA_CUR<20) |
              (HGCS_CUR<GRADE_CUR & GRADE_CUR>0 & GRADE_CUR<20) THEN 
              HGC_CUR=HGCS_CUR; 
           IF ENROLL_CUR=-4 & CURAT_CUR=1 & HGC_CUR>=0 THEN DO;
              IF HGC_CUR>=12 THEN ENROLL_CUR=3;
              ELSE ENROLL_CUR=2;
                                                            END;
           IF ENROLL_CUR=-4 & CURAT_CUR=0 & HGC_CUR>=0 THEN DO;
              IF HGC_CUR>=12 THEN ENROLL_CUR=4;
              ELSE ENROLL_CUR=1;
                                                            END;
          END;   
                                                     END; /* ASLI = YES */
     IF ((HGC_CUR=10 | HGC_CUR=11) & (HAVEDIP_CUR=1 | ATTCOL_CUR=1)) |
       (DIP_CUR=2 & HGC_CUR<12) | (HGC_CUR=-4 & (DIP_CUR=1 | DIP_CUR=3))
        THEN DO;
        HGC_CUR=12;
        IF ENROLL_CUR>0 THEN ENROLL_CUR=5-ENROLL_CUR;
        ELSE IF CURAT_CUR=1 | (DLEYR_CUR=LASTYR & DLEMO_CUR>=5)
        THEN ENROLL_CUR=3;
        ELSE ENROLL_CUR=4;
           END;          
     ELSE IF HGC_CUR<0 & DIP_CUR=-3 THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
                                         END;
     IF HGC_CUR>20 THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
                       END;
    IF HGC_CUR>HGC(LASTYR)+3 & HGC(LASTYR)>0 & DIP_CUR^=2 & DIP_CUR^=3 THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
                                                                           END;
     IF HGC_CUR>0 & HGC_CUR<HGC(LASTYR)-1 | (HGC(LASTYR)=12 & HGC_CUR=11)
      THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
          END;   
       END; /*NEW */
        TRU= 0;
     DO I=79 TO LASTYR BY 1;
        IF DIP(I)>1 THEN TRU =1;END;
        IF TRU = 1 & HGC_CUR<12 THEN HGC_CUR=12;
        IF TRU = 1 & (ENROLL_CUR=1 | ENROLL_CUR<0) THEN ENROLL_CUR=4;
        IF HGC_CUR=-3 & ENROLL_CUR=-4 THEN ENROLL_CUR=-3;
     ELSE IF HGC_CUR=-4 & ENROLL_CUR=-4 THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
     END;
 
  /*  EACH INSTANCE OF -3 FOR HIGHEST GRADE COMPLETED AND ENROLLMENT STATUS     */
  /*  IS REVIEWED BY CHECKING SELECTED SCHOOL VARIABLES.  VALUES OF -3          */
  /*  ARE RECODED TO VALID VALUES WHERE AUXILLIARY INFORMATION INDICATES.       */
  /*  HOWEVER, THERE ARE A NUMBER OF -3S COMPUTED FOR HIGHEST GRADE             */
  /*  COMPLETED AND ENROLLMENT STATUS THAT REMAIN.                              */
 
 HGC_92=R(36569.)   
 ENROLL_92=R(36570.) 

HIGHEST GRADE COMPLETED and ENROLLMENT STATUS as of May 1, 1993

 /*  THE FOLLOWING CODE IS APPLIED TO THE DATA BEFORE THE PLI PROGRAM          */
 /*  IS EXECUTED.  THE PURPOSE OF THE CODE IS TO APPROPRIATELY RECODE          */
 /*  SELECTED 1979 AND 1980 VARIABLES.                                         */
 /*                                                                            */
 /* IF (R2283 EQ 0 OR R2282 EQ 0) THEN DO; DLEMO79=R2287; DLEYR79=R2288; END;  */
 /*  ELSE DO; DLEMO79=R169; DLEYR79=R170; END;                                 */
 /* IF (R4052 GT 0 AND R2283 NE 0 AND R2282 NE 0) THEN DO;                     */
 /*  DLEMO80=R2287; DLEYR80=R2288; END;                                        */
 /*  IF (R2275 EQ 0 OR R2276 EQ 0) THEN GRADE79=R2277 ;                        */
 /*  ELSE GRADE79=R2286;                                                       */
 /*  IF (R2280 GE 0) THEN HGCS79=R2280;                                        */
 /*  ELSE                                                                      */
 /*  COMPUTE HGCS79=R173                                                       */
 /*  END IF                                                                    */
 /*  IF (R2276 EQ 0 AND R2286 GT 0) R156=1                                     */
 /******************************************************************************/
 
 DCL 1 INREC79OLD,
     2 NORCID_OLD PIC '------9',
     2 PUBID_OLD PIC '------9',
     2 CURAT(79:LASTYR)  PIC '------9',
          /*  R(  156.) R( 2285.) R( 4168.) R( 6639.) R( 9053.) R(12052.)  */
          /*  R(16045.) R(19050.) R(23059.) R(25084.) R(29075.) R(31096.)  */
          /*  R(35096.) R(37096.) */
     2 DIP(79:LASTYR)    PIC '------9',
          /*  R(  183.) R( 2300.) R( 4182.) R( 6653.) R( 9067.) R(12066.)  */
          /*  R(16059.) R(19061.) R(23070.) R(25095.) R(29086.) R(31107.)  */
          /*  R(35107.) R(37107.) */
     2 DLEMO(79:LASTYR)  PIC '------9',
          /*  DLEMO79   DLEMO80   R( 4170.) R( 6641.) R( 9055.) R(12054.)  */
          /*  R(16047.) R(19052.) R(23061.) R(25086.) R(29077.) R(31098.)  */
          /*  R(35098.) R(37098.) */
     2 DLEYR(79:LASTYR)  PIC '------9',
          /*  DLEYR79   DLEYR80   R( 4171.) R( 6642.) R( 90546) R(12055.)  */
          /*  R(16048.) R(19053.) R(23062.) R(25087.) R(29078.) R(31099.)  */
          /*  R(35099.) R(37099.) */
     2 GRADE(79:LASTYR)  PIC '------9',
          /*  GRADE79   R( 2286.) R( 4169.) R( 6640.) R( 9054.) R(12053.)  */
          /*  R(16046.) R(19051.) R(23060.) R(25085.) R(29076.) R(31097.)  */
          /*  R(35097.) R(37097.) */
     2 HGA(79:LASTYR)    PIC '------9',
          /*  R(  172.) R( 2291.) R( 4173.) R( 6644.) R( 9058.) R(12057.)  */
          /*  R(16050.) R(19055.) R(23064.) R(25089.) R(29080.) R(31101.)  */
          /*  R(35101.) R(37101.) */
     2 HGC(79:LASTYR)    PIC '------9',
          /*  R( 2167.) R( 4064.) R( 6189.) R( 8982.) R(11450.) R(15202.)  */
          /*  R(18909.) R(22580.) R(24454.) R(28711.) R(30748.) R(34015.)  */
          /*  R(36569.) R(40074.)*/
     2 HGCS(79:LASTYR)   PIC '------9',
          /*  HGCS79    R( 2292.) R( 4174.) R( 6645.) R( 9059.) R(12058.)  */
          /*  R(16051.) R(19056.) R(23065.) R(25090.) R(29081.) R(31102.)  */
          /*  R(35102.) R(37102.) */
     2 INTMO(79:LASTYR)  PIC '------9',
          /*  R( 1725.) R( 3292.) R( 5307.) R( 8099.) R(10457.) R(14275.)  */
          /*  R(17946.) R(21562.) R(23657.) R(27425.) R(29861.) R(33025.)  */
          /*  R(35734.) R(39176.) */
     2 WEIGHT(79:LASTYR) PIC '9999999';
          /*  R( 2161.) R( 4052.) R( 6146.) R( 8967.) R(11444.) R(15196.)  */
          /*  R(18902.) R(22573.) R(24445.) R(28700.) R(30738.) R(34002.)  */
          /*  R(36558.) R(40063.) */
 
 DCL 1 INRECNEW,
     2 NORCID_CUR PIC '------9',
     2 INTOB_CUR     PIC '9999999',   /*  DUMMY  */
     2 SCHOOL_CUR,
       5 ASLI_CUR    PIC '------9',  /*  R(41347.)  */
       5 CURAT_CUR   PIC '------9',  /*  R(41374.)  */
       5 DIP_CUR     PIC '------9',  /*  R(41385.)  */
       5 DLEMO_CUR   PIC '------9',  /*  R(41376.)  */
       5 DLEYR_CUR   PIC '------9',  /*  R(41376.01.)  */
       5 GRA_CUR     PIC '------9', /*  COMPUTE GRA_CUR=-3                  */
                                    /*  IF R(41374.)=1                      */
                                    /*  THEN GRA_CUR=R(41374.)              */
                                    /*  ELSE IF R(41374.)=0                 */
                                    /*  THEN GRA_CUR=R(41378.)              */
                                    /*  ELSE IF R(41347.)=0                 */
                                    /*  THEN GRA_CUR=-4                     */
       5 GRADE_CUR   PIC '------9',  /*  R(41375.)  */
       5 HGA_CUR     PIC '------9',  /*  R(41378.)  */
       5 HGCS_CUR    PIC '------9',  /*  R(41379.)  */
       5 INTMO_CUR   PIC '------9',  /*  R(41002.)  */
       5 HAVEDIP_CUR PIC '------9',  /*  R(41384.)  */
       5 ATTCOL_CUR  PIC '------9';  /*  COMPUTE ATTCOL_CUR=0                */
                                    /*  IF R(41379.)>3 THEN ATTCOL_CUR=1     */
 
 /*  CREATE OF HIGHEST GRADE COMPLETED AND ENROLLMENT STATUS
     AS OF 5-1-93 */
 
    HGC_CUR=-4;
    ENROLL_CUR=-4;
    DO I=80 TO LASTYR;
       IF WEIGHT(I)=0 THEN DO;
          HGCS(I)=-5;
          GRADE(I)=-5;
       END;    
    END;
   /*IN 93 OLD AND NEW FILES HAVE ONLY INTERVIEWS */
   /* IF THERE IS A NEED TO UNCOMMENT LOOP BELOW  */
   /* IF RNICUR=-4 THEN DO;        -  LOOP NEW */
    IF ASLI_CUR=0 & (HAVEDIP_CUR=-4 | HAVEDIP_CUR=0) THEN DO;  /* ATT NO */
    DO I = LASTYR TO 79 BY -1 WHILE(HGC_CUR = -4);  /* SEARCH */
       IF WEIGHT(I) > 0 THEN DO;   /* SEA INT YES */ 
           IF INTMO(I)>=5 & (CURAT(I)=1 | (DLEMO(I)>=5 & DLEYR(I)=I)) &
              HGCS(I)>HGC(I) THEN HGC_CUR=HGCS(I);
           ELSE HGC_CUR=HGC(I);
        END;    /* SEA INT YES */ 
     END;   /* SEARCH */
        IF HGC_CUR>=12 THEN ENROLL_CUR=4;
        ELSE IF HGC_CUR>=0 THEN ENROLL_CUR=1;
   END; /* - ATT NO */
     IF ASLI_CUR=1 THEN DO;     /*ASLI = YES */
        IF HGCS_CUR <=0 THEN DO;     /* HGC_CUR STILL -4 */
           IF CURAT_CUR=1 & GRADE_CUR>=1 THEN DO; /* CURAT AND GRADE */
              HGC_CUR=GRADE_CUR-1;
              IF HGC_CUR>=12 THEN ENROLL_CUR=3;
              ELSE ENROLL_CUR=2;
                                             END; /* CURAT AND GRADE */
           ELSE IF CURAT_CUR=0 & HGA_CUR>=1 THEN DO;  /* NOTCURAT BUT  GRADE */
              IF DLEYR_CUR<LASTYR | DLEMO_CUR<5 THEN DO;  /* DATES */
                 HGC_CUR=HGA_CUR;
                 IF HGC_CUR>=12 THEN ENROLL_CUR=4;
                 ELSE ENROLL_CUR=1;
                                                 END;   /* DATES */
              ELSE DO;                    
                 HGC_CUR=HGA_CUR-1;
                 IF HGC_CUR>=12 THEN ENROLL_CUR=4;
                 ELSE ENROLL_CUR=1;
              END;                                    /* DATES OK */
           END;                  /* NOTCURAT BUT  GRADE */   
        END;                         /* HGC_CUR STILL -4 */
        ELSE DO;               /*ENROLL  */
           IF HGCS_CUR=HGA_CUR | HGCS_CUR=GRADE_CUR THEN DO;
              IF (DLEYR_CUR=CURANTYR & DLEMO_CUR>=5) | (INTMO_CUR>=5 &
                 CURAT_CUR=1) THEN DO;
                 HGC_CUR=HGCS_CUR-1;
                 IF HGC_CUR>=12 THEN ENROLL_CUR=3;
                 ELSE ENROLL_CUR=2;
                                 END;
              ELSE HGC_CUR=HGCS_CUR; 
                                                         END;
           IF HGCS_CUR=HGA_CUR-1 | HGCS_CUR=GRADE_CUR-1 THEN 
              HGC_CUR=HGCS_CUR;
           ELSE IF (HGCS_CUR<HGA_CUR & HGA_CUR>0 & HGA_CUR<20) |
              (HGCS_CUR<GRADE_CUR & GRADE_CUR>0 & GRADE_CUR<20) THEN 
              HGC_CUR=HGCS_CUR; 
           IF ENROLL_CUR=-4 & CURAT_CUR=1 & HGC_CUR>=0 THEN DO;
              IF HGC_CUR>=12 THEN ENROLL_CUR=3;
              ELSE ENROLL_CUR=2;
                                                            END;
           IF ENROLL_CUR=-4 & CURAT_CUR=0 & HGC_CUR>=0 THEN DO;
              IF HGC_CUR>=12 THEN ENROLL_CUR=4;
              ELSE ENROLL_CUR=1;
                                                            END;
          END;   
                                                     END; /* ASLI = YES */
     IF ((HGC_CUR=10 | HGC_CUR=11) & (HAVEDIP_CUR=1 | ATTCOL_CUR=1)) |
       (DIP_CUR=2 & HGC_CUR<12) | (HGC_CUR=-4 & (DIP_CUR=1 | DIP_CUR=3))
        THEN DO;
        HGC_CUR=12;
        IF ENROLL_CUR>0 THEN ENROLL_CUR=5-ENROLL_CUR;
        ELSE IF CURAT_CUR=1 | (DLEYR_CUR=LASTYR & DLEMO_CUR>=5)
        THEN ENROLL_CUR=3;
        ELSE ENROLL_CUR=4;
           END;          
     ELSE IF HGC_CUR<0 & DIP_CUR=-3 THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
                                         END;
     IF HGC_CUR>20 THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
                       END;
    IF HGC_CUR>HGC(LASTYR)+3 & HGC(LASTYR)>0 & DIP_CUR^=2 & DIP_CUR^=3 THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
                                                                           END;
     IF HGC_CUR>0 & HGC_CUR<HGC(LASTYR)-1 | (HGC(LASTYR)=12 & HGC_CUR=11)
      THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
          END;   
       /* END; LOOP NEW IN 93 OLD AND NEW FILES HAVE ONLY INTERVIEWS */
                /*      IF THERE IS A NEED TO UNCOMMENT THIS END     */
        TRU= 0;
     DO I=79 TO LASTYR BY 1;
        IF DIP(I)>1 THEN TRU =1;END;
        IF TRU = 1 & HGC_CUR<12 THEN HGC_CUR=12;
        IF TRU = 1 & (ENROLL_CUR=1 | ENROLL_CUR<0) THEN ENROLL_CUR=4;
        IF HGC_CUR=-3 & ENROLL_CUR=-4 THEN ENROLL_CUR=-3;
     ELSE IF HGC_CUR=-4 & ENROLL_CUR=-4 THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
     END;
 
  /*  EACH INSTANCE OF -3 FOR HIGHEST GRADE COMPLETED AND ENROLLMENT STATUS     */
  /*  IS REVIEWED BY CHECKING SELECTED SCHOOL VARIABLES.  VALUES OF -3          */
  /*  ARE RECODED TO VALID VALUES WHERE AUXILLIARY INFORMATION INDICATES.       */
  /*  HOWEVER, THERE ARE A NUMBER OF -3S COMPUTED FOR HIGHEST GRADE             */
  /*  COMPLETED AND ENROLLMENT STATUS THAT REMAIN.                              */
 
  /* HGC_93=R(44185.)    */
  /* ENROLL_93=R(44186.) */

HIGHEST GRADE COMPLETED and ENROLLMENT STATUS as of May 1, 1994

 /*  THE FOLLOWING CODE IS APPLIED TO THE DATA BEFORE THE PLI PROGRAM           */
 /*  IS EXECUTED.  THE PURPOSE OF THE CODE IS TO APPROPRIATELY RECODE           */
 /*  SELECTED 1979 AND 1980 VARIABLES.                                          */
 /*                                                                             */
 /* IF (R2283 EQ 0 OR R2282 EQ 0) THEN DO; DLEMO79=R2287; DLEYR79=R2288;END;    */
 /*  ELSE DO; DLEMO79=R169; DLEYR79=R170; END;                                  */
 /* IF (R4052 GT 0 AND R2283 NE 0 AND R2282 NE 0) THEN DO;                      */
 /*  DLEMO80=R2287; DLEYR80=R2288; END;                                         */
 /*  IF (R2275 EQ 0 OR R2276 EQ 0) THEN GRADE79=R2277 ;                         */
 /*  ELSE GRADE79=R2286;                                                        */
 /*  IF (R2280 GE 0) THEN HGCS79=R2280;                                         */
 /*  ELSE                                                                       */
 /*  COMPUTE HGCS79=R173                                                        */
 /*  END IF                                                                     */
 /*  IF (R2276 EQ 0 AND R2286 GT 0) R156=1                                      */
 /*******************************************************************************/
 
 DCL 1 OUTREC,
     2 PUBID PIC '------9',
     2 NORCID PIC '------9',
     2 HGC_CUR PIC '------9',
     2 ENROLL_CUR PIC '------9';
    /*  2 CASEIDD CHAR(9), */
 DCL 1 INREC79OLD,
     2 NORCID_OLD PIC '------9',
     2 PUBID_OLD PIC '------9',
     2 CURAT(79:LASTYR)  PIC '------9',
          /*  R(  156.) R( 2285.) R( 4168.) R( 6639.) R( 9053.) R(12052.)  */
          /*  R(16045.) R(19050.) R(23059.) R(25084.) R(29075.) R(31096.)  */
          /*  R(35096.) R(37096.) R(41374.) */
     2 DIP(79:LASTYR)    PIC '------9',
          /*  R(  183.) R( 2300.) R( 4182.) R( 6653.) R( 9067.) R(12066.)  */
          /*  R(16059.) R(19061.) R(23070.) R(25095.) R(29086.) R(31107.)  */
          /*  R(35107.) R(37107.) R(41384.)*/
     2 DLEMO(79:LASTYR)  PIC '------9',
          /*  DLEMO79   DLEMO80   R( 4170.) R( 6641.) R( 9055.) R(12054.)  */
          /*  R(16047.) R(19052.) R(23061.) R(25086.) R(29077.) R(31098.)  */
          /*  R(35098.) R(37098.) R(41376.)*/
     2 DLEYR(79:LASTYR)  PIC '------9',
          /*  DLEYR79   DLEYR80   R( 4171.) R( 6642.) R( 90546) R(12055.)  */
          /*  R(16048.) R(19053.) R(23062.) R(25087.) R(29078.) R(31099.)  */
          /*  R(35099.) R(37099.) R(41376.01.)*/
     2 GRADE(79:LASTYR)  PIC '------9',
          /*  GRADE79   R( 2286.) R( 4169.) R( 6640.) R( 9054.) R(12053.)  */
          /*  R(16046.) R(19051.) R(23060.) R(25085.) R(29076.) R(31097.)  */
          /*  R(35097.) R(37097.) R(41375.)*/
     2 HGA(79:LASTYR)    PIC '------9',
          /*  R(  172.) R( 2291.) R( 4173.) R( 6644.) R( 9058.) R(12057.)  */
          /*  R(16050.) R(19055.) R(23064.) R(25089.) R(29080.) R(31101.)  */
          /*  R(35101.) R(37101.) R(41378.)*/
     2 HGC(79:LASTYR)    PIC '------9',
          /*  R( 2167.) R( 4064.) R( 6189.) R( 8982.) R(11450.) R(15202.)  */
          /*  R(18909.) R(22580.) R(24454.) R(28711.) R(30748.) R(34015.)  */
          /*  R(36569.) R(40074.) R(44185.)*/
     2 HGCS(79:LASTYR)   PIC '------9',
          /*  HGCS79    R( 2292.) R( 4174.) R( 6645.) R( 9059.) R(12058.)  */
          /*  R(16051.) R(19056.) R(23065.) R(25090.) R(29081.) R(31102.)  */
          /*  R(35102.) R(37102.) (R41379.)*/
     2 INTMO(79:LASTYR)  PIC '------9',
          /*  R( 1725.) R( 3292.) R( 5307.) R( 8099.) R(10457.) R(14275.)  */
          /*  R(17946.) R(21562.) R(23657.) R(27425.) R(29861.) R(33025.)  */
          /*  R(35734.) R(39176.) R(41002.)*/
     2 WEIGHT(79:LASTYR) PIC '9999999';
          /*  R( 2161.) R( 4052.) R( 6146.) R( 8967.) R(11444.) R(15196.)  */
          /*  R(18902.) R(22573.) R(24445.) R(28700.) R(30738.) R(34002.)  */
          /*  R(36558.) R(40063.) R(44174.)*/
 
   /*   2 CASEID CHAR(9), */
   /*   2 RNICUR    PIC '9999999';  - R(50805.)  */
 
 DCL 1 INRECNEW,
     2 NORCID_CUR PIC '------9',
     2 INTOB_CUR     PIC '9999999',   /*  DUMMY  */
     2 SCHOOL_CUR,
       5 ASLI_CUR    PIC '------9',  /*  R(45233.)  */
       5 CURAT_CUR   PIC '------9',  /*  R(45260.)  */
       5 DIP_CUR     PIC '------9',  /*  R(45271.)  */
       5 DLEMO_CUR   PIC '------9',  /*  R(45262.)  */
       5 DLEYR_CUR   PIC '------9',  /*  R(45262.01)  */
       5 GRA_CUR     PIC '------9', /*  COMPUTE GRA_CUR=-3                  */
                                    /*  IF R(45260.)=1                      */
                                    /*  THEN GRA_CUR=R(45260.)              */
                                    /*  ELSE IF R(45260.)=0                 */
                                    /*  THEN GRA_CUR=R(45264.)              */
                                    /*  ELSE IF R(45265.)=0                 */
                                    /*  THEN GRA_CUR=-4                     */
       5 GRADE_CUR   PIC '------9',  /*  R(45261.)  */
       5 HGA_CUR     PIC '------9',  /*  R(45264.)  */
       5 HGCS_CUR    PIC '------9',  /*  R(45265.)  */
       5 INTMO_CUR   PIC '------9',  /*  R(45002.)  */
       5 HAVEDIP_CUR PIC '------9',  /*  R(45270.)  */
       5 ATTCOL_CUR  PIC '------9';  /*  COMPUTE ATTCOL_CUR=0               */
                                    /*  IF R(45267.)>3 OR R(45268.)>3 OR    */
                                    /*     R(45278.)=1 THEN ATTCOL_CUR=1    */
  READOLD: READ FILE(INTOLD) INTO(INREC79OLD);
   erflg=0;
          KOUNT79OLD = KOUNT79OLD + 1;
  /*   PUBID=SUBSTR(CASEID,5,5); */
  /* CASEIDD=CASEID; */
  PUBID=PUBID_OLD;
  NORCID=NORCID_OLD;
 /*     IF RNICUR ^= -4 THEN DO; */
 /*       ENROLL_CUR=-5; */
 /*       HGC_CUR=-5; */
 /*       GO TO RECWRITE; END; */
 /*      ELSE IF RNICUR = -4 THEN DO;      - INT GET REC */
  READNEW: READ FILE(INNEW) INTO(INRECNEW);
          KOUNTNEW = KOUNTNEW + 1;
     IF NORCID_OLD^=NORCID_CUR THEN DO;   /* NO MATCH */
    PUT SKIP EDIT ('ERROR - NORCIDOLD=',NORCID_OLD,'NORCID_CUR=',NORCID_CUR)
                  (A,F(7),A,F(7));
    GO TO DONE;
                                   END;  /* NO MATCH */
  /*                                  END;  - INT NO MATCH */ 
 
 /*  CREATE OF HIGHEST GRADE COMPLETED AND ENROLLMENT STATUS
     AS OF 5-1-94 */
    HGC_CUR=-4;
    ENROLL_CUR=-4;
    DO I=80 TO LASTYR;
       IF WEIGHT(I)=0 THEN DO;
          HGCS(I)=-5;
          GRADE(I)=-5;
       END;    
    END;
   /*IN 94 OLD AND NEW FILES HAVE ONLY INTERVIEWS */
   /* IF THERE IS A NEED TO UNCOMMENT LOOP BELOW  */
  /* IF RNICUR=-4 THEN DO;        -  LOOP NEW */
    IF ASLI_CUR=0 & (HAVEDIP_CUR=-4 | HAVEDIP_CUR=0) THEN DO;  /* ATT NO */
    DO I = LASTYR TO 79 BY -1 WHILE(HGC_CUR = -4);  /* SEARCH */
       IF WEIGHT(I) > 0 THEN DO;   /* SEA INT YES */ 
           IF INTMO(I)>=5 & (CURAT(I)=1 | (DLEMO(I)>=5 & DLEYR(I)=I)) &
              HGCS(I)>HGC(I) THEN HGC_CUR=HGCS(I);
           ELSE HGC_CUR=HGC(I);
        END;    /* SEA INT YES */ 
     END;   /* SEARCH */
        IF HGC_CUR>=12 THEN ENROLL_CUR=4;
        ELSE IF HGC_CUR>=0 THEN ENROLL_CUR=1;
   END; /* - ATT NO */
     IF ASLI_CUR=1 THEN DO;     /*ASLI = YES */
        IF HGCS_CUR <=0 THEN DO;     /* HGC_CUR STILL -4 */
           IF CURAT_CUR=1 & GRADE_CUR>=1 THEN DO; /* CURAT AND GRADE */
              HGC_CUR=GRADE_CUR-1;
              IF HGC_CUR>=12 THEN ENROLL_CUR=3;
              ELSE ENROLL_CUR=2;
                                             END; /* CURAT AND GRADE */
           ELSE IF CURAT_CUR=0 & HGA_CUR>=1 THEN DO;  /* NOTCURAT BUT GRADE */
              IF DLEYR_CUR<LASTYR | DLEMO_CUR<5 THEN DO;  /* DATES */
                 HGC_CUR=HGA_CUR;
                 IF HGC_CUR>=12 THEN ENROLL_CUR=4;
                 ELSE ENROLL_CUR=1;
                                                 END;   /* DATES */
              ELSE DO;                    
                 HGC_CUR=HGA_CUR-1;
                 IF HGC_CUR>=12 THEN ENROLL_CUR=4;
                 ELSE ENROLL_CUR=1;
              END;                                    /* DATES OK */
           END;                  /* NOTCURAT BUT  GRADE */   
        END;                         /* HGC_CUR STILL -4 */
        ELSE DO;               /*ENROLL  */
           IF HGCS_CUR=HGA_CUR | HGCS_CUR=GRADE_CUR THEN DO;
              IF (DLEYR_CUR=CURANTYR & DLEMO_CUR>=5) | (INTMO_CUR>=5 &
                 CURAT_CUR=1) THEN DO;
                 HGC_CUR=HGCS_CUR-1;
                 IF HGC_CUR>=12 THEN ENROLL_CUR=3;
                 ELSE ENROLL_CUR=2;
                                 END;
              ELSE HGC_CUR=HGCS_CUR; 
                                                         END;
           IF HGCS_CUR=HGA_CUR-1 | HGCS_CUR=GRADE_CUR-1 THEN 
              HGC_CUR=HGCS_CUR;
           ELSE IF (HGCS_CUR<HGA_CUR & HGA_CUR>0 & HGA_CUR<20) |
              (HGCS_CUR<GRADE_CUR & GRADE_CUR>0 & GRADE_CUR<20) THEN 
              HGC_CUR=HGCS_CUR; 
           IF ENROLL_CUR=-4 & CURAT_CUR=1 & HGC_CUR>=0 THEN DO;
              IF HGC_CUR>=12 THEN ENROLL_CUR=3;
              ELSE ENROLL_CUR=2;
                                                            END;
           IF ENROLL_CUR=-4 & CURAT_CUR=0 & HGC_CUR>=0 THEN DO;
              IF HGC_CUR>=12 THEN ENROLL_CUR=4;
              ELSE ENROLL_CUR=1;
                                                            END;
          END;   
                                                     END; /* ASLI = YES */
     IF ((HGC_CUR=10 | HGC_CUR=11) & (HAVEDIP_CUR=1 | ATTCOL_CUR=1)) |
       (DIP_CUR=2 & HGC_CUR<12) | (HGC_CUR=-4 & (DIP_CUR=1 | DIP_CUR=3))
        THEN DO;
        HGC_CUR=12;
        IF ENROLL_CUR>0 THEN ENROLL_CUR=5-ENROLL_CUR;
        ELSE IF CURAT_CUR=1 | (DLEYR_CUR=LASTYR & DLEMO_CUR>=5)
        THEN ENROLL_CUR=3;
        ELSE ENROLL_CUR=4;
           END;          
     ELSE IF HGC_CUR<0 & DIP_CUR=-3 THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
                                         END;
     IF HGC_CUR>20 THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
                       END;
    IF HGC_CUR>HGC(LASTYR)+3 & HGC(LASTYR)>0 & DIP_CUR^=2 & DIP_CUR^=3 THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
                                                                           END;
     IF HGC_CUR>0 & HGC_CUR<HGC(LASTYR)-1 | (HGC(LASTYR)=12 & HGC_CUR=11)
      THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
          END;   
       /* END; LOOP NEW IN 94 OLD AND NEW FILES HAVE ONLY INTERVIEWS */
                /*      IF THERE IS A NEED TO UNCOMMENT THIS END     */
        TRU= 0;
     DO I=79 TO LASTYR BY 1;
        IF DIP(I)>1 THEN TRU =1;END;
        IF TRU = 1 & HGC_CUR<12 THEN HGC_CUR=12;
        IF TRU = 1 & (ENROLL_CUR=1 | ENROLL_CUR<0) THEN ENROLL_CUR=4;
        IF HGC_CUR=-3 & ENROLL_CUR=-4 THEN ENROLL_CUR=-3;
     ELSE IF HGC_CUR=-4 & ENROLL_CUR=-4 THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
     END;
 
  /*  EACH INSTANCE OF -3 FOR HIGHEST GRADE COMPLETED AND ENROLLMENT STATUS     */
  /*  IS REVIEWED BY CHECKING SELECTED SCHOOL VARIABLES.  VALUES OF -3          */
  /*  ARE RECODED TO VALID VALUES WHERE AUXILLIARY INFORMATION INDICATES.       */
  /*  HOWEVER, THERE ARE A NUMBER OF -3S COMPUTED FOR HIGHEST GRADE             */
  /*  COMPLETED AND ENROLLMENT STATUS THAT REMAIN.                              */
 
  /* HGC_94=R(50815.)    */
  /* ENROLL_94=R(50816.) */

HIGHEST GRADE COMPLETED and ENROLLMENT STATUS as of May 1, 1996

/*  CREATE OF HIGHEST GRADE COMPLETED AND ENROLLMENT STATUS
     AS OF 5-1-96 */
 
  HGC_CUR=-4;
   ENROLL_CUR=-4;
   DO I=2 TO LASTRND;
       IF WEIGHT(I)=0 THEN DO;
          HGCS(I)=-5;
          GRADE(I)=-5;
       END;    
    END;
   /*IN 96 OLD AND NEW FILES HAVE ONLY INTERVIEWS */
   /* IF THERE IS A NEED TO UNCOMMENT LOOP BELOW  */
   /* IF RNICUR=-4 THEN DO;        -  LOOP NEW */
    IF ASLI_CUR=0 & (HAVEDIP_CUR=-4 | HAVEDIP_CUR=0) THEN DO;  /* ATT NO */
    DO I = LASTRND TO 1 BY -1 WHILE(HGC_CUR = -4);  /* SEARCH */
       IF WEIGHT(I) > 0 THEN DO;   /* SEA INT YES */ 
           IF INTMO(I)>=5 & (CURAT(I)=1 | (DLEMO(I)>=5 & DLEYR(I)=INTYR(I))) &
              HGCS(I)>HGC(I) THEN HGC_CUR=HGCS(I);
           ELSE HGC_CUR=HGC(I);
        END;    /* SEA INT YES */ 
     END;   /* SEARCH */
        IF HGC_CUR>=12 THEN ENROLL_CUR=4;
        ELSE IF HGC_CUR>=0 THEN ENROLL_CUR=1;
   END; /* - ATT NO */
     IF ASLI_CUR=1 THEN DO;     /*ASLI = YES */
        IF HGCS_CUR <=0 THEN DO;     /* HGC_CUR STILL -4 */
           IF CURAT_CUR=1 & GRADE_CUR>=1 THEN DO; /* CURAT AND GRADE */
              HGC_CUR=GRADE_CUR-1;
              IF HGC_CUR>=12 THEN ENROLL_CUR=3;
              ELSE ENROLL_CUR=2;
 
                                             END; /* CURAT AND GRADE */
           ELSE IF CURAT_CUR=0 & HGA_CUR>=1 THEN DO;  /* NOTCURAT BUT  GRADE */
              IF DLEYR_CUR<LASTYR | DLEMO_CUR<5 THEN DO;  /* DATES */
                 HGC_CUR=HGA_CUR;
                 IF HGC_CUR>=12 THEN ENROLL_CUR=4;
                 ELSE ENROLL_CUR=1;
                                                 END;   /* DATES */
              ELSE DO;                    
                 HGC_CUR=HGA_CUR-1;
                 IF HGC_CUR>=12 THEN ENROLL_CUR=4;
                 ELSE ENROLL_CUR=1;
              END;                                    /* DATES OK */
           END;                  /* NOTCURAT BUT  GRADE */   
        END;                         /* HGC_CUR STILL -4 */
        ELSE DO;               /*ENROLL  */
           IF HGCS_CUR=HGA_CUR | HGCS_CUR=GRADE_CUR THEN DO;
              IF (DLEYR_CUR=CURANTYR & DLEMO_CUR>=5) | (INTMO_CUR>=5 &
                 CURAT_CUR=1) THEN DO;
                 HGC_CUR=HGCS_CUR-1;
                 IF HGC_CUR>=12 THEN ENROLL_CUR=3;
                 ELSE ENROLL_CUR=2;
                                 END;
              ELSE HGC_CUR=HGCS_CUR; 
                                                         END;
           IF HGCS_CUR=HGA_CUR-1 | HGCS_CUR=GRADE_CUR-1 THEN 
              HGC_CUR=HGCS_CUR;
           ELSE IF (HGCS_CUR<HGA_CUR & HGA_CUR>0 & HGA_CUR<20) |
              (HGCS_CUR<GRADE_CUR & GRADE_CUR>0 & GRADE_CUR<20) THEN 
              HGC_CUR=HGCS_CUR; 
           IF ENROLL_CUR=-4 & CURAT_CUR=1 & HGC_CUR>=0 THEN DO;
              IF HGC_CUR>=12 THEN ENROLL_CUR=3;
              ELSE ENROLL_CUR=2;
                                                            END;
           IF ENROLL_CUR=-4 & CURAT_CUR=0 & HGC_CUR>=0 THEN DO;
              IF HGC_CUR>=12 THEN ENROLL_CUR=4;
              ELSE ENROLL_CUR=1;
                                                            END;
          END;   
                                                     END; /* ASLI = YES */
     IF ((HGC_CUR=10 | HGC_CUR=11) & (HAVEDIP_CUR=1 | ATTCOL_CUR=1)) |
       (DIP_CUR=2 & HGC_CUR<12) | (HGC_CUR=-4 & (DIP_CUR=1 | DIP_CUR=3))
        THEN DO;
        HGC_CUR=12;
        IF ENROLL_CUR>0 THEN ENROLL_CUR=5-ENROLL_CUR;
        ELSE IF CURAT_CUR=1 | (DLEYR_CUR=LASTYR & DLEMO_CUR>=5)
        THEN ENROLL_CUR=3;
        ELSE ENROLL_CUR=4;
           END;          
     ELSE IF HGC_CUR<0 & DIP_CUR=-3 THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
         END;
     IF HGC_CUR>20 THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
        END;
    IF HGC_CUR>HGC(LASTRND)+3 & HGC(LASTRND)>0 & DIP_CUR^=2 & DIP_CUR^=3 THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
         END;
     IF HGC_CUR>0 & HGC_CUR<HGC(LASTRND)-1 | (HGC(LASTRND)=12 & HGC_CUR=11)
      THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
          END;   
       /* END; LOOP NEW IN 96 OLD AND NEW FILES HAVE ONLY INTERVIEWS */
                /*      IF THERE IS A NEED TO UNCOMMENT THIS END     */
        TRU= 0;
     DO I=1 TO LASTRND BY 1;
        IF DIP(I)>1 THEN TRU =1;END;
        IF TRU = 1 & HGC_CUR<12 THEN HGC_CUR=12;
        IF TRU = 1 & (ENROLL_CUR=1 | ENROLL_CUR<0) THEN ENROLL_CUR=4;
        IF HGC_CUR=-3 & ENROLL_CUR=-4 THEN ENROLL_CUR=-3;
     ELSE IF HGC_CUR=-4 & ENROLL_CUR=-4 THEN DO;
        HGC_CUR=-3;
        ENROLL_CUR=-3;
     END;
 
  /*  EACH INSTANCE OF -3 FOR HIGHEST GRADE COMPLETED AND ENROLLMENT STATUS     */
  /*  IS REVIEWED BY CHECKING SELECTED SCHOOL VARIABLES.  VALUES OF -3          */
  /*  ARE RECODED TO VALID VALUES WHERE AUXILLIARY INFORMATION INDICATES.       */
  /*  HOWEVER, THERE ARE A NUMBER OF -3S COMPUTED FOR HIGHEST GRADE             */
  /*  COMPLETED AND ENROLLMENT STATUS THAT REMAIN.                              */
 
  /* HGC_96=R(51668.)    */
  /* ENROLL_96=R(51669.) */

HIGHEST GRADE COMPLETED and ENROLLMENT STATUS as of MAY 1, 1998

NOTE: The PL/1 code used to create Highest Grade Completed and Enrollment Status variables through the 1996 release was converted to SPSS code for 1998 and subsequent releases.

 /*  THE FOLLOWING CODE IS APPLIED TO THE DATA BEFORE THE PLI PROGRAM           */
 /*  IS EXECUTED.  THE PURPOSE OF THE CODE IS TO APPROPRIATELY RECODE           */
 /*  SELECTED 1979 AND 1980 VARIABLES.                                          */
 /*                                                                             */
 /* IF (R2283 EQ 0 OR R2282 EQ 0) THEN DO dlemo79=R2287 dleyr79=R2288 END       */
 /*  ELSE DO dlemo79=R169 dleyr79=R170 END                                      */
 /* IF (R4052 GT 0 AND R2283 NE 0 AND R2282 NE 0) THEN DO                       */
 /*  dlemo80=R2287 dleyr80=R2288 END                                            */
 /*  IF (R2275 EQ 0 OR R2276 EQ 0) THEN GRADE79=R2277                           */
 /*  ELSE GRADE79=R2286                                                         */
 /*  IF (R2280 GE 0) THEN hgcs79=R2280                                          */
 /*  ELSE                                                                       */
 /*  COMPUTE hgcs79=R173                                                        */
 /*  ENDIF                                                                      */
 /*  IF (R2276 EQ 0 AND R2286 GT 0) R156=1                                      */
 /*******************************************************************************/
 
 /* CREATE HIGHEST GRADE COMPLETED AND ENROLLMENT STATUS AS OF 5-1-1998 */
 
COMPUTE HGC_CUR=-4
COMPUTE ENR_CUR=-4
 
DO REPEAT HGCS=HGCS2 TO HGCS17 
          /GRADE=GRADE2 TO GRADE17
          /WEIGHT=WEIGHT2 TO WEIGHT17
. DO IF (WEIGHT EQ 0)
. COMPUTE HGCS=-5
. COMPUTE GRADE=-5
END REPEAT PRINT
 
COMPUTE WGT1B=WEIGHT17
COMPUTE WGT2B=WEIGHT16
COMPUTE WGT3B=WEIGHT15
COMPUTE WGT4B=WEIGHT14
COMPUTE WGT5B=WEIGHT13
COMPUTE WGT6B=WEIGHT12
COMPUTE WGT7B=WEIGHT11
COMPUTE WGT8B=WEIGHT10
COMPUTE WGT9B=WEIGHT9
COMPUTE WGT10B=WEIGHT8
COMPUTE WGT11B=WEIGHT7
COMPUTE WGT12B=WEIGHT6
COMPUTE WGT13B=WEIGHT5
COMPUTE WGT14B=WEIGHT4
COMPUTE WGT15B=WEIGHT3
COMPUTE WGT16B=WEIGHT2
COMPUTE WGT17B=WEIGHT1
 
COMPUTE INTMO1B=INTMO17
COMPUTE INTMO2B=INTMO16
COMPUTE INTMO3B=INTMO15
COMPUTE INTMO4B=INTMO14
COMPUTE INTMO5B=INTMO13
COMPUTE INTMO6B=INTMO12
COMPUTE INTMO7B=INTMO11
COMPUTE INTMO8B=INTMO10
COMPUTE INTMO9B=INTMO9
COMPUTE INTMO10B=INTMO8
COMPUTE INTMO11B=INTMO7
COMPUTE INTMO12B=INTMO6
COMPUTE INTMO13B=INTMO5
COMPUTE INTMO14B=INTMO4
COMPUTE INTMO15B=INTMO3
COMPUTE INTMO16B=INTMO2
COMPUTE INTMO17B=INTMO1
 
COMPUTE INTYR1B=INTYR17
COMPUTE INTYR2B=INTYR16
COMPUTE INTYR3B=INTYR15
COMPUTE INTYR4B=INTYR14
COMPUTE INTYR5B=INTYR13
COMPUTE INTYR6B=INTYR12
COMPUTE INTYR7B=INTYR11
COMPUTE INTYR8B=INTYR10
COMPUTE INTYR9B=INTYR9
COMPUTE INTYR10B=INTYR8
COMPUTE INTYR11B=INTYR7
COMPUTE INTYR12B=INTYR6
COMPUTE INTYR13B=INTYR5
COMPUTE INTYR14B=INTYR4
COMPUTE INTYR15B=INTYR3
COMPUTE INTYR16B=INTYR2
COMPUTE INTYR17B=INTYR1
 
COMPUTE CURAT1B=CURAT17
COMPUTE CURAT2B=CURAT16
COMPUTE CURAT3B=CURAT15
COMPUTE CURAT4B=CURAT14
COMPUTE CURAT5B=CURAT13
COMPUTE CURAT6B=CURAT12
COMPUTE CURAT7B=CURAT11
COMPUTE CURAT8B=CURAT10
COMPUTE CURAT9B=CURAT9
COMPUTE CURAT10B=CURAT8
COMPUTE CURAT11B=CURAT7
COMPUTE CURAT12B=CURAT6
COMPUTE CURAT13B=CURAT5
COMPUTE CURAT14B=CURAT4
COMPUTE CURAT15B=CURAT3
COMPUTE CURAT16B=CURAT2
COMPUTE CURAT17B=CURAT1
 
COMPUTE DLEMO1B=DLEMO17
COMPUTE DLEMO2B=DLEMO16
COMPUTE DLEMO3B=DLEMO15
COMPUTE DLEMO4B=DLEMO14
COMPUTE DLEMO5B=DLEMO13
COMPUTE DLEMO6B=DLEMO12
COMPUTE DLEMO7B=DLEMO11
COMPUTE DLEMO8B=DLEMO10
COMPUTE DLEMO9B=DLEMO9
COMPUTE DLEMO10B=DLEMO8
COMPUTE DLEMO11B=DLEMO7
COMPUTE DLEMO12B=DLEMO6
COMPUTE DLEMO13B=DLEMO5
COMPUTE DLEMO14B=DLEMO4
COMPUTE DLEMO15B=DLEMO3
COMPUTE DLEMO16B=DLEMO2
COMPUTE DLEMO17B=DLEMO1
 
COMPUTE DLEYR1B=DLEYR17
COMPUTE DLEYR2B=DLEYR16
COMPUTE DLEYR3B=DLEYR15
COMPUTE DLEYR4B=DLEYR14
COMPUTE DLEYR5B=DLEYR13
COMPUTE DLEYR6B=DLEYR12
COMPUTE DLEYR7B=DLEYR11
COMPUTE DLEYR8B=DLEYR10
COMPUTE DLEYR9B=DLEYR9
COMPUTE DLEYR10B=DLEYR8
COMPUTE DLEYR11B=DLEYR7
COMPUTE DLEYR12B=DLEYR6
COMPUTE DLEYR13B=DLEYR5
COMPUTE DLEYR14B=DLEYR4
COMPUTE DLEYR15B=DLEYR3
COMPUTE DLEYR16B=DLEYR2
COMPUTE DLEYR17B=DLEYR1
 
COMPUTE HGCS1B=HGCS17
COMPUTE HGCS2B=HGCS16
COMPUTE HGCS3B=HGCS15
COMPUTE HGCS4B=HGCS14
COMPUTE HGCS5B=HGCS13
COMPUTE HGCS6B=HGCS12
COMPUTE HGCS7B=HGCS11
COMPUTE HGCS8B=HGCS10
COMPUTE HGCS9B=HGCS9
COMPUTE HGCS10B=HGCS8
COMPUTE HGCS11B=HGCS7
COMPUTE HGCS12B=HGCS6
COMPUTE HGCS13B=HGCS5
COMPUTE HGCS14B=HGCS4
COMPUTE HGCS15B=HGCS3
COMPUTE HGCS16B=HGCS2
COMPUTE HGCS17B=HGCS1
 
COMPUTE HGC1B=HGC17
COMPUTE HGC2B=HGC16
COMPUTE HGC3B=HGC15
COMPUTE HGC4B=HGC14
COMPUTE HGC5B=HGC13
COMPUTE HGC6B=HGC12
COMPUTE HGC7B=HGC11
COMPUTE HGC8B=HGC10
COMPUTE HGC9B=HGC9
COMPUTE HGC10B=HGC8
COMPUTE HGC11B=HGC7
COMPUTE HGC12B=HGC6
COMPUTE HGC13B=HGC5
COMPUTE HGC14B=HGC4
COMPUTE HGC15B=HGC3
COMPUTE HGC16B=HGC2
COMPUTE HGC17B=HGC1
 
DO REPEAT WEIGHT=WGT1B TO WGT17B   /* ASLI EQ NO */
         /INTMO=INTMO1B TO INTMO17B
         /CURAT=CURAT1B TO CURAT17B
         /DLEMO=DLEMO1B TO DLEMO17B
         /DLEYR=DLEYR1B TO DLEYR17B
         /INTYR=INTYR1B TO INTYR17B
         /HGCS=HGCS1B TO HGCS17B
         /HGC=HGC1B TO HGC17B
. LOOP IF (ASLI_CUR EQ 0 AND (HVDIP_C EQ -4 OR HVDIP_C EQ 0) AND FLAG98 EQ 1)
.   DO IF (HGC_CUR EQ -4 AND WEIGHT GT 0 AND INTMO GE 5 AND 
        (CURAT EQ 1 OR (DLEMO GE 5 AND DLEYR EQ INTYR)) AND HGCS GT HGC) 
.   COMPUTE HGC_CUR=HGCS
.   ELSE IF (HGC_CUR EQ -4 AND WEIGHT GT 0)
.   COMPUTE HGC_CUR=HGC
.   END IF
. END LOOP IF (WEIGHT GT 0 AND HGC_CUR NE -4 AND FLAG98 EQ 0)
END REPEAT PRINT
DO IF (HGC_CUR GE 12) 
COMPUTE ENR_CUR=4
ELSE IF (HGC_CUR GE 0)
COMPUTE ENR_CUR=1
END IF
 
DO IF (ASLI_CUR EQ 1 AND FLAG98 EQ 1 AND HGCS_CUR LE 0)  /*ASLI EQ YES */
                                                   /* HGC_CUR STILL -4 */
.   DO IF (CURAT_C EQ 1 AND GRADE_C GE 1) /* CURAT AND GRADE */
.   COMPUTE HGC_CUR=(GRADE_C - 1)
.       DO IF (HGC_CUR GE 12) 
.       COMPUTE ENR_CUR=3
.       ELSE
.       COMPUTE ENR_CUR=2
.       END IF 
.   ELSE IF (CURAT_C EQ 0 AND HGA_CUR GE 1)  /* NOT CURAT BUT GRADE */
.     DO IF (DLEYR_C LT LASTYR OR DLEMO_C LT 5)  /* DATES */
.     COMPUTE HGC_CUR=HGA_CUR
.       DO IF (HGC_CUR GE 12) 
.       COMPUTE ENR_CUR=4
.       ELSE
.       COMPUTE ENR_CUR=1
.       END IF
.     END IF  /* DATES */
.   ELSE
.   COMPUTE HGC_CUR=(HGA_CUR - 1)
.     DO IF (HGC_CUR GE 12)
.     COMPUTE ENR_CUR=4
.     ELSE 
.     COMPUTE ENR_CUR=1
.     END IF    /* DATES OK */
.   END IF      /* NOTCURAT BUT GRADE */ /* HGC_CUR STILL -4 */
ELSE IF (ASLI_CUR EQ 1 AND FLAG98 EQ 1 AND 
     (HGCS_CUR EQ HGA_CUR OR HGCS_CUR EQ GRADE_C)) /* ENROLL */
.   DO IF ((DLEYR_C EQ CURANTYR AND DLEMO_C GE 5) OR (INTMO_C GE 5 AND
                 CURAT_C EQ 1))
.   COMPUTE HGC_CUR=(HGCS_CUR - 1)
.     DO IF (HGC_CUR GE 12)
.     COMPUTE ENR_CUR=3
.     ELSE
.     COMPUTE ENR_CUR=2
.     END IF
.   ELSE
.   COMPUTE HGC_CUR=HGCS_CUR
.       DO IF (HGC_CUR GE 12) 
.       COMPUTE ENR_CUR=4
.       ELSE
.       COMPUTE ENR_CUR=1
.       END IF
.   END IF
ELSE IF (ASLI_CUR EQ 1 AND FLAG98 EQ 1 AND 
         (HGCS_CUR EQ (HGA_CUR-1) OR HGCS_CUR EQ (GRADE_C-1)))
COMPUTE HGC_CUR=HGCS_CUR
. DO IF (ENR_CUR EQ -4 AND CURAT_C EQ 1 AND HGC_CUR GE 0)
.   DO IF (HGC_CUR GE 12)
.   COMPUTE ENR_CUR=3
.   ELSE
.   COMPUTE ENR_CUR=2
.   END IF
. ELSE IF (ENR_CUR EQ -4 AND CURAT_C EQ 0 AND HGC_CUR GE 0)
.   DO IF (HGC_CUR GE 12)
.   COMPUTE ENR_CUR=4
.   ELSE
.   COMPUTE ENR_CUR=1
.   END IF
. END IF
ELSE IF (ASLI_CUR EQ 1 AND FLAG98 EQ 1 AND
           ((HGCS_CUR LT HGA_CUR AND HGA_CUR GT 0 AND HGA_CUR LT 20) OR
             (HGCS_CUR LT GRADE_C AND GRADE_C GT 0 AND GRADE_C LT 20))) 
COMPUTE HGC_CUR=HGCS_CUR 
. DO IF (ENR_CUR EQ -4 AND CURAT_C EQ 1 AND HGC_CUR GE 0)
.   DO IF (HGC_CUR GE 12)
.   COMPUTE ENR_CUR=3
.   ELSE
.   COMPUTE ENR_CUR=2
.   END IF
. ELSE IF (ENR_CUR EQ -4 AND CURAT_C EQ 0 AND HGC_CUR GE 0)
.   DO IF (HGC_CUR GE 12)
.   COMPUTE ENR_CUR=4
.   ELSE
.   COMPUTE ENR_CUR=1
.   END IF
. END IF
END IF /* ASLI EQ YES */
DO IF (((HGC_CUR EQ 10 OR HGC_CUR EQ 11) AND (HVDIP_C EQ 1 OR ATTCOL_C EQ 1)) OR
       (DIP_CUR EQ 2 AND HGC_CUR LT 12) OR 
       (HGC_CUR EQ -4 AND (DIP_CUR EQ 1 OR DIP_CUR EQ 3)))
COMPUTE HGC_CUR=12
.  DO IF (ENR_CUR GT 0)
.  COMPUTE ENR_CUR=(5-ENR_CUR)
.  ELSE IF (CURAT_C EQ 1 OR (DLEYR_C EQ LASTYR AND DLEMO_C GE 5))
.  COMPUTE ENR_CUR=3
.  ELSE
.  COMPUTE ENR_CUR=4
.  END IF
ELSE IF (HGC_CUR LT 0 AND DIP_CUR EQ -3)
COMPUTE HGC_CUR=-3
COMPUTE ENR_CUR=-3
END IF
 
DO IF (HGC_CUR GT 20)
COMPUTE HGC_CUR=-3
COMPUTE ENR_CUR=-3
END IF
 
DO IF (HGC_CUR GT (HGC_DLI + 3) AND HGC_DLI GT 0 AND DIP_CUR NE 2 AND DIP_CUR NE 3)
COMPUTE HGC_CUR=-3
COMPUTE ENR_CUR=-3
END IF
 
DO IF ((HGC_CUR GT 0 AND HGC_CUR LT (HGC_DLI - 1)) OR 
        (HGC_DLI EQ 12 AND HGC_CUR EQ 11))
COMPUTE HGC_CUR=-3
COMPUTE ENR_CUR=-3
END IF
 
 
       /* END LOOP NEW IN 96 OLD AND NEW FILES HAVE ONLY INTERVIEWS */
                /*      IF THERE IS A NEED TO UNCOMMENT THIS END     */
 
COMPUTE TRU=0
 
DO REPEAT DIP=DIP1 TO DIP17
IF (DIP GT 1) TRU=1
IF (TRU EQ 1 AND HGC_CUR LT 12) HGC_CUR=12
IF (TRU EQ 1 AND (ENR_CUR EQ 1 OR ENR_CUR LT 0)) ENR_CUR=4
IF (HGC_CUR EQ -3 AND ENR_CUR EQ -4) ENR_CUR=-3
END REPEAT 
 
DO IF (FLAG98 EQ 0)
COMPUTE HGC_CUR=-5
COMPUTE ENR_CUR=-5
END IF
 
DO IF (HGC_CUR EQ -4 AND FLAG98 EQ 1)
COMPUTE HGC_CUR=-3
END IF
 
DO IF (ENR_CUR EQ -4 AND FLAG98 EQ 1)
COMPUTE ENR_CUR=-3
END IF
 
/*  EACH INSTANCE OF -3 FOR HIGHEST GRADE COMPLETED AND ENROLLMENT           */
/*STATUS IS REVIEWED BY CHECKING SELECTED SCHOOL VARIABLES.  VALUES OF -3    */
/* ARE RECODED TO VALID VALUES WHERE AUXILLIARY INFORMATION INDICATES.       */
/*  HOWEVER, THERE ARE A NUMBER OF -3S COMPUTED FOR HIGHEST GRADE            */
/*  COMPLETED AND ENROLLMENT STATUS THAT REMAIN.                             */

HIGHEST GRADE COMPLETED and ENROLLMENT STATUS as of MAY 1, 2000

NOTE: The PL/1 code used to create Highest Grade Completed and Enrollment Status variables through the 1996 release was converted to SPSS code for the 1998 and 2000 releases.

/* The following code is applied to the data before the pli program is executed. */
/* The purpose of the code is to appropriately recode selected 1979 and 1980     */
/* variables.                                                                    */
/* if (R2283 eq 0 or R2282 eq 0) then do dlemo79=R2287 dleyr79=R2288 end         */
/*      else do dlemo79=R169 dleyr79=R170 end                                    */
/* if (R4052 gt 0 and R2283 ne 0 and R2282 ne 0)                                 */
/*      then do dlemo80=R2287 dleyr80=R2288 end                                  */
/* if (R2275 eq 0 or R2276 eq 0) then GRADE79=R2277 else GRADE79=R2286           */
/* if (R2280 ge 0) then hgcs79=R2280 else compute hgcs79=R173                    */
/* ENDIF                                                                         */
/* if (R2276 eq 0 and R2286 gt 0) R156=1                                         */
/*********************************************************************************/
/* CREATE HIGHEST GRADE COMPLETED AND ENROLLMENT STATUS AS OF 5-1-2000 */
 
compute hgc_cur=-4
compute enr_cur=-4
 
do repeat hgcs=hgcs2 to hgcs18
/grade=grade2 to grade18
/weight=weight2 to weight18
. do if (weight eq 0)
. compute hgcs=-5
. compute grade=-5
. end if
end repeat print
 
compute wgt1b=weight18
compute wgt2b=weight17
compute wgt3b=weight16
compute wgt4b=weight15
compute wgt5b=weight14
compute wgt6b=weight13
compute wgt7b=weight12
compute wgt8b=weight11
compute wgt9b=weight10
compute wgt10b=weight9
compute wgt11b=weight8
compute wgt12b=weight7
compute wgt13b=weight6
compute wgt14b=weight5
compute wgt15b=weight4
compute wgt16b=weight3
compute wgt17b=weight2
compute wgt18b=weight1
 
compute intmo1b=intmo18
compute intmo2b=intmo17
compute intmo3b=intmo16
compute intmo4b=intmo15
compute intmo5b=intmo14
compute intmo6b=intmo13
compute intmo7b=intmo12
compute intmo8b=intmo11
compute intmo9b=intmo10
compute intmo10b=intmo9
compute intmo11b=intmo8
compute intmo12b=intmo7
compute intmo13b=intmo6
compute intmo14b=intmo5
compute intmo15b=intmo4
compute intmo16b=intmo3
compute intmo17b=intmo2
compute intmo18b=intmo1
 
compute intyr1b=intyr18
compute intyr2b=intyr17
compute intyr3b=intyr16
compute intyr4b=intyr15
compute intyr5b=intyr14
compute intyr6b=intyr13
compute intyr7b=intyr12
compute intyr8b=intyr11
compute intyr9b=intyr10
compute intyr10b=intyr9
compute intyr11b=intyr8
compute intyr12b=intyr7
compute intyr13b=intyr6
compute intyr14b=intyr5
compute intyr15b=intyr4
compute intyr16b=intyr3
compute intyr17b=intyr2
compute intyr18b=intyr1
 
compute curat1b=curat18
compute curat2b=curat17
compute curat3b=curat16
compute curat4b=curat15
compute curat5b=curat14
compute curat6b=curat13
compute curat7b=curat12
compute curat8b=curat11
compute curat9b=curat10
compute curat10b=curat9
compute curat11b=curat8
compute curat12b=curat7
compute curat13b=curat6
compute curat14b=curat5
compute curat15b=curat4
compute curat16b=curat3
compute curat17b=curat2
compute curat18b=curat1
 
compute dlemo1b=dlemo18
compute dlemo2b=dlemo17
compute dlemo3b=dlemo16
compute dlemo4b=dlemo15
compute dlemo5b=dlemo14
compute dlemo6b=dlemo13
compute dlemo7b=dlemo12
compute dlemo8b=dlemo11
compute dlemo9b=dlemo10
compute dlemo10b=dlemo9
compute dlemo11b=dlemo8
compute dlemo12b=dlemo7
compute dlemo13b=dlemo6
compute dlemo14b=dlemo5
compute dlemo15b=dlemo4
compute dlemo16b=dlemo3
compute dlemo17b=dlemo2
compute dlemo18b=dlemo1
 
compute dleyr1b=dleyr18
compute dleyr2b=dleyr17
compute dleyr3b=dleyr16
compute dleyr4b=dleyr15
compute dleyr5b=dleyr14
compute dleyr6b=dleyr13
compute dleyr7b=dleyr12
compute dleyr8b=dleyr11
compute dleyr9b=dleyr10
compute dleyr10b=dleyr9
compute dleyr11b=dleyr8
compute dleyr12b=dleyr7
compute dleyr13b=dleyr6
compute dleyr14b=dleyr5
compute dleyr15b=dleyr4
compute dleyr16b=dleyr3
compute dleyr17b=dleyr2
compute dleyr18b=dleyr1
 
compute hgcs1b=hgcs18
compute hgcs2b=hgcs17
compute hgcs3b=hgcs16
compute hgcs4b=hgcs15
compute hgcs5b=hgcs14
compute hgcs6b=hgcs13
compute hgcs7b=hgcs12
compute hgcs8b=hgcs11
compute hgcs9b=hgcs10
compute hgcs10b=hgcs9
compute hgcs11b=hgcs8
compute hgcs12b=hgcs7
compute hgcs13b=hgcs6
compute hgcs14b=hgcs5
compute hgcs15b=hgcs4
compute hgcs16b=hgcs3
compute hgcs17b=hgcs2
compute hgcs18b=hgcs1
 
compute hgc1b=hgc18
compute hgc2b=hgc17
compute hgc3b=hgc16
compute hgc4b=hgc15
compute hgc5b=hgc14
compute hgc6b=hgc13
compute hgc7b=hgc12
compute hgc8b=hgc11
compute hgc9b=hgc10
compute hgc10b=hgc9
compute hgc11b=hgc8
compute hgc12b=hgc7
compute hgc13b=hgc6
compute hgc14b=hgc5
compute hgc15b=hgc4
compute hgc16b=hgc3
compute hgc17b=hgc2
compute hgc18b=hgc1
 
do repeat weight=wgt1b to wgt18b
/* asli eq no */
/intmo=intmo1b to intmo18b
/curat=curat1b to curat18b
/dlemo=dlemo1b to dlemo18b
/dleyr=dleyr1b to dleyr18b
/intyr=intyr1b to intyr18b
/hgcs=hgcs1b to hgcs18b
/hgc=hgc1b to hgc18b
 
. loop if (asli_cur eq 0 and (hvdip_c eq -4
or hvdip_c eq 0) and flag00 eq 1)
. do if (hgc_cur eq -4 and weight gt 0 and intmo ge 5
and (curat eq 1 or (dlemo ge 5 and dleyr eq intyr))
and hgcs gt hgc)
. compute hgc_cur=hgcs
. else if (hgc_cur eq -4 and weight gt 0)
. compute hgc_cur=hgc
. end if
. end loop if (weight gt 0 and hgc_cur ne -4 and flag00 eq 0)
end repeat print
 
do if (hgc_cur ge 12)
compute enr_cur=4
else if (hgc_cur ge 0)
compute enr_cur=1
end if
 
do if (asli_cur eq 1 and flag00 eq 1
and hgcs_cur le 0)
/*asli eq yes */ /* hgc_cur still -4 */
. do if (curat_c eq 1 and grade_c ge 1)
/* curat and grade */
. compute hgc_cur=(grade_c - 1)
. do if (hgc_cur ge 12)
. compute enr_cur=3
. else
. compute enr_cur=2
. end if
 
. else if (curat_c eq 0 and hga_cur ge 1)
/* not curat but grade */
. do if (dleyr_c lt lastyr or dlemo_c lt 5)
. compute hgc_cur=hga_cur
/* dates */
. do if (hgc_cur ge 12)
. compute enr_cur=4
. else
. compute enr_cur=1
. end if
 
. end if
 
/* dates */
. else
. compute hgc_cur=(hga_cur - 1)
. do if (hgc_cur ge 12)
. compute enr_cur=4
. else
. compute enr_cur=1
. end if
 
/* dates ok */
. end if
 
/* notcurat but grade */ /* hgc_cur still -4 */
else if (asli_cur eq 1 and flag00 eq 1
and (hgcs_cur eq hga_cur or hgcs_cur eq grade_c))
/* enroll */
. do if ((dleyr_c eq curantyr
and dlemo_c ge 5) or (intmo_c ge 5
and curat_c eq 1))
. compute hgc_cur=(hgcs_cur - 1)
. do if (hgc_cur ge 12)
. compute enr_cur=3
. else
. compute enr_cur=2
. end if
 
. else
. compute hgc_cur=hgcs_cur
. do if (hgc_cur ge 12)
. compute enr_cur=4
. else
. compute enr_cur=1
. end if
 
. end if
 
else if (asli_cur eq 1 and flag00 eq 1
and (hgcs_cur eq (hga_cur-1)
or hgcs_cur eq (grade_c-1)))
compute hgc_cur=hgcs_cur
. do if (enr_cur eq -4 and curat_c eq 1
and hgc_cur ge 0)
. do if (hgc_cur ge 12)
. compute enr_cur=3
. else
. compute enr_cur=2. end if
. else if (enr_cur eq -4
and curat_c eq 0 and hgc_cur ge 0)
. do if (hgc_cur ge 12)
. compute enr_cur=4
. else
. compute enr_cur=1.
end if
 
. end if
 
else if (asli_cur eq 1 and flag00 eq 1
and ((hgcs_cur lt hga_cur and hga_cur gt 0
and hga_cur lt 20) or (hgcs_cur lt grade_c
and grade_c gt 0 and grade_c lt 20)))
compute hgc_cur=hgcs_cur
. do if (enr_cur eq -4 and curat_c eq 1
and hgc_cur ge 0)
. do if (hgc_cur ge 12)
. compute enr_cur=3
. else
. compute enr_cur=2.
end if
 
. else if (enr_cur eq -4
and curat_c eq 0 and hgc_cur ge 0)
. do if (hgc_cur ge 12)
. compute enr_cur=4
. else
. compute enr_cur=1.
end if
 
. end if
 
end if
/* asli eq yes */
 
do if (((hgc_cur eq 10 or hgc_cur eq 11)
and (hvdip_c eq 1 or attcol_c eq 1))
or (dip_cur eq 2 and hgc_cur lt 12)
or (hgc_cur eq -4 and (dip_cur eq 1
or dip_cur eq 3)))
compute hgc_cur=12
. do if (enr_cur gt 0)
. compute enr_cur=(5-enr_cur)
. else if (curat_c eq 1
or (dleyr_c eq lastyr and dlemo_c ge 5))
. compute enr_cur=3
. else
. compute enr_cur=4
. end if
else if (hgc_cur lt 0 and dip_cur eq -3)
compute hgc_cur=-3
 
compute enr_cur=-3
end if
do if (hgc_cur gt 20)
compute hgc_cur=-3
compute enr_cur=-3
end if
 
do if (hgc_cur gt (hgc_dli + 3)
and hgc_dli gt 0 and dip_cur ne 2
and dip_cur ne 3)
compute hgc_cur=-3
compute enr_cur=-3
end if
do if ((hgc_cur gt 0 and hgc_cur lt (hgc_dli - 1))
or (hgc_dli eq 12 and hgc_cur eq 11))
compute hgc_cur=-3
compute enr_cur=-3
end if
 
compute tru=0
do repeat dip=dip1 to dip18
if (dip gt 1) tru=1
if (tru eq 1 and hgc_cur lt 12) hgc_cur=12
if (tru eq 1 and (enr_cur eq 1 or enr_cur lt 0)) enr_cur=4
if (hgc_cur eq -3 and enr_cur eq -4) enr_cur=-3
end repeat print
do if (flag00 eq 0)
compute hgc_cur=-5
compute enr_cur=-5
end if
 
do if (hgc_cur eq -4 and flag00 eq 1)
compute hgc_cur=-3
end if
 
do if (enr_cur eq -4 and flag00 eq 1)
compute enr_cur=-3
end if
 
/* HGC_00=R(70071.) */
/* ENROLL_00=R(70072.) */
 
/* Each instance of -3 for highest grade completed and enrollment status is 
reviewed by checking selected school variables. Values of -3 are recoded to 
valid values where auxilliary information indicates. However, there are a 
number of -3s computed for highest grade completed and enrollment status 
that remain. */
 

HIGHEST GRADE COMPLETED and ENROLLMENT STATUS as of  May 1, 2002

NOTE: The SPSS code used to create Highest Grade Completed and Enrollment Status variables for the 1998 and 2000 releases was converted to SAS code for 2002 and subsequent releases.

/*
Creates the following variables:
hgc_cur - Highest Grade Completed as of May 1, Survey Year
enr_cur - Enrollment Status as of May 1, Survey Year
hgcRev_cur - Highest Grade Completed as of May 1, Survey Year - revised
enrRev_cur - Enrollment Status as of May 1, Survey Year - revised;
*/
 
flag02=1;
 
* Get the index of the last year+month when enrolled;
maxI = 0;
do i = dim(myIn) to 1 by -1;
if myIn(i) = 1 then do; maxI = i; leave; end;
end;
 
* Transform maximal myIn index into the corresponding year and month;
if (maxI ~= 0) then do;
dleMo_ca = mod(maxI-1,12)+1;
dleYr_ca = 1999 + floor((maxI-1)/12);
else if (curat_c = 1) then do; dleMo_ca=q_1c_ms;
dleYr_ca=2002;
end;
else do;
dleMo_ca = -4;
dleYr_ca = -4;
end;
 
*------------------------------------------------------------------------------;
* Create variables for current year and last survey year;
 
hgc_dli=hgc19; *highest grade completed since the date of the last interview;
curantYr=2002; *current survey year;
lastYr=2000; *last year;
*lastRnd=19; *last round;
 
*------------------------------------------------------------------------------;
* Make dleYr Y2K-compliant (e.g. 74 -> 1974);
 
array dleYr (*) dleyr1 - dleyr15;
array weight (*) weight1 - weight15;
 
do i = 1 to dim(dleYr);
if (weight(i) > 0 and 0 < dleYr(i) < 100)
then dleYr(i) = dleYr(i) + 1900;
end;
 
 
*==============================================================================;
* ;
* Create Highest Grade Completed and Enrollment Status as of 5-1-2002 ;
* ;
*==============================================================================;
 
data main;
set Merged (drop= i);
 
*------------------------------------------------------------------------------;
* Create arrays;
 
array weightA (*) weight1 - weight19;
array intMoA (*) intMo1 - intMo19;
array dleMoA (*) dleMo1 - dleMo19;
array dleYrA (*) dleYr1 - dleYr19;
array curAtA (*) curAt1 - curAt19;
array hgcSA (*) hgcs1 - hgcs19;
array hgcA (*) hgc1 - hgc19;
array dipA (*) dip1 - dip19;
 
array intYrA (19) _TEMPORARY_ (1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 
1989 1990 1991 1992 1993 1994 1996 1998 2000);
 
hgc_cur=-4; *current highest grade completed;
enr_cur=-4; *current enrollment status;
 
*------------------------------------------------------------------------------;
* Set HGC(i) and HGCS(i) to -5 if Weight = 0 ;
 
do i = 2 to dim(hgcA);
if (weightA(i) = 0) then do;
hgcA(i) = -5;
hgcsA(i) = -5;
end;
end;
 
*------------------------------------------------------------------------------;
* Set hgc_cur to hgcs(i) or hgc(i) under certain circumstances;
 
do i = dim(hgcA) to 1 by -1;
if (asli_cur = 0 and /* did not attended school since last interview */
(hvdip_c = -4 or hvdip_c = 0) and /* does not have HS diploma */
flag02 = 1) then do;
if (hgc_cur = -4 and weightA(i) > 0) then do; /* HGC current */
if (IntMoA(i) >= 5 and /* Interviewed in May+ */
(CurAtA(i) = 1 or (DLEMoA(i) >= 5 and DLEYrA(i) = IntYrA(i))) and
/* Currently in school or was in school after May */
HgcSA(i) > HgcA(i) )
then hgc_cur = HgcSA(i);
else hgc_cur = HgcA(i);
end;
end;
end;
 
*------------------------------------------------------------------------------;
* Set enr_cur;
 
if (hgc_cur >= 12)
then enr_cur = 4;
else if (hgc_cur >= 0)
then enr_cur = 1;
 
*------------------------------------------------------------------------------;
* Macros to set hgc_cur & enr_cur based on asli_cur, hgcs_cur, hga_cur, grade_c;
 
%Macro setEnrCur32(aHGC_Cur, aENR_Cur);
do; if (&aHGC_Cur >= 12)
then &aEnr_Cur = 3;
else &aEnr_Cur = 2;
end;
%MEnd;
 
%Macro setEnrCur41(aHGC_Cur, aENR_Cur);
do; if (&aHGC_Cur >= 12)
then &aEnr_Cur = 4;
else &aEnr_Cur = 1;
end;
%MEnd;
 
if (asli_cur = 1 and flag02 = 1) then do;
if (hgcs_cur <= 0) then do;
if (curat_c = 1 and grade_c >= 1) then do;
hgc_cur=(grade_c - 1);
%setEnrCur32(hgc_cur, enr_cur);
end;
else if (curat_c = 0 and hga_cur >= 1) then do;
if (dleyr_ca < lastyr or dlemo_ca < 5) then do;
hgc_cur=hga_cur;
%setEnrCur41(hgc_cur, enr_cur);
end;
end;
else do;
hgc_cur=(hga_cur - 1);
%setEnrCur41(hgc_cur, enr_cur);
end;
end;
else if ((hgcs_cur = hga_cur or hgcs_cur = grade_c)) then do;
if ((dleyr_ca = curantyr and dlemo_ca >= 5)
or (intmo_c >= 5 and curat_c = 1)) then do;
hgc_cur=(hgcs_cur - 1);
%setEnrCur32(hgc_cur, enr_cur);
end;
else do;
hgc_cur=hgcs_cur;
%setEnrCur41(hgc_cur, enr_cur);
end;
end;
else if ((hgcs_cur = (hga_cur-1)) or
(hgcs_cur = (grade_c-1)) or
(hgcs_cur < hga_cur and 0 < hga_cur < 20) or
(hgcs_cur < grade_c and 0 < grade_c < 20)) then do;
hgc_cur=hgcs_cur;
if (enr_cur = -4 and curat_c = 1 and hgc_cur >= 0) then do;
%setEnrCur32(hgc_cur, enr_cur);
end;
else if (enr_cur = -4 and curat_c = 0 and hgc_cur >= 0) then do;
%setEnrCur41(hgc_cur, enr_cur);
end;
end;
end;
 
 
*------------------------------------------------------------------------------;
 
if ( ((hgc_cur = 10 or hgc_cur = 11) and (hvdip_c = 1 or attcol_c = 1)) or
(dip_cur = 2 and hgc_cur < 12) or
(hgc_cur = -4 and (dip_cur = 1 or dip_cur = 3))) then do;
hgc_cur=12;
if (enr_cur > 0) then
enr_cur = 5 - enr_cur;
else if (curat_c = 1 or (dleyr_ca = lastYr and dlemo_ca >= 5))then
enr_cur = 3;
else
enr_cur = 4;
end;
else if (hgc_cur < 0 and dip_cur = -3) then do;
hgc_cur=-3; enr_cur=-3;
end;
 
*------------------------------------------------------------------------------;
 
if ( (hgc_cur > 20) or
(hgc_cur > hgc_dli + 3 & hgc_dli > 0 & dip_cur ~= 2 & dip_cur ~= 3) or
(hgc_cur > 0 & hgc_dli - 1 > hgc_cur) or
(hgc_cur = 11 & hgc_dli = 12 )) then do;
hgc_cur=-3;
enr_cur=-3;
end;
 
*------------------------------------------------------------------------------;
 
tru=0; * true: 0 - does not have HS diploma (ever), 1 does have a HS diploma;
 
if (hgc_cur = -3 and enr_cur = -4) then enr_cur=-3;
 
do i = 1 to dim(dipA);
if (dipA(i) > 1) then do;
tru=1;
if (hgc_cur < 12) then hgc_cur=12; * has HS diploma => has HGC >= 12;
if (enr_cur = 1 or enr_cur < 0) then enr_cur=4;
leave;
end;
end;
 
*------------------------------------------------------------------------------;
 
if (flag02 = 0) then do;
hgc_cur=-5; enr_cur=-5;
hgcRev_cur=-5; enrrev_cur=-5;
end;
 
if (flag02 = 1) then do;
if (hgc_cur = -4) then hgc_cur=-3;
if (enr_cur = -4) then enr_cur=-3;
end;
 
*=============================================================================;
* ;
* Create revised variables ;
* ;
*=============================================================================;
/* The revised variables take into account more accurately past reports of HGC to 
eliminate regressive changes in HGC (for instance, preventing someone who has
previously reported completing 18 years of schooling, and is now working on an
undergraduate level in some area from being coded lower than 18) */
 
/* maxGrd - the highest HGC value ever computed */
maxGrd=hgc_cur;
do i = 1 to dim(hgcA);
if (weightA(i) > 0 & hgcA(i) > maxGrd) then
maxGrd = hgcA(i);
end;
 
if (hgc_cur = -5) then maxGrd = -5;
 
hgcRev_cur = maxGrd;
enrRev_cur = enr_cur;

HIGHEST GRADE COMPLETED and ENROLLMENT STATUS as of May 1, 2004

*------------------------------------------------------------------------------------------;
* Calculate date last enrolled;
array myIn (*)
jan02_in feb02_in mar02_in apr02_in may02_in jun02_in jul02_in aug02_in sep02_in oct02_in nov02_in dec02_in
jan03_in feb03_in mar03_in apr03_in may03_in jun03_in jul03_in aug03_in sep03_in oct03_in nov03_in dec03_in
jan04_in feb04_in mar04_in apr04_in may04_in jun04_in jul04_in aug04_in sep04_in oct04_in nov04_in dec04_in;
* Get the index of the last year+month when enrolled;
maxI = 0;
do i = dim(myIn) to 1 by -1; 
if myIn(i) = 1 then do; maxI = i; leave; end;
end;
* Transform maximal myIn index into the corresponding year and month;
if (maxI ~= 0) then do;
dleMo_ca = mod(maxI-1,12)+1;
dleYr_ca = 2002 + floor((maxI-1)/12); * like div: = 2002 + (maxI-1) div 12 ;
end;
else if (curat_c = 1) then do; 
dleMo_ca=q_1c_ms;
dleYr_ca=2004;
end;
else do;
dleMo_ca = -4;
dleYr_ca = -4;
end;
proc sort; by pubid;
*------------------------------------------------------------------------------------------;
* Create variables about the current year and the last interview;
hgc_dli=hgc20; *highest grade completed since the date of the last interview;
curantYr=2004; *current year;
lastYr=2002; *last year;
*lastRnd=20; *last round - Not used;
*------------------------------------------------------------------------------------------;
* Make dates reported in 1993 and prior years dleYr Y2K-compliant (e.g. 74 -> 1974);
array dleYr (*) dleyr1 - dleyr15;
array weight (*) weight1 - weight15;
do i = 1 to dim(dleYr);
if (weight(i) > 0 and 0 < dleYr(i) < 100)
then dleYr(i) = dleYr(i) + 1900;
end;
proc sort; by pubid;
*===============================================================================;
* ;
* Create Highest Grade Completed and Enrollment Status as of 5-1-2004 ;
* ;
*===============================================================================;
data main;
set Merged (drop= i);
*-------------------------------------------------------------------------------;
* Create all the necessary arrays;
array weightA (*) weight1 - weight20;
array intMoA (*) intMo1 - intMo20;
array dleMoA (*) dleMo1 - dleMo20;
array dleYrA (*) dleYr1 - dleYr20;
array curAtA (*) curAt1 - curAt20;
array hgcSA (*) hgcs1 - hgcs20;
array hgcA (*) hgc1 - hgc20;
array dipA (*) dip1 - dip20;
array intYrA (20) _TEMPORARY_ (1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 /* Interview years */
1990 1991 1992 1993 1994 1996 1998 2000 2002);
hgc_cur=-4; *current highest grade completed;
enr_cur=-4; *current enrollment status;
*-------------------------------------------------------------------------------;
* Set HGC(i) and HGCS(i) to -5 if Weight = 0 ;
/* TODO: Why only from 2? */
do i = 2 to dim(hgcA);
if (weightA(i) = 0) then do;
hgcA(i) = -5;
hgcsA(i) = -5;
end;
end;
*-------------------------------------------------------------------------------;
* Sometimes (?), set hgc_cur to hgcs(i) or hgc(i);
do i = dim(hgcA) to 1 by -1;
if (asli_cur = 0 and /* did not attended school since last interview */
(hvdip_c = -4 or hvdip_c = 0) and /* does not have HS diploma */
flag04 = 1) then do; /* ! Originally was a loop in SPSS */
if (hgc_cur = -4 and weightA(i) > 0) then do; /* Highest Grade completed current */
if ( IntMoA(i) >= 5 and /* Interviewed in May+ */
(CurAtA(i) = 1 or (DLEMoA(i) >= 5 and DLEYrA(i) = IntYrA(i))) and /* Currently in school or was in school after May */
HgcSA(i) > HgcA(i) )
then hgc_cur = HgcSA(i);
else hgc_cur = HgcA(i);
end;
/*if ((flag04 = 0) and (hgc_cur ~= -4) and (Weight(i) > 0)) then leave; - works without it*/
end;
end;
*-------------------------------------------------------------------------------;
if (hgc_cur >= 12)
then enr_cur = 4;
else if (hgc_cur >= 0)
then enr_cur = 1;
*-------------------------------------------------------------------------------;
%Macro setEnrCur32(aHGC_Cur, aENR_Cur);
do; if (&aHGC_Cur >= 12)
then &aEnr_Cur = 3;
else &aEnr_Cur = 2;
end;
%MEnd;
%Macro setEnrCur41(aHGC_Cur, aENR_Cur);
do; if (&aHGC_Cur >= 12)
then &aEnr_Cur = 4;
else &aEnr_Cur = 1;
end;
%MEnd;
if (asli_cur = 1 and flag04 = 1) then do;
if (hgcs_cur <= 0) then do;
if (curat_c = 1 and grade_c >= 1) then do;
hgc_cur=(grade_c - 1);
%setEnrCur32(hgc_cur, enr_cur);
end;
else if (curat_c = 0 and hga_cur >= 1) then do;
if (dleyr_ca < lastyr or dlemo_ca < 5) then do;
hgc_cur=hga_cur;
%setEnrCur41(hgc_cur, enr_cur);
end;
end;
else do;
hgc_cur=(hga_cur - 1);
%setEnrCur41(hgc_cur, enr_cur);
end;
end;
else if ((hgcs_cur = hga_cur or hgcs_cur = grade_c)) then do;
if ((dleyr_ca = curantyr and dlemo_ca >= 5) or (intmo_c >= 5 and curat_c = 1)) then do;
hgc_cur=(hgcs_cur - 1);
%setEnrCur32(hgc_cur, enr_cur);
end;
else do;
hgc_cur=hgcs_cur;
%setEnrCur41(hgc_cur, enr_cur);
end;
end;
else if ((hgcs_cur = (hga_cur-1)) or
(hgcs_cur = (grade_c-1)) or
(hgcs_cur < hga_cur and 0 < hga_cur < 20) or
(hgcs_cur < grade_c and 0 < grade_c < 20)) then do;
hgc_cur=hgcs_cur;
if (enr_cur = -4 and curat_c = 1 and hgc_cur >= 0) then do;
%setEnrCur32(hgc_cur, enr_cur);
end;
else if (enr_cur = -4 and curat_c = 0 and hgc_cur >= 0) then do;
%setEnrCur41(hgc_cur, enr_cur);
end;
end;
end;
*-------------------------------------------------------------------------------;
if ( ((hgc_cur = 10 or hgc_cur = 11) and (hvdip_c = 1 or attcol_c = 1)) or
(dip_cur = 2 and hgc_cur < 12) or
(hgc_cur = -4 and (dip_cur = 1 or dip_cur = 3))) then do;
hgc_cur=12;
if (enr_cur > 0) then
enr_cur = 5 - enr_cur;
else if (curat_c = 1 or (dleyr_ca = lastYr and dlemo_ca >= 5))then
enr_cur = 3;
else
enr_cur = 4;
end;
else if (hgc_cur < 0 and dip_cur = -3) then do;
hgc_cur=-3; enr_cur=-3;
end;
*-------------------------------------------------------------------------------;
if ( (hgc_cur > 20) or
(hgc_cur > hgc_dli + 3 & hgc_dli > 0 & dip_cur ~= 2 & dip_cur ~= 3) or
(hgc_cur > 0 & hgc_dli - 1 > hgc_cur) or
(hgc_cur = 11 & hgc_dli = 12 )) then do;
hgc_cur=-3;
enr_cur=-3;
end;
*-------------------------------------------------------------------------------;
tru=0; * true: 0 - does not have HS diploma (ever), 1 does have a HS diploma 
if (hgc_cur = -3 and enr_cur = -4) then enr_cur=-3;
do i = 1 to dim(dipA);
if (dipA(i) > 1) then do;
tru=1;
if (hgc_cur < 12) then hgc_cur=12; * has HS diploma => has HGC >= 12;
if (enr_cur = 1 or enr_cur < 0) then enr_cur=4; 
leave; 
end;
end;
*-------------------------------------------------------------------------------;
if (flag04 = 0) then do;
hgc_cur=-5; enr_cur=-5;
hgcRev_cur=-5; enrrev_cur=-5;
end;
if (flag04 = 1) then do;
if (hgc_cur = -4) then hgc_cur=-3;
if (enr_cur = -4) then enr_cur=-3;
end;
* ==============================================================================;
* ;
* Create revised variables ;
* ;
* ==============================================================================;
/* 
The revised variables take into account more accurately past reports of HGC to 
eliminate regressive changes in HGC (for instance, preventing someone who has 
previously reported completing 18 years of schooling, and is now working on an 
undergraduate level in some area from being coded lower than 18) */
/* maxGrd - the highest hgc value ever computed */
maxGrd=hgc_cur;
do i = 1 to dim(hgcA);
if (weightA(i) > 0 & hgcA(i) > maxGrd) then
maxGrd = hgcA(i);
end;
if (hgc_cur = -5) then maxGrd = -5;
hgcRev_cur = maxGrd;
enrRev_cur = enr_cur;
run;

HIGHEST GRADE COMPLETED and ENROLLMENT STATUS as of May 1, 2006

* Calculate date last enrolled;

array myIn (*)
jan04_in feb04_in mar04_in apr04_in may04_in jun04_in jul04_in aug04_in sep04_in oct04_in nov04_in dec04_in
jan05_in feb05_in mar05_in apr05_in may05_in jun05_in jul05_in aug05_in sep05_in oct05_in nov05_in dec05_in
jan06_in feb06_in mar06_in apr06_in may06_in jun06_in jul06_in aug06_in sep06_in oct06_in nov06_in dec06_in
jan07_in feb07_in mar07_in apr07_in may07_in jun07_in jul07_in aug07_in sep07_in oct07_in nov07_in dec07_in;

* Get the index of the last year+month when enrolled;
maxI = 0;
do i = dim(myIn) to 1 by -1; 
if myIn(i) = 1 then do; maxI = i; leave; end;
end;

* Transform maximal myIn index into the corresponding year and month;
if (maxI ~= 0) then do;
dleMo_ca = mod(maxI-1,12)+1;
dleYr_ca = 2004 + floor((maxI-1)/12); * like div: = 2002 + (maxI-1) div 12 ;
end;
else if (curat_c = 1) then do; 
dleMo_ca=q_1c_ms;
dleYr_ca=2006;
end;
else do;
dleMo_ca = -4;
dleYr_ca = -4;
end;

proc sort; by norcid;

data oldin;
infile 'hgc/hgc_oldin06_fixed.dat' lrecl=2500 dlm=',' missover;
input
norcid
pubid
curat1-curat21 /* CURRENTLY ATTENDING OR ENROLLED IN SCHOOL*/
dip1-dip21 /* WHICH DOES R HAVE, A HIGH SCHOOL DIPLOMA OR A GED?*/
dlemo1-dlemo21 /* MONTH LAST IN SCHOOL (NOT ENROLLED)*/ /*WHEN R WAS LAST ENROLLED IN REGULAR SCHOOL--WHAT WAS THE MONTH*/
dleyr1-dleyr21 /* YEAR LAST IN SCHOOL (NOT ENROLLED)*/
grade1-grade21 /* GRADE ATTENDING*/
hga1-hga21 /* HIGHEST GRADE ATTENDED*/
hgcs1-hgcs21 /* HIGHEST GRADE COMPLETED*/
hgc1-hgc21 /* CREATED HGC AS OF 05/01/SURVEY YEAR REVISED VERSION*/
hgcu1-hgcu21 /* CREATED HGC AS OF 05/01/SURVEY YEAR UNREVISED VERSION*/
intmo1-intmo21 /* INTERVIEW DATE IN MONTHS*/
weight1-weight21; /* SAMPLING WEIGHT*/

proc sort; by norcid;
proc contents;

*==========================================================================================;
* ;
* Merge IdxWalk & NewIn & OldIn into Merged, and prepare the variables
* ;
*==========================================================================================;

data MERGED;

*------------------------------------------------------------------------------------------;
* Merge: IdxWalk & NewIn & OldIn -> Merged;

merge idxwalk newin2 oldin; by norcid;

*------------------------------------------------------------------------------------------;
* Replace missing values of asli_cur & flag06;

if (asli_cur=.) then asli_cur=-4;
if (flag06=.) then flag06=0;

*------------------------------------------------------------------------------------------;
* Create variables for the current year and the last interview;

hgc_dli=hgc21; *highest grade completed since the date of the last interview;
curantYr=2006; *current year;
lastYr=2004; *last year;

*------------------------------------------------------------------------------------------;
* Make dates reported in 1993 and prior years dleYr Y2K-compliant (e.g. 74 -> 1974);

array dleYr (*) dleyr1 - dleyr15;
array weight (*) weight1 - weight15;

do i = 1 to dim(dleYr);
if (weight(i) > 0 and 0 < dleYr(i) < 100)
then dleYr(i) = dleYr(i) + 1900;
end;

proc sort; by norcid;

/*proc freq; tables dlemo17 dleyr17 dlemo18 dleyr18 dlemo19 dleyr19 dlemo20 dleyr20 dlemo_ca dleyr_ca;*/
/*title 'dle';*/

*===============================================================================;
* ;
* Create Highest Grade Completed and Enrollment Status as of 5-1-2006 ;
* ;
*===============================================================================;

data main;
set Merged (drop= i);

*-------------------------------------------------------------------------------;
* Create all the necessary arrays;

array weightA (*) weight1 - weight21;
array intMoA (*) intMo1 - intMo21;
array dleMoA (*) dleMo1 - dleMo21;
array dleYrA (*) dleYr1 - dleYr21;
array curAtA (*) curAt1 - curAt21;
array hgcSA (*) hgcs1 - hgcs21;
array hgcA (*) hgc1 - hgc21;
array dipA (*) dip1 - dip21;

array intYrA (21) _TEMPORARY_ (1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 /* Interview years */
1990 1991 1992 1993 1994 1996 1998 2000 2002 2004);

hgc_cur=-4; *current highest grade completed;
enr_cur=-4; *current enrollment status;

*-------------------------------------------------------------------------------;
* Set HGC(i) and HGCS(i) to -5 if Weight = 0 ;

do i = 2 to dim(hgcA);
if (weightA(i) = 0) then do;
hgcA(i) = -5;
hgcsA(i) = -5;
end;
end;

*-------------------------------------------------------------------------------;
* Sometimes (?), set hgc_cur to hgcs(i) or hgc(i);

do i = dim(hgcA) to 1 by -1;
if (asli_cur = 0 and /* did not attended school since last interview */
(hvdip_c = -4 or hvdip_c = 0) and /* does not have HS diploma */
flag06 = 1) then do; /* ! Originally was a loop in SPSS */

if (hgc_cur = -4 and weightA(i) > 0) then do; /* Highest Grade completed current */
if ( IntMoA(i) >= 5 and /* Interviewed in May+ */
(CurAtA(i) = 1 or (DLEMoA(i) >= 5 and DLEYrA(i) = IntYrA(i))) and /* Currently in school or was in school after May */
HgcSA(i) > HgcA(i) )
then hgc_cur = HgcSA(i);
else hgc_cur = HgcA(i);
end;
end;
end;

*-------------------------------------------------------------------------------;

if (hgc_cur >= 12)
then enr_cur = 4;
else if (hgc_cur >= 0)
then enr_cur = 1;

*-------------------------------------------------------------------------------;
* Set hgc_cur & enr_cur based on asli_cur, hgcs_cur, hga_cur, grade_c;

%Macro setEnrCur32(aHGC_Cur, aENR_Cur);
do; if (&aHGC_Cur >= 12)
then &aEnr_Cur = 3;
else &aEnr_Cur = 2;
end;
%MEnd;

%Macro setEnrCur41(aHGC_Cur, aENR_Cur);
do; if (&aHGC_Cur >= 12)
then &aEnr_Cur = 4;
else &aEnr_Cur = 1;
end;
%MEnd;

if (asli_cur = 1 and flag06 = 1) then do;
if (hgcs_cur <= 0) then do;
if (curat_c = 1 and grade_c >= 1) then do;
hgc_cur=(grade_c - 1);
%setEnrCur32(hgc_cur, enr_cur);
end;
else if (curat_c = 0 and hga_cur >= 1) then do;
if (dleyr_ca < lastyr or dlemo_ca < 5) then do;
hgc_cur=hga_cur;
%setEnrCur41(hgc_cur, enr_cur);
end;
end;
else do;
hgc_cur=(hga_cur - 1);
%setEnrCur41(hgc_cur, enr_cur);
end;
end;
else if ((hgcs_cur = hga_cur or hgcs_cur = grade_c)) then do;
if ((dleyr_ca = curantyr and dlemo_ca >= 5) or (intmo_c >= 5 and curat_c = 1)) then do;
hgc_cur=(hgcs_cur - 1);
%setEnrCur32(hgc_cur, enr_cur);
end;
else do;
hgc_cur=hgcs_cur;
%setEnrCur41(hgc_cur, enr_cur);
end;
end;
else if ((hgcs_cur = (hga_cur-1)) or
(hgcs_cur = (grade_c-1)) or
(hgcs_cur < hga_cur and 0 < hga_cur < 20) or
(hgcs_cur < grade_c and 0 < grade_c < 20)) then do;
hgc_cur=hgcs_cur;
if (enr_cur = -4 and curat_c = 1 and hgc_cur >= 0) then do;
%setEnrCur32(hgc_cur, enr_cur);
end;
else if (enr_cur = -4 and curat_c = 0 and hgc_cur >= 0) then do;
%setEnrCur41(hgc_cur, enr_cur);
end;
end;
end;

*-------------------------------------------------------------------------------;

if ( ((hgc_cur = 10 or hgc_cur = 11) and (hvdip_c = 1 or attcol_c = 1)) or
(dip_cur = 2 and hgc_cur < 12) or
(hgc_cur = -4 and (dip_cur = 1 or dip_cur = 3))) then do;
hgc_cur=12;
if (enr_cur > 0) then
enr_cur = 5 - enr_cur;
else if (curat_c = 1 or (dleyr_ca = lastYr and dlemo_ca >= 5))then
enr_cur = 3;
else
enr_cur = 4;
end;
else if (hgc_cur < 0 and dip_cur = -3) then do;
hgc_cur=-3; enr_cur=-3;
end;

*-------------------------------------------------------------------------------;

if ( (hgc_cur > 20) or
(hgc_cur > hgc_dli + 3 & hgc_dli > 0 & dip_cur ~= 2 & dip_cur ~= 3) or
(hgc_cur > 0 & hgc_dli - 1 > hgc_cur) or
(hgc_cur = 11 & hgc_dli = 12 )) then do;
hgc_cur=-3;
enr_cur=-3;
end;

*-------------------------------------------------------------------------------;

tru=0; * true: 0 - does not have HS diploma (ever), 1 does have a HS diploma

if (hgc_cur = -3 and enr_cur = -4) then enr_cur=-3;

do i = 1 to dim(dipA);
if (dipA(i) > 1) then do;
tru=1;
if (hgc_cur < 12) then hgc_cur=12; * has HS diploma => has HGC >= 12;
if (enr_cur = 1 or enr_cur < 0) then enr_cur=4; 
leave; 
end;
end;

*-------------------------------------------------------------------------------;

if (flag06 = 0) then do;
hgc_cur=-5; enr_cur=-5;
hgcRev_cur=-5; enrrev_cur=-5;
end;

if (flag06 = 1) then do;
if (hgc_cur = -4) then hgc_cur=-3;
if (enr_cur = -4) then enr_cur=-3;
end;

* ==============================================================================;
* ;
* Create revised variables ;
* ;
* ==============================================================================;
/* 
The revised variables take into account more accurately past reports of HGC to 
eliminate regressive changes in HGC (for instance, preventing someone who has 
previously reported completing 18 years of schooling, and is now working on an 
undergraduate level in some area from being coded lower than 18) */

/* maxGrd - the highest hgc value ever computed */
maxGrd=hgc_cur;
do i = 1 to dim(hgcA);
if (weightA(i) > 0 & hgcA(i) > maxGrd) then
maxGrd = hgcA(i);
end;

if (hgc_cur = -5) then maxGrd = -5;

hgcRev_cur = maxGrd;
enrRev_cur = enr_cur;

 

HIGHEST GRADE COMPLETED AS OF MAY 1, 2008

* Calculate date last enrolled;

 
array myIn (*)
jan06_in feb06_in mar06_in apr06_in may06_in jun06_in jul06_in aug06_in sep06_in oct06_in nov06_in dec06_in
jan07_in feb07_in mar07_in apr07_in may07_in jun07_in jul07_in aug07_in sep07_in oct07_in nov07_in dec07_in
jan08_in feb08_in mar08_in apr08_in may08_in jun08_in jul08_in aug08_in sep08_in oct08_in nov08_in dec08_in;

* Get the index of the last year+month when enrolled;
maxI = 0;
do i = dim(myIn) to 1 by -1;                  
    if myIn(i) = 1 then do; maxI = i; leave; end;
end;

* Transform maximal myIn index into the corresponding year and month;
if (maxI ~= 0) then do;
    dleMo_ca = mod(maxI-1,12)+1;
    dleYr_ca = 2006 + floor((maxI-1)/12);      * like div: = 2002 + (maxI-1) div 12 ;
end;

else if (curat_c = 1) then do;                 
    dleMo_ca=q_1c_ms;
    dleYr_ca=2008;
end;

else do;
    dleMo_ca = -4;
    dleYr_ca = -4;
end;

proc sort; by norcid;
data oldin;
infile  'hgc06_oldin.dat' lrecl=5000 dlm=' ' dsd missover;
input
  norcid
  pubid
  curat1-curat22     /* CURRENTLY ATTENDING OR ENROLLED IN SCHOOL*/
  dip1-dip22         /* WHICH DOES R HAVE, A HIGH SCHOOL DIPLOMA OR A GED?*/
  dlemo1-dlemo22     /* MONTH LAST IN SCHOOL (NOT ENROLLED)*/ /*WHEN R WAS LAST ENROLLED IN REGULAR SCHOOL--WHAT WAS THE MONTH*/
  dleyr1-dleyr22     /* YEAR LAST IN SCHOOL (NOT ENROLLED)*/
  grade1-grade22     /* GRADE ATTENDING*/
  hga1-hga22         /* HIGHEST GRADE ATTENDED*/
  hgcs1-hgcs22       /* HIGHEST GRADE COMPLETED*
  hgc1-hgc22         /* CREATED HGC AS OF 05/01/SURVEY YEAR  REVISED VERSION*/
  hgcu1-hgcu22       /* CREATED HGC AS OF 05/01/SURVEY YEAR  UNREVISED VERSION*/
  intmo1-intmo22     /* INTERVIEW DATE IN MONTHS*/
  weight1-weight22;  /* SAMPLING WEIGHT*/
run;

proc sort;by norcid;

*========================================================================;

*                                                                                          ;

* Merge IdxWalk & NewIn & OldIn into Merged, and prepare the variables
*                                                                                          ;

*========================================================================;
 
data MERGED;

*------------------------------------------------------------------------------------------;

* Merge: IdxWalk & NewIn & OldIn -> Merged;

merge idxwalk newin2 oldin; by norcid;

*------------------------------------------------------------------------------------------;
* Replace missing values of asli_cur & flag08;

if (asli_cur=.) then asli_cur=-4;

if (flag08=.) then flag08=0;

*------------------------------------------------------------------------------------------;

* Create variables for the current year and the last interview;

hgc_dli=hgc22;   *highest grade completed since the date of the last interview;

curantYr=2008;   *current year;

lastYr=2006;     *last year;

*------------------------------------------------------------------------------------------;

* Make dates reported in 1993 and prior years dleYr Y2K-compliant (e.g. 74 -> 1974);

array dleYr (*) dleyr1 - dleyr15;
array weight (*) weight1 - weight15;

do i = 1 to dim(dleYr);
    if (weight(i) > 0 and 0 < dleYr(i) < 100)
        then dleYr(i) = dleYr(i) + 1900;
end;

proc sort; by norcid;
 
*==========================================================================;
*                                                                               ;
* Create Highest Grade Completed and Enrollment Status as of 5-1-2008           ;
*                                                                               ;
*==========================================================================;

data main;
set Merged (drop= i);
 
*-------------------------------------------------------------------------------;
* Create all the necessary arrays;
 
array weightA  (*) weight1 - weight22;
array intMoA   (*) intMo1  - intMo22;
array dleMoA   (*) dleMo1  - dleMo22;
array dleYrA   (*) dleYr1  - dleYr22;

array curAtA   (*) curAt1  - curAt22;

array hgcSA    (*) hgcs1   - hgcs22;

array hgcA     (*) hgc1    - hgc22;

array dipA     (*) dip1    - dip22;

array intYrA (22) _TEMPORARY_ (1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989    

/* Interview years */

                  1990 1991 1992 1993 1994 1996 1998 2000 2002 2004 2006);

hgc_cur=-4;             *current highest grade completed;
enr_cur=-4;             *current enrollment status;

*-------------------------------------------------------------------------------;

* Set HGC(i) and HGCS(i) to -5 if Weight = 0 ;
do i = 2 to dim(hgcA);
    if (weightA(i) = 0) then do;
             hgcA(i) = -5;
             hgcsA(i) = -5;
        end;
end;
 
*-------------------------------------------------------------------------------;

* Set hgc_cur to hgcs(i) or hgc(i);
 
do i = dim(hgcA) to 1 by -1;
    if  (asli_cur = 0 and                    /* did not attend school since last interview */
        (hvdip_c = -4 or hvdip_c = 0) and    /* does not have HS diploma */
        flag08 = 1) then do;                 /* ! Originally was a loop in SPSS */

        if (hgc_cur = -4 and weightA(i) > 0) then do; /* Highest Grade completed current */
            if ( IntMoA(i) >= 5 and                   /* Interviewed in May+ */
                (CurAtA(i) = 1 or (DLEMoA(i) >= 5 and DLEYrA(i) = IntYrA(i))) and /* Currently in school or was in school after May */
                 HgcSA(i) > HgcA(i) )
                then hgc_cur = HgcSA(i);  /*Highest grade completed*/
                else hgc_cur = HgcA(i);                     /* Created HGC as of 05/01 survey year revised version*/
        end;
        /*if ((flag06 = 0) and (hgc_cur ~= -4) and (Weight(i) > 0)) then leave; - works without it*/
    end;
end;


*-------------------------------------------------------------------------------;

* Set enr_cur;
if (hgc_cur >= 12)
    then enr_cur = 4;
else if (hgc_cur >= 0)
    then enr_cur = 1;

*-------------------------------------------------------------------------------;
* Set hgc_cur & enr_cur based on asli_cur, hgcs_cur, hga_cur, grade_c, ...;

%Macro setEnrCur32(aHGC_Cur, aENR_Cur);
    do; if (&aHGC_Cur >= 12)
        then &aEnr_Cur = 3;
        else &aEnr_Cur = 2;
    end;
%MEnd;
%Macro setEnrCur41(aHGC_Cur, aENR_Cur);
    do; if (&aHGC_Cur >= 12)
        then &aEnr_Cur = 4;
        else &aEnr_Cur = 1;
    end;
%MEnd;

if (asli_cur = 1 and flag08 = 1) then do;
    if (hgcs_cur <= 0)  then do;
        if (curat_c = 1 and grade_c >= 1) then do;
            hgc_cur=(grade_c - 1);
            %setEnrCur32(hgc_cur, enr_cur);
        end;
        else if (curat_c = 0 and hga_cur >= 1) then do;
            if (dleyr_ca < lastyr or dlemo_ca < 5) then do;
                hgc_cur=hga_cur;
                %setEnrCur41(hgc_cur, enr_cur);
            end;
        end;
        else do;
            hgc_cur=(hga_cur - 1);
            %setEnrCur41(hgc_cur, enr_cur);
        end;
    end;
    else if ((hgcs_cur = hga_cur or hgcs_cur = grade_c))  then do;
        if ((dleyr_ca = curantyr and dlemo_ca >= 5) or (intmo_c >= 5 and curat_c = 1))  then do;
            hgc_cur=(hgcs_cur - 1);
            %setEnrCur32(hgc_cur, enr_cur);
        end;
        else do;
            hgc_cur=hgcs_cur;
            %setEnrCur41(hgc_cur, enr_cur);
        end;
    end;
    else if ((hgcs_cur = (hga_cur-1)) or
             (hgcs_cur = (grade_c-1)) or
             (hgcs_cur < hga_cur and 0 < hga_cur < 20) or
             (hgcs_cur < grade_c and 0 < grade_c < 20)) then do;
        hgc_cur=hgcs_cur;
        if (enr_cur = -4 and curat_c = 1 and hgc_cur >= 0) then do;
            %setEnrCur32(hgc_cur, enr_cur);
        end;
        else if (enr_cur = -4 and curat_c = 0 and hgc_cur >= 0) then do;
            %setEnrCur41(hgc_cur, enr_cur);
        end;
    end;
end;

*-------------------------------------------------------------------------------;
if ( ((hgc_cur = 10 or hgc_cur = 11) and (hvdip_c = 1 or attcol_c = 1)) or
     (dip_cur = 2 and hgc_cur < 12) or
     (hgc_cur = -4 and (dip_cur = 1 or dip_cur = 3))) then do;
    hgc_cur=12;
    if (enr_cur > 0) then
        enr_cur = 5 - enr_cur;
    else if (curat_c = 1 or (dleyr_ca = lastYr and dlemo_ca >= 5))then
        enr_cur = 3;
    else
        enr_cur = 4;
end;

else if (hgc_cur < 0 and dip_cur = -3) then do;
    hgc_cur=-3; enr_cur=-3;
end;

*-------------------------------------------------------------------------------;

if ( (hgc_cur > 20) or
    (hgc_cur > hgc_dli + 3 & hgc_dli > 0 & dip_cur ~= 2 & dip_cur ~= 3) or
     (hgc_cur > 0  & hgc_dli - 1 > hgc_cur) or
     (hgc_cur = 11 & hgc_dli = 12 )) then do;
    hgc_cur=-3;
    enr_cur=-3;
end;

*-------------------------------------------------------------------------------;

tru=0;          * true: 0 - does not have HS diploma (ever), 1 does have a HS diploma; 
if (hgc_cur = -3 and enr_cur = -4) then enr_cur=-3;
do i = 1 to dim(dipA);
    if (dipA(i) > 1) then do;
        tru=1;
        if (hgc_cur < 12) then hgc_cur=12;               * has HS diploma => has HGC >= 12;
        if (enr_cur = 1 or enr_cur < 0) then enr_cur=4;  
        leave; 
    end;
end;


*-------------------------------------------------------------------------------;

if (flag08 = 0) then do;
    hgc_cur=-5;  enr_cur=-5;
    hgcRev_cur=-5; enrrev_cur=-5;
end;
if (flag08 = 1) then do;
    if (hgc_cur = -4) then hgc_cur=-3;
    if (enr_cur = -4) then enr_cur=-3;
end;

* =========================================================================;
*                                                                               ;
* Create revised variables                                                      ;
*                                                                               ;
* =========================================================================;

/* 

The revised variables take into account more accurately past reports of HGC to 
eliminate regressive changes in HGC (for instance, preventing someone who has 
previously reported completing 18 years of schooling, and is now working on an 
undergraduate level in some area from being coded lower than 18) */ 

/* maxGrd - the highest hgc value ever computed */

maxGrd=hgc_cur;
do i = 1 to dim(hgcA);
    if (weightA(i) > 0 & hgcA(i) > maxGrd) then
        maxGrd = hgcA(i);
end;


if (hgc_cur = -5) then maxGrd = -5;


hgcRev_cur = maxGrd;
enrRev_cur = enr_cur;

 

HIGHEST GRADE COMPLETED AS OF MAY 1, 2010

*------------------------------------------------------------------------------------------;

* Calculate date last enrolled;

array myIn (*)
jan08_in feb08_in mar08_in apr08_in may08_in jun08_in jul08_in aug08_in sep08_in oct08_in nov08_in dec08_in
jan09_in feb09_in mar09_in apr09_in may09_in jun09_in jul09_in aug09_in sep09_in oct09_in nov09_in dec09_in
jan10_in feb10_in mar10_in apr10_in may10_in jun10_in jul10_in aug10_in sep10_in oct10_in nov10_in dec10_in;
 

* Get the index of the last year+month when enrolled;
maxI = 0;
do i = dim(myIn) to 1 by -1;                  
    if myIn(i) = 1 then do; maxI = i; leave; end;
end;

* Transform maximal myIn index into the corresponding year and month;
if (maxI ~= 0) then do;
    dleMo_ca = mod(maxI-1,12)+1;
    dleYr_ca = 2008 + floor((maxI-1)/12);      * like div: = 2002 + (maxI-1) div 12 ;
end;
else if (curat_c = 1) then do;                
    dleMo_ca=q_1c_ms;
    dleYr_ca=2010;
end;
else do;
    dleMo_ca = -4;
    dleYr_ca = -4;
end;

proc sort; by norcid;
run;

*Note: The following data file was created separately by running a program named "hgc_oldin08.sas";

data oldin;
infile  'hgc08_oldin.dat' lrecl=5000 missover dlm=' ' dsd TERMSTR=CRLF;
input
  norcid
  pubid
  curat1-curat23     /* CURRENTLY ATTENDING OR ENROLLED IN SCHOOL*/
  dip1-dip23         /* WHICH DOES R HAVE, A HIGH SCHOOL DIPLOMA OR A GED?*/
  dlemo1-dlemo23     /* MONTH LAST IN SCHOOL (NOT ENROLLED)*/ /*WHEN R WAS LAST ENROLLED IN REGULAR SCHOOL--WHAT WAS THE MONTH*/
  dleyr1-dleyr23     /* YEAR LAST IN SCHOOL (NOT ENROLLED)*/
  grade1-grade23     /* GRADE ATTENDING*/
  hga1-hga23         /* HIGHEST GRADE ATTENDED*/
  hgcs1-hgcs23       /* HIGHEST GRADE COMPLETED*/
  hgc1-hgc23         /* CREATED HGC AS OF 05/01/SURVEY YEAR  REVISED VERSION*/
  hgcu1-hgcu23       /* CREATED HGC AS OF 05/01/SURVEY YEAR  UNREVISED VERSION*/
  intmo1-intmo23     /* INTERVIEW DATE IN MONTHS*/
  weight1-weight23;  /* SAMPLING WEIGHT*/

proc sort; by norcid;
proc contents; 

*==========================================================================================;
*                                                                                          ;
* Merge IdxWalk & NewIn & OldIn into Merged, and prepare the variables
*                                                                                          ;
*==========================================================================================;

data MERGED;

*------------------------------------------------------------------------------------------;
* Merge: IdxWalk & NewIn & OldIn -> Merged;
merge idxwalk newin2 oldin; by norcid;
*------------------------------------------------------------------------------------------;
* Replace missing values of asli_cur & flag10;

if (asli_cur=.) then asli_cur=-4;
if (flag10=.) then flag10=0;

*------------------------------------------------------------------------------------------;

* Create variables for the current year and the last interview;

hgc_dli=hgc23;   *highest grade completed since the date of the last interview;
curantYr=2010;   *current year;
lastYr=2008;     *last year;
 
*------------------------------------------------------------------------------------------;

* Make dates reported in 1993 and prior years dleYr Y2K-compliant (e.g. 74 -> 1974);
array dleYr  (*) dleyr1 - dleyr15;
array weight (*) weight1 - weight15;
do i = 1 to dim(dleYr);
    if (weight(i) > 0 and 0 < dleYr(i) < 100)
        then dleYr(i) = dleYr(i) + 1900;
end;
proc sort; by norcid;
run;

*===============================================================================;
*                                                                               ;
* Create Highest Grade Completed and Enrollment Status as of 5-1-2010           ;
*                                                                               ;
*===============================================================================;

data main;
set Merged (drop= i);
 
*-------------------------------------------------------------------------------;

* Create all the necessary arrays;

array weightA  (*) weight1 - weight23;
array intMoA   (*) intMo1  - intMo23;
array dleMoA   (*) dleMo1  - dleMo23;
array dleYrA   (*) dleYr1  - dleYr23;
array curAtA   (*) curAt1  - curAt23;
array hgcSA    (*) hgcs1   - hgcs23;
array hgcA     (*) hgc1    - hgc23;
array dipA     (*) dip1    - dip23;
array intYrA (23) _TEMPORARY_ (1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989    /* Interview years */
                  1990 1991 1992 1993 1994 1996 1998 2000 2002 2004 2006 2008);
hgc_cur=-4;             *current highest grade completed;
enr_cur=-4;             *current enrollment status;

*-------------------------------------------------------------------------------;
* Set HGC(i) and HGCS(i) to -5 if Weight = 0 ;

do i = 2 to dim(hgcA);
    if (weightA(i) = 0) then do;
             hgcA(i) = -5;
             hgcsA(i) = -5;
        end;
end;

*-------------------------------------------------------------------------------;

* Sometimes (?), set hgc_cur to hgcs(i) or hgc(i);

do i = dim(hgcA) to 1 by -1;
    if  (asli_cur = 0 and                    /* did not attend school since last interview */
        (hvdip_c = -4 or hvdip_c = 0) and    /* does not have HS diploma */
        flag10 = 1) then do;                 /* ! Originally was a loop in SPSS */
        if (hgc_cur = -4 and weightA(i) > 0) then do; /* Highest Grade completed current */
            if ( IntMoA(i) >= 5 and                   /* Interviewed in May+ */
                (CurAtA(i) = 1 or (DLEMoA(i) >= 5 and DLEYrA(i) = IntYrA(i))) and /* Currently in school or was in school after May */
                 HgcSA(i) > HgcA(i) )
                then hgc_cur = HgcSA(i);     /* Highest grade completed*/
                else hgc_cur = HgcA(i);                    /* Created HGC as of 05/01 survey year revised version*/
        end;

        /*if ((flag06 = 0) and (hgc_cur ~= -4) and (Weight(i) > 0)) then leave; - works without it*/

    end;
end;

*-------------------------------------------------------------------------------;


if (hgc_cur >= 12)
    then enr_cur = 4;
else if (hgc_cur >= 0)
    then enr_cur = 1;

*-------------------------------------------------------------------------------;


%Macro setEnrCur32(aHGC_Cur, aENR_Cur);
    do; if (&aHGC_Cur >= 12)
        then &aEnr_Cur = 3;
        else &aEnr_Cur = 2;
    end;
%MEnd;

%Macro setEnrCur41(aHGC_Cur, aENR_Cur);
    do; if (&aHGC_Cur >= 12)
        then &aEnr_Cur = 4;
        else &aEnr_Cur = 1;
    end;
%MEnd;

if (asli_cur = 1 and flag10 = 1) then do;
    if (hgcs_cur <= 0)  then do;
        if (curat_c = 1 and grade_c >= 1) then do;
            hgc_cur=(grade_c - 1);
            %setEnrCur32(hgc_cur, enr_cur);
        end;

        else if (curat_c = 0 and hga_cur >= 1) then do;
            if (dleyr_ca < lastyr or dlemo_ca < 5) then do;
                hgc_cur=hga_cur;
                %setEnrCur41(hgc_cur, enr_cur);
            end;
        end;
        else do;
            hgc_cur=(hga_cur - 1);
            %setEnrCur41(hgc_cur, enr_cur);
        end;
    end;
    else if ((hgcs_cur = hga_cur or hgcs_cur = grade_c))  then do;
        if ((dleyr_ca = curantyr and dlemo_ca >= 5) or (intmo_c >= 5 and curat_c = 1))  then do;
            hgc_cur=(hgcs_cur - 1);
            %setEnrCur32(hgc_cur, enr_cur);
        end;
        else do;
            hgc_cur=hgcs_cur;
            %setEnrCur41(hgc_cur, enr_cur);
        end;
    end;
    else if ((hgcs_cur = (hga_cur-1)) or
             (hgcs_cur = (grade_c-1)) or
             (hgcs_cur < hga_cur and 0 < hga_cur < 20) or
             (hgcs_cur < grade_c and 0 < grade_c < 20)) then do;
        hgc_cur=hgcs_cur;
        if (enr_cur = -4 and curat_c = 1 and hgc_cur >= 0) then do;
            %setEnrCur32(hgc_cur, enr_cur);
        end;
        else if (enr_cur = -4 and curat_c = 0 and hgc_cur >= 0) then do;
            %setEnrCur41(hgc_cur, enr_cur);
        end;
    end;
end;

*-------------------------------------------------------------------------------;

if ( ((hgc_cur = 10 or hgc_cur = 11) and (hvdip_c = 1 or attcol_c = 1)) or
     (dip_cur = 2 and hgc_cur < 12) or
     (hgc_cur = -4 and (dip_cur = 1 or dip_cur = 3))) then do;
    hgc_cur=12;
    if (enr_cur > 0) then
        enr_cur = 5 - enr_cur;
    else if (curat_c = 1 or (dleyr_ca = lastYr and dlemo_ca >= 5))then
        enr_cur = 3;
    else
        enr_cur = 4;
end;

else if (hgc_cur < 0 and dip_cur = -3) then do;
    hgc_cur=-3; enr_cur=-3;
end;

*-------------------------------------------------------------------------------;

if ( (hgc_cur > 20) or
     (hgc_cur > hgc_dli + 3 & hgc_dli > 0 & dip_cur ~= 2 & dip_cur ~= 3) or
     (hgc_cur > 0  & hgc_dli - 1 > hgc_cur) or
     (hgc_cur = 11 & hgc_dli = 12 )) then do;
    hgc_cur=-3;
    enr_cur=-3;
end;

*-------------------------------------------------------------------------------;

tru=0;          * true: 0 - does not have HS diploma (ever), 1 does have a HS diploma 
 
if (hgc_cur = -3 and enr_cur = -4) then enr_cur=-3;
 
do i = 1 to dim(dipA);
    if (dipA(i) > 1) then do;
        tru=1;
        if (hgc_cur < 12) then hgc_cur=12;               * has HS diploma => has HGC >= 12;
        if (enr_cur = 1 or enr_cur < 0) then enr_cur=4;  
        leave; 
    end;
end;

*-------------------------------------------------------------------------------;

if (flag10 = 0) then do;
    hgc_cur=-5;  enr_cur=-5;
    hgcRev_cur=-5; enrrev_cur=-5;
end;

if (flag10 = 1) then do;
    if (hgc_cur = -4) then hgc_cur=-3;
    if (enr_cur = -4) then enr_cur=-3;
end;

* ==============================================================================;
*                                                                               ;
* Create revised variables                                                      ;
*                                                                               ;
* ==============================================================================;

/* 

The revised variables take into account more accurately past reports of HGC to 
eliminate regressive changes in HGC (for instance, preventing someone who has 
previously reported completing 18 years of schooling, and is now working on an 
undergraduate level in some area from being coded lower than 18) */

/* maxGrd - the highest hgc value ever computed */


maxGrd=hgc_cur;
do i = 1 to dim(hgcA);
    if (weightA(i) > 0 & hgcA(i) > maxGrd) then
        maxGrd = hgcA(i);
end;

if (hgc_cur = -5) then maxGrd = -5;

hgcRev_cur = maxGrd;
enrRev_cur = enr_cur;

 

HIGHEST GRADE COMPLETED AS OF MAY 1, 2012

HIGHEST GRADE COMPLETED AS OF MAY 1, 2012

* Calculate date last enrolled;

array myIn (*)
jan10_in feb10_in mar10_in apr10_in may10_in jun10_in jul10_in aug10_in sep10_in oct10_in nov10_in dec10_in
jan11_in feb11_in mar11_in apr11_in may11_in jun11_in jul11_in aug11_in sep11_in oct11_in nov11_in dec11_in
jan12_in feb12_in mar12_in apr12_in may12_in jun12_in jul12_in aug12_in sep12_in oct12_in nov12_in dec12_in
jan13_in feb13_in mar13_in apr13_in may13_in jun13_in;

* Get the index of the last year+month when enrolled;
maxI = 0;
do i = dim(myIn) to 1 by -1; 
if myIn(i) = 1 then do; maxI = i; leave; end;
end;

* Transform maximal myIn index into the corresponding year and month;
if (maxI ~= 0) then do;
dleMo_ca = mod(maxI-1,12)+1;
dleYr_ca = 2010 + floor((maxI-1)/12); * like div: = 2002 + (maxI-1) div 12 ;
end;
else if (curat_c = 1) then do;
dleMo_ca=q_1c_ms;
dleYr_ca=q_1c_yr;
end;
else do;
dleMo_ca = -4;
dleYr_ca = -4;
end;

proc sort; by norcid;
run;

The following data file was created separately by running a program named "hgc_oldin10.sas";

data oldin;
set schR25.hgc_oldin10;

* curat1-curat24 /* CURRENTLY ATTENDING OR ENROLLED IN SCHOOL*/
dip1-dip24 /* WHICH DOES R HAVE, A HIGH SCHOOL DIPLOMA OR A GED?*/
dlemo1-dlemo24 /* MONTH LAST IN SCHOOL (NOT ENROLLED)*/ /*WHEN R WAS LAST ENROLLED IN REGULAR SCHOOL--WHAT WAS THE MONTH*/
dleyr1-dleyr24 /* YEAR LAST IN SCHOOL (NOT ENROLLED)*/
grade1-grade24 /* GRADE ATTENDING*/
hga1-hga24 /* HIGHEST GRADE ATTENDED*/
hgcs1-hgcs24 /* HIGHEST GRADE COMPLETED*/
hgc1-hgc24 /* CREATED HGC AS OF 05/01/SURVEY YEAR REVISED VERSION*/
hgcu1-hgcu24 /* CREATED HGC AS OF 05/01/SURVEY YEAR UNREVISED VERSION*/
intmo1-intmo24 /* INTERVIEW DATE IN MONTHS*/
weight1-weight24; /* SAMPLING WEIGHT*/

proc sort; by norcid;
proc contents;


*==========================================================================================;
* ;
* Merge NewIn & OldIn into Merged, and prepare the variables ;
* ;
*==========================================================================================;

data MERGED;
merge newin oldin; by norcid;

*------------------------------------------------------------------------------------------;
* Replace missing values of asli_cur & flag12;

if (asli_cur=.) then asli_cur=-4;
if (flag12=.) then flag12=0;

*------------------------------------------------------------------------------------------;
* Create variables for the current year and the last interview;

hgc_dli=hgc10; *highest grade completed last round; 
curantYr=2012; *current year;
lastYr=2010; *last year;

*------------------------------------------------------------------------------------------;
* Make dates reported in 1993 and prior years dleYr Y2K-compliant (e.g. 74 -> 1974);

array dleYr (*) dleyr79 - dleyr93;
array weight (*) weight79 - weight93;

do i = 1 to dim(dleYr);
if (weight(i) > 0 and 0 < dleYr(i) < 100)
then dleYr(i) = dleYr(i) + 1900;
end;

*===============================================================================;
* ;
* Create Highest Grade Completed as of 5-1-2012 ;
* ;
*===============================================================================;

*-------------------------------------------------------------------------------;
* Create all the necessary arrays;

array weightA (*) weight79 - weight94 weight96 weight98 weight00 weight02 weight04 weight06 weight08 weight10;
array intMoA (*) intMo79 - intMo94 intMo96 intMo98 intMo00 intMo02 intMo04 intMo06 intMo08 intMo10;
array dleMoA (*) dleMo79 - dleMo94 dleMo96 dleMo98 dleMo00 dleMo02 dleMo04 dleMo06 dleMo08 dleMo10;
array dleYrA (*) dleYr79 - dleYr94 dleYr96 dleYr98 dleYr00 dleYr02 dleYr04 dleYr06 dleYr08 dleYr10;
array curAtA (*) curAt79 - curAt94 curAt96 curAt98 curAt00 curAt02 curAt04 curAt06 curAt08 curAt10;
array hgcSA (*) hgcS79 - hgcS94 hgcS96 hgcS98 hgcS00 hgcS02 hgcS04 hgcS06 hgcS08 hgcS10;
array hgcA (*) hgc79 - hgc94 hgc96 hgc98 hgc00 hgc02 hgc04 hgc06 hgc08 hgc10;
array dipA (*) dip79 - dip94 dip96 dip98 dip00 dip02 dip04 dip06 dip08 dip10;
array intYrA (*) intYr79 - intYr94 intYr96 intYr98 intYr00 intYr02 intYr04 intYr06 intYr08 intYr10;

do i=1 to 15;
intYrA(i) = 1978+i;
end;
    
array mayA (24) _TEMPORARY_ (5 17 29 41 53 65 77 89 101 113 125 137 149 161 173 185 209 233 257 281 305 329 353 377);
array intA (*) int79 - int94 int96 int98 int00 int02 int04 int06 int08 int10;
array dleA (*) dle79 - dle94 dle96 dle98 dle00 dle02 dle04 dle06 dle08 dle10;

hgc_cur=-4; *current highest grade completed;

do i=1 to dim (mayA);
if intMoA(i)>0 & intYrA(i)>0 then intA(i)=12*(intYrA(i)-1979)+intMoA(i);
else if weightA(i)=0 then intA(i)=-5;
if dleMoA(i)>0 & dleYrA(i)>0 then dleA(i)=12*(dleYrA(i)-1979)+dleMoA(i);
else if weightA(i)=0 then dleA(i)=-5;
else if -4<dleMoA(i)<0 or -4<dleYrA(i)<0 then dleA(i)=-3;
else dleA(i)=-4; 
end;
*-------------------------------------------------------------------------------;
* Set HGC(i) and HGCS(i) to -5 if Weight = 0 ;

do i = 2 to dim(hgcA);
if (weightA(i) = 0) then do;
hgcA(i) = -5;
hgcsA(i) = -5;
end;
end;

*-------------------------------------------------------------------------------;
* Sometimes, set hgc_cur to hgcs(i) or hgc(i);

*do i = dim(hgcA) to 1 by -1;
if (asli_cur = 0 and /* did not attend school since last interview */
flag12 = 1) then do i = dim(hgcA) to 1 by -1;

if (hgc_cur = -4 and weightA(i) > 0) then do; /* Highest Grade completed current */
*if ( IntMoA(i) >= 5 and /* Interviewed in May+ */
(CurAtA(i) = 1 or (DLEMoA(i) >= 5 and DLEYrA(i) = IntYrA(i))) and /* Currently in school or was in school after May */
HgcSA(i) > HgcA(i) )
then hgc_cur = HgcSA(i);    /* Highest grade completed*/
            if ( IntA(i) >= mayA(i) and /* Interviewed in May+ */
(CurAtA(i) = 1 or DLEA(i) >= mayA(i)) and /* Currently in school or was in school after May */
HgcSA(i) > HgcA(i) )
then hgc_cur = HgcSA(i);    /* Highest grade completed*/
else hgc_cur = HgcA(i);        /* Created HGC as of 05/01 survey year revised version*/
end;
end;

*-------------------------------------------------------------------------------;

if (asli_cur = 1 and flag12 = 1) then do;
if (hgcs_cur <= 0) then do;
if (curat_c = 1 and grade_c >= 1) then
hgc_cur=(grade_c - 1);
else if (curat_c = 0 and hga_cur >= 1) then do;
*if (dleyr_ca < lastyr or dlemo_ca < 5) then do;
            if (dleyr_ca < curantYr) or (dleyr_ca=curantYr and dlemo_ca < 5) then 
hgc_cur=hga_cur;
end;
*else hgc_cur=(hga_cur - 1);
        else if hga_cur>0 then hgc_cur=(hga_cur - 1); 
end;
else if ((hgcs_cur = hga_cur or hgcs_cur = grade_c)) then do;
*if ((dleyr_ca = curantyr and dlemo_ca >= 5) or (intmo_c >= 5 and curat_c = 1)) then do;
if ((dleyr_ca>curantyr) or (dleyr_ca = curantyr and dlemo_ca >= 5) or (curat_c = 1)) then 
hgc_cur=(hgcs_cur - 1); 
else hgc_cur=hgcs_cur;
end;
else if ((hgcs_cur = (hga_cur-1)) or
(hgcs_cur = (grade_c-1)) or
/*(hgcs_cur < hga_cur and 0 < hga_cur < 20) or
(hgcs_cur < grade_c and 0 < grade_c < 20)) then*/
             (hgcs_cur < hga_cur and 0 < hga_cur <= 20) or
(hgcs_cur < grade_c and 0 < grade_c <= 20)) then 
hgc_cur=hgcs_cur;
end;


*-------------------------------------------------------------------------------;

if ( ((hgc_cur = 10 or hgc_cur = 11) and (hvdip_c = 1 or attcol_c = 1)) or
     (dip_cur>=1 and hgc_cur < 12) or 
(hgc_cur = -4 and (dip_cur = 1 or dip_cur = 3))) then
hgc_cur=12;
else if (hgc_cur < 0 and dip_cur = -3) then
hgc_cur=-3;
*-------------------------------------------------------------------------------;

if ( (hgc_cur > 20) or
(hgc_cur > hgc_dli + 3 & hgc_dli > 0 & dip_cur ~= 2 & dip_cur ~= 3) or
(hgc_cur = 11 & hgc_dli = 12 )) then 
     hgc_cur=-3; 

*-------------------------------------------------------------------------------;

tru=0; * true: 0 - does not have HS diploma (ever), 1 does have a HS diploma; 

do i = 1 to dim(dipA);
*if (dipA(i) > 1) then do;
    if (dipA(i) > =1) then do; /* XA changed for R25 */
tru=1;
if (hgc_cur < 12) then hgc_cur=12; * has HS diploma => has HGC >= 12;
leave; 
end;
end;

*-------------------------------------------------------------------------------;

if (flag12 = 0) then do;
hgc_cur=-5; 
hgcRev_cur=-5;
end;

if (flag12 = 1) then do;
if (hgc_cur = -4) then hgc_cur=-3;
end;


* ==============================================================================;
* ;
* Create revised variables ;
* ;
* ==============================================================================;
/* 
The revised variables take into account more accurately past reports of HGC to 
eliminate regressive changes in HGC (for instance, preventing someone who has 
previously reported completing 18 years of schooling, and is now working on an 
undergraduate level in some area from being coded lower than 18) */

/* maxGrd - the highest hgc value ever computed */

maxGrd=hgc_cur;
do i = 1 to dim(hgcA);
if (weightA(i) > 0 & hgcA(i) > maxGrd) then
maxGrd = hgcA(i);
end;

if (hgc_cur = -5) then maxGrd = -5;

hgcRev_cur = maxGrd;

HIGHEST GRADE COMPLETED AS OF MAY 1, 2014

* Calculate date last enrolled;

array myIn (*)

            jan12_in feb12_in mar12_in apr12_in may12_in jun12_in jul12_in aug12_in sep12_in oct12_in nov12_in dec12_in

            jan13_in feb13_in mar13_in apr13_in may13_in jun13_in jul13_in aug13_in sep13_in oct13_in nov13_in dec13_in

      jan14_in feb14_in mar14_in apr14_in may14_in jun14_in jul14_in aug14_in sep14_in oct14_in nov14_in dec14_in

            jan15_in feb15_in mar15_in apr15_in may15_in jun15_in jul15_in aug15_in sep15_in oct15_in nov15_in dec15_in;

* Get the index of the last year+month when enrolled;

maxI = 0;

do i = dim(myIn) to 1 by -1;                  

    if myIn(i) = 1 then do; maxI = i;

            leave;

            end;

end;

* Transform maximal myIn index into the corresponding year and month;

if (maxI ~= 0) then do;

    dleMo_ca = mod(maxI-1,12)+1;

    dleYr_ca = 2012 + floor((maxI-1)/12);      * like div: = 2002 + (maxI-1) div 12 ;

end;

else if (curat_c = 1) then do;

    dleMo_ca=q_1c_ms;

    dleYr_ca=q_1c_yr;

end;

else do;

    dleMo_ca = -4;

    dleYr_ca = -4;

end;

proc sort; by norcid;

run;

* The following data file was created separately by running a program named "hgc_oldin14.sas";

data oldin;set schR26.hgc_oldin12;

 

* curat1-curat24     /* CURRENTLY ATTENDING OR ENROLLED IN SCHOOL*/

  dip1-dip24         /* WHICH DOES R HAVE, A HIGH SCHOOL DIPLOMA OR A GED?*/

  dlemo1-dlemo24     /* MONTH LAST IN SCHOOL (NOT ENROLLED)*/ /*WHEN R WAS LAST ENROLLED IN REGULAR SCHOOL--WHAT WAS THE MONTH*/

  dleyr1-dleyr24     /* YEAR LAST IN SCHOOL (NOT ENROLLED)*/

  grade1-grade24     /* GRADE ATTENDING*/

  hga1-hga24         /* HIGHEST GRADE ATTENDED*/

  hgcs1-hgcs24       /* HIGHEST GRADE COMPLETED*/

  hgc1-hgc24         /* CREATED HGC AS OF 05/01/SURVEY YEAR  REVISED VERSION*/

  hgcu1-hgcu24       /* CREATED HGC AS OF 05/01/SURVEY YEAR  UNREVISED VERSION*/

  intmo1-intmo24     /* INTERVIEW DATE IN MONTHS*/

  weight1-weight24;  /* SAMPLING WEIGHT*/

* XA R25: actually the variables are labelled by survey year;

proc sort; by norcid;

proc contents;

*==========================================================================================;

*                                                                                          ;

* Merge NewIn & OldIn into Merged, and prepare the variables                               ;

*                                                                                          ;

*==========================================================================================;

data MERGED; merge newin oldin; by norcid;

*------------------------------------------------------------------------------------------;

* Replace missing values of asli_cur & flag14;

if (asli_cur=.) then asli_cur=-4;

if (flag14=.) then flag14=0;

*------------------------------------------------------------------------------------------;

* Create variables for the current year and the last interview;

hgc_dli=hgc12;   *highest grade completed last round;

curantYr=2014;   *current year;

lastYr=2012;     *last year;

*------------------------------------------------------------------------------------------;

* Make dates reported in 1993 and prior years dleYr Y2K-compliant (e.g. 74 -> 1974);

array dleYr  (*) dleyr79 - dleyr93;

array weight (*) weight79 - weight93;

do i = 1 to dim(dleYr);

    if (weight(i) > 0 and 0 < dleYr(i) < 100) then dleYr(i) = dleYr(i) + 1900;

end;

*===============================================================================;

*                                                                               ;

* Create Highest Grade Completed as of 5-1-2014                                 ;

*                                                                               ;

*===============================================================================;

*-------------------------------------------------------------------------------;

* Create all the necessary arrays;

array weightA  (*) weight79 - weight94 weight96 weight98 weight00 weight02 weight04 weight06 weight08 weight10 weight12;

array intMoA   (*) intMo79 - intMo94 intMo96 intMo98 intMo00 intMo02 intMo04 intMo06 intMo08 intMo10 intMo12;

array dleMoA   (*) dleMo79 - dleMo94 dleMo96 dleMo98 dleMo00 dleMo02 dleMo04 dleMo06 dleMo08 dleMo10 dleMo12;

array dleYrA   (*) dleYr79 - dleYr94 dleYr96 dleYr98 dleYr00 dleYr02 dleYr04 dleYr06 dleYr08 dleYr10 dleYr12;

array curAtA   (*) curAt79 - curAt94 curAt96 curAt98 curAt00 curAt02 curAt04 curAt06 curAt08 curAt10 curAt12;

array hgcSA    (*) hgcS79 - hgcS94 hgcS96 hgcS98 hgcS00 hgcS02 hgcS04 hgcS06 hgcS08 hgcS10 hgcS12;

array hgcA     (*) hgc79 - hgc94 hgc96 hgc98 hgc00 hgc02 hgc04 hgc06 hgc08 hgc10 hgc12;

array dipA     (*) dip79 - dip94 dip96 dip98 dip00 dip02 dip04 dip06 dip08 dip10 dip12;

array intYrA   (*) intYr79 - intYr94 intYr96 intYr98 intYr00 intYr02 intYr04 intYr06 intYr08 intYr10 intYr12;

do i=1 to 15;

 intYrA(i) = 1978+i;

end;

array mayA (25) _TEMPORARY_ (5 17 29 41 53 65 77 89 101 113 125 137 149 161 173 185 209 233 257 281 305 329 353 377 401);

array intA (*)                                         int79 - int94 int96 int98 int00 int02 int04 int06 int08 int10 int12;

array dleA (*)                                         dle79 - dle94 dle96 dle98 dle00 dle02 dle04 dle06 dle08 dle10 dle12;

hgc_cur=-4;             *current highest grade completed;

do i=1 to dim (mayA);

            if intMoA(i)>0 & intYrA(i)>0 then intA(i)=12*(intYrA(i)-1979)+intMoA(i);

            else if weightA(i)=0 then intA(i)=-5;

            if dleMoA(i)>0 & dleYrA(i)>0 then dleA(i)=12*(dleYrA(i)-1979)+dleMoA(i);

            else if weightA(i)=0 then dleA(i)=-5;

            else if -4<dleMoA(i)<0 or -4<dleYrA(i)<0 then dleA(i)=-3;

            else dleA(i)=-4;

end;

*-------------------------------------------------------------------------------;

* Set HGC(i) and HGCS(i) to -5 if Weight = 0 ;

 

do i = 2 to dim(hgcA);

    if (weightA(i) = 0) then do;

        hgcA(i) = -5;

        hgcsA(i) = -5;

    end;

end;

*-------------------------------------------------------------------------------;

* Sometimes, set hgc_cur to hgcs(i) or hgc(i);

*do i = dim(hgcA) to 1 by -1;

    if  (asli_cur = 0 and                    /* did not attend school since last interview */

        /*(hvdip_c = -4 or hvdip_c = 0) and */ /* does not have HS diploma */ /* XA removed in R25: some report a HS date a lot earlier eg in 70's*/

        flag14 = 1) then do i = dim(hgcA) to 1 by -1;    /* XA R25 change the order of the two do-loop, same but more efficient*/

 

        if (hgc_cur = -4 and weightA(i) > 0) then do; /* Highest Grade completed current */

            *if ( IntMoA(i) >= 5 and                   /* Interviewed in May+ */

                (CurAtA(i) = 1 or (DLEMoA(i) >= 5 and DLEYrA(i) = IntYrA(i))) and /* Currently in school or was in school after May */

                 HgcSA(i) > HgcA(i) )

                then hgc_cur = HgcSA(i);       /* Highest grade completed*/

                                    if ( IntA(i) >= mayA(i) and                   /* Interviewed in May+ */

                (CurAtA(i) = 1 or DLEA(i) >= mayA(i)) and /* Currently in school or was in school after May */

                 HgcSA(i) > HgcA(i) )

                then hgc_cur = HgcSA(i);       /* Highest grade completed*/

                else hgc_cur = HgcA(i);                      /* Created HGC as of 05/01 survey year revised version*/

                                    *XA changed in R25;

        end;

    end;

*end;

 

 

*-------------------------------------------------------------------------------;

if (asli_cur = 1 and flag14 = 1) then do;

    if (hgcs_cur <= 0)  then do;

        if (curat_c = 1 and grade_c >= 1) then hgc_cur=(grade_c - 1);

        else if (curat_c = 0 and hga_cur >= 1) then do;

            *if (dleyr_ca < lastyr or dlemo_ca < 5) then do;

                                    if (dleyr_ca < curantYr) or (dleyr_ca=curantYr and dlemo_ca < 5) then                 hgc_cur=hga_cur;

        end;

        *else hgc_cur=(hga_cur - 1);

                        else if hga_cur>0 then hgc_cur=(hga_cur - 1);

    end;

    else if ((hgcs_cur = hga_cur or hgcs_cur = grade_c))  then do;

        *if ((dleyr_ca = curantyr and dlemo_ca >= 5) or (intmo_c >= 5 and curat_c = 1))  then do;

         if ((dleyr_ca>curantyr) or (dleyr_ca = curantyr and dlemo_ca >= 5) or (curat_c = 1))  then

            hgc_cur=(hgcs_cur - 1);         

         else hgc_cur=hgcs_cur;

    end;

    else if ((hgcs_cur = (hga_cur-1)) or

             (hgcs_cur = (grade_c-1)) or

             /*(hgcs_cur < hga_cur and 0 < hga_cur < 20) or

             (hgcs_cur < grade_c and 0 < grade_c < 20)) then*/

                                     (hgcs_cur < hga_cur and 0 < hga_cur <= 20) or

             (hgcs_cur < grade_c and 0 < grade_c <= 20)) then

              hgc_cur=hgcs_cur;

end;

 

*-------------------------------------------------------------------------------;

 

if ( ((hgc_cur = 10 or hgc_cur = 11) and (hvdip_c = 1 or attcol_c = 1)) or

     (dip_cur>=1 and hgc_cur < 12) or

     (hgc_cur = -4 and (dip_cur = 1 or dip_cur = 3))) then

      hgc_cur=12;

else if (hgc_cur < 0 and dip_cur = -3) then

      hgc_cur=-3;

*-------------------------------------------------------------------------------;

 

if ( (hgc_cur > 20) or

     (hgc_cur > hgc_dli + 3 & hgc_dli > 0 & dip_cur ~= 2 & dip_cur ~= 3) or (hgc_cur = 11 & hgc_dli = 12 )) then

             hgc_cur=-3;  

 

*-------------------------------------------------------------------------------;

 

tru=0;          * true: 0 - does not have HS diploma (ever), 1 does have a HS diploma;

do i = 1 to dim(dipA);

    *if (dipA(i) > 1) then do;

            if (dipA(i) > =1) then do;

        tru=1;

        if (hgc_cur < 12) then hgc_cur=12; * has HS diploma => has HGC >= 12;

        leave;

    end;

end;

*-------------------------------------------------------------------------------;

 

if (flag14 = 0) then do;

    hgc_cur=-5;

    hgcRev_cur=-5;

end;

 

if (flag14 = 1) then do;

    if (hgc_cur = -4) then hgc_cur=-3;

end;

==============================================================================;

*                                                                               ;

* Create revised variables                                                      ;

*                                                                               ;

* ==============================================================================;

/*

The revised variables take into account more accurately past reports of HGC to

eliminate regressive changes in HGC (for instance, preventing someone who has

previously reported completing 18 years of schooling, and is now working on an

undergraduate level in some area from being coded lower than 18) */

/* maxGrd - the highest hgc value ever computed */

maxGrd=hgc_cur;

do i = 1 to dim(hgcA);

    if (weightA(i) > 0 & hgcA(i) > maxGrd) then  maxGrd = hgcA(i);

end;

if (hgc_cur = -5) then maxGrd = -5;

hgcRev_cur = maxGrd;

 

HIGHEST GRADE COMPLETED AS OF MAY 1, 2016

* Create all the necessary arrays;

array weightA  (*) weight79 - weight94 weight96 weight98 weight00 weight02 weight04 weight06 weight08 weight10 weight12 weight14 ;
array intMoA   (*) intMo79 - intMo94 intMo96 intMo98 intMo00 intMo02 intMo04 intMo06 intMo08 intMo10 intMo12 intMo14 ;
array dleMoA   (*) dleMo79 - dleMo94 dleMo96 dleMo98 dleMo00 dleMo02 dleMo04 dleMo06 dleMo08 dleMo10 dleMo12 dleMo14 ;
array dleYrA   (*) dleYr79 - dleYr94 dleYr96 dleYr98 dleYr00 dleYr02 dleYr04 dleYr06 dleYr08 dleYr10 dleYr12 dleYr14 ;
array curAtA   (*) curAt79 - curAt94 curAt96 curAt98 curAt00 curAt02 curAt04 curAt06 curAt08 curAt10 curAt12 curAt14 ;
array hgcSA    (*) hgcS79 - hgcS94 hgcS96 hgcS98 hgcS00 hgcS02 hgcS04 hgcS06 hgcS08 hgcS10 hgcS12 hgcS14 ;
array hgcA     (*) hgc79 - hgc94 hgc96 hgc98 hgc00 hgc02 hgc04 hgc06 hgc08 hgc10 hgc12 hgc14 ;
array dipA     (*) dip79 - dip94 dip96 dip98 dip00 dip02 dip04 dip06 dip08 dip10 dip12 dip14 ;
array intYrA   (*) intYr79 - intYr94 intYr96 intYr98 intYr00 intYr02 intYr04 intYr06 intYr08 intYr10 intYr12 intYr14 ;


do i=1 to 15;
    if weightA(i)>0 then intYrA(i) = 1978+i;
end;


array mayA (26) _TEMPORARY_ (5 17 29 41 53 65 77 89 101 113 125 137 149 161 173 185 209 233 257 281 305 329 353 377 401 425);
array intA (*)                  int79 - int94 int96 int98 int00 int02 int04 int06 int08 int10 int12 int14 ;
array dleA (*)                  dle79 - dle94 dle96 dle98 dle00 dle02 dle04 dle06 dle08 dle10 dle12 dle14 ;

hgc_cur=-4;             *current highest grade completed;

do i=1 to dim (mayA);
    if intMoA(i)>0 & intYrA(i)>0 then intA(i)=12*(intYrA(i)-1979)+intMoA(i);
    else if weightA(i)=0 then intA(i)=-5; 
     if dleMoA(i)>0 & dleYrA(i)>0 then dleA(i)=12*(dleYrA(i)-1979)+dleMoA(i);
      else if weightA(i)=0 then dleA(i)=-5;
      else if -4<dleMoA(i)<0 or -4<dleYrA(i)<0 then dleA(i)=-3;
      else dleA(i)=-4; 
end;

*-------------------------------------------------------------------------------;
* Set HGC(i) and HGCS(i) to -5 if Weight = 0 ;

do i = 2 to dim(hgcA);
    if (weightA(i) = 0) then do;
        hgcA(i) = -5;
        hgcsA(i) = -5;
    end;
end;

*-------------------------------------------------------------------------------;
* Sometimes, set hgc_cur to hgcs(i) or hgc(i);

    if  (asli_cur = 0 and                    /* did not attend school since last interview */
        flag16 = 1) then do i = dim(hgcA) to 1 by -1;

        if (hgc_cur = -4 and weightA(i) > 0) then do; /* Highest Grade completed current */
                          if ( IntA(i) >= mayA(i) and                   /* Interviewed in May+ */
                (CurAtA(i) = 1 or DLEA(i) >= mayA(i)) and /* Currently in school or was in school after May */
                 HgcSA(i) > HgcA(i) )
                then hgc_cur = HgcSA(i);    /* Highest grade completed*/
                else hgc_cur = HgcA(i);        /* Created HGC as of 05/01 survey year revised version*/
        end;
    end;


*-------------------------------------------------------------------------------;

if (asli_cur = 1 and flag16 = 1) then do;
    if (hgcs_cur <= 0)  then do;
        if (curat_c = 1 and grade_c >= 1) then hgc_cur=(grade_c - 1);
        else if (curat_c = 0 and hga_cur >= 1) then do;
            if (dleyr_ca < curantYr) or (dleyr_ca=curantYr and dlemo_ca < 5) then
                hgc_cur=hga_cur;
        end;
            else if hga_cur>0 then hgc_cur=(hga_cur - 1);
    end;
    else if ((hgcs_cur = hga_cur or hgcs_cur = grade_c))  then do;
            if ((dleyr_ca>curantyr) or (dleyr_ca = curantyr and dlemo_ca >= 5) or (curat_c = 1))  then
            hgc_cur=(hgcs_cur - 1);          
         else hgc_cur=hgcs_cur;
    end;
    else if ((hgcs_cur = (hga_cur-1)) or
             (hgcs_cur = (grade_c-1)) or
        (hgcs_cur < hga_cur and 0 < hga_cur <= 20) or
             (hgcs_cur < grade_c and 0 < grade_c <= 20)) then
               hgc_cur=hgcs_cur;
end;

*-------------------------------------------------------------------------------;

if ( ((hgc_cur = 10 or hgc_cur = 11) and (hvdip_c = 1 or attcol_c = 1)) or
     (dip_cur>=1 and hgc_cur < 12) or
     (hgc_cur = -4 and (dip_cur = 1 or dip_cur = 3))) then
      hgc_cur=12;
else if (hgc_cur < 0 and dip_cur = -3) then
      hgc_cur=-3;
*-------------------------------------------------------------------------------;

if ( (hgc_cur > 20) or
     (hgc_cur > hgc_dli + 3 & hgc_dli > 0 & dip_cur ~= 2 & dip_cur ~= 3) or
     (hgc_cur = 11 & hgc_dli = 12 )) then 
     hgc_cur=-3;   

*-------------------------------------------------------------------------------;

tru=0;          * true: 0 - does not have HS diploma (ever), 1 does have a HS diploma; 

do i = 1 to dim(dipA);
    *if (dipA(i) > 1) then do;
    if (dipA(i) > =1) then do;
        tru=1;
        if (hgc_cur < 12) then hgc_cur=12;               * has HS diploma => has HGC >= 12;
        leave; 
    end;
end;

*-------------------------------------------------------------------------------;

if (flag16 = 0) then do;
    hgc_cur=-5; 
    hgcRev_cur=-5;
end;

if (flag16 = 1) then do;
    if (hgc_cur = -4) then hgc_cur=-3;
end;

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

* ============================================;
*                                                                                              ;
* Create revised variables                                                      ;
*                                                                                              ;
* ============================================;
/* 
The revised variables take into account more accurately past reports of HGC to 
eliminate regressive changes in HGC (for instance, preventing someone who has 
previously reported completing 18 years of schooling, and is now working on an 
undergraduate level in some area from being coded lower than 18) */

/* maxGrd - the highest hgc value ever computed */

maxGrd=hgc_cur;
do i = 1 to dim(hgcA);
    if (weightA(i) > 0 & hgcA(i) > maxGrd) then  maxGrd = hgcA(i);
end;

if (hgc_cur = -5) then maxGrd = -5;

 

 

array weightA  (*) weight79 - weight94 weight96 weight98 weight00 weight02 weight04 weight06 weight08 weight10 weight12 weight14 ;

array intMoA   (*) intMo79 - intMo94 intMo96 intMo98 intMo00 intMo02 intMo04 intMo06 intMo08 intMo10 intMo12 intMo14 ;

array dleMoA   (*) dleMo79 - dleMo94 dleMo96 dleMo98 dleMo00 dleMo02 dleMo04 dleMo06 dleMo08 dleMo10 dleMo12 dleMo14 ;

array dleYrA   (*) dleYr79 - dleYr94 dleYr96 dleYr98 dleYr00 dleYr02 dleYr04 dleYr06 dleYr08 dleYr10 dleYr12 dleYr14 ;

array curAtA   (*) curAt79 - curAt94 curAt96 curAt98 curAt00 curAt02 curAt04 curAt06 curAt08 curAt10 curAt12 curAt14 ;

array hgcSA    (*) hgcS79 - hgcS94 hgcS96 hgcS98 hgcS00 hgcS02 hgcS04 hgcS06 hgcS08 hgcS10 hgcS12 hgcS14 ;

array hgcA     (*) hgc79 - hgc94 hgc96 hgc98 hgc00 hgc02 hgc04 hgc06 hgc08 hgc10 hgc12 hgc14 ;

array dipA     (*) dip79 - dip94 dip96 dip98 dip00 dip02 dip04 dip06 dip08 dip10 dip12 dip14 ;

array intYrA   (*) intYr79 - intYr94 intYr96 intYr98 intYr00 intYr02 intYr04 intYr06 intYr08 intYr10 intYr12 intYr14 ;

 

 

do i=1 to 15;

    if weightA(i)>0 then intYrA(i) = 1978+i;

end;

 

 

array mayA (26) _TEMPORARY_ (5 17 29 41 53 65 77 89 101 113 125 137 149 161 173 185 209 233 257 281 305 329 353 377 401 425);

array intA (*)                                                          int79 - int94 int96 int98 int00 int02 int04 int06 int08 int10 int12 int14 ;

array dleA (*)                                                         dle79 - dle94 dle96 dle98 dle00 dle02 dle04 dle06 dle08 dle10 dle12 dle14 ;

 

hgc_cur=-4;             *current highest grade completed;

 

do i=1 to dim (mayA);

                if intMoA(i)>0 & intYrA(i)>0 then intA(i)=12*(intYrA(i)-1979)+intMoA(i);

                else if weightA(i)=0 then intA(i)=-5;

                if dleMoA(i)>0 & dleYrA(i)>0 then dleA(i)=12*(dleYrA(i)-1979)+dleMoA(i);

                else if weightA(i)=0 then dleA(i)=-5;

                else if -4<dleMoA(i)<0 or -4<dleYrA(i)<0 then dleA(i)=-3;

                else dleA(i)=-4;

end;

 

*-------------------------------------------------------------------------------;

* Set HGC(i) and HGCS(i) to -5 if Weight = 0 ;

 

do i = 2 to dim(hgcA);

    if (weightA(i) = 0) then do;

        hgcA(i) = -5;

        hgcsA(i) = -5;

    end;

end;

 

*-------------------------------------------------------------------------------;

* Sometimes, set hgc_cur to hgcs(i) or hgc(i);

 

    if  (asli_cur = 0 and                    /* did not attend school since last interview */

        flag16 = 1) then do i = dim(hgcA) to 1 by -1;

 

        if (hgc_cur = -4 and weightA(i) > 0) then do; /* Highest Grade completed current */

                          if ( IntA(i) >= mayA(i) and                   /* Interviewed in May+ */

                (CurAtA(i) = 1 or DLEA(i) >= mayA(i)) and /* Currently in school or was in school after May */

                 HgcSA(i) > HgcA(i) )

                then hgc_cur = HgcSA(i);/* Highest grade completed*/

                else hgc_cur = HgcA(i);                    /* Created HGC as of 05/01 survey year revised version*/

        end;

    end;

 

 

*-------------------------------------------------------------------------------;

 

if (asli_cur = 1 and flag16 = 1) then do;

    if (hgcs_cur <= 0)  then do;

        if (curat_c = 1 and grade_c >= 1) then hgc_cur=(grade_c - 1);

        else if (curat_c = 0 and hga_cur >= 1) then do;

                                                if (dleyr_ca < curantYr) or (dleyr_ca=curantYr and dlemo_ca < 5) then

                hgc_cur=hga_cur;

        end;

               else if hga_cur>0 then hgc_cur=(hga_cur - 1);

    end;

    else if ((hgcs_cur = hga_cur or hgcs_cur = grade_c))  then do;

            if ((dleyr_ca>curantyr) or (dleyr_ca = curantyr and dlemo_ca >= 5) or (curat_c = 1))  then

            hgc_cur=(hgcs_cur - 1);         

         else hgc_cur=hgcs_cur;

    end;

    else if ((hgcs_cur = (hga_cur-1)) or

             (hgcs_cur = (grade_c-1)) or

                    (hgcs_cur < hga_cur and 0 < hga_cur <= 20) or

             (hgcs_cur < grade_c and 0 < grade_c <= 20)) then

                 hgc_cur=hgcs_cur;

end;

 

*-------------------------------------------------------------------------------;

 

if ( ((hgc_cur = 10 or hgc_cur = 11) and (hvdip_c = 1 or attcol_c = 1)) or

                 (dip_cur>=1 and hgc_cur < 12) or

     (hgc_cur = -4 and (dip_cur = 1 or dip_cur = 3))) then

      hgc_cur=12;

else if (hgc_cur < 0 and dip_cur = -3) then

      hgc_cur=-3;

*-------------------------------------------------------------------------------;

 

if ( (hgc_cur > 20) or

     (hgc_cur > hgc_dli + 3 & hgc_dli > 0 & dip_cur ~= 2 & dip_cur ~= 3) or

     (hgc_cur = 11 & hgc_dli = 12 )) then

                 hgc_cur=-3;  

 

*-------------------------------------------------------------------------------;

 

tru=0;          * true: 0 - does not have HS diploma (ever), 1 does have a HS diploma;

 

do i = 1 to dim(dipA);

    *if (dipA(i) > 1) then do;

                if (dipA(i) > =1) then do;

        tru=1;

        if (hgc_cur < 12) then hgc_cur=12;               * has HS diploma => has HGC >= 12;

        leave;

    end;

end;

 

*-------------------------------------------------------------------------------;

 

if (flag16 = 0) then do;

    hgc_cur=-5;

    hgcRev_cur=-5;

end;

 

if (flag16 = 1) then do;

    if (hgc_cur = -4) then hgc_cur=-3;

end;

 

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

 

* ============================================;

*                                                                                              ;

* Create revised variables                                                      ;

*                                                                                              ;

* ============================================;

/*

The revised variables take into account more accurately past reports of HGC to

eliminate regressive changes in HGC (for instance, preventing someone who has

previously reported completing 18 years of schooling, and is now working on an

undergraduate level in some area from being coded lower than 18) */

 

/* maxGrd - the highest hgc value ever computed */

 

maxGrd=hgc_cur;

do i = 1 to dim(hgcA);

    if (weightA(i) > 0 & hgcA(i) > maxGrd) then  maxGrd = hgcA(i);

end;

 

if (hgc_cur = -5) then maxGrd = -5;

 

hgcRev_cur = maxGrd;

 

  • Highest Grade Ever Completed as of Most Recent Interview

 

NLSY79 Appendix 7: Unemployment Rate

The NLSY79 unemployment rate variables are constructed using state and area labor force data from the May publication of Employment and Earnings for the month of March of each survey year. Employment and Earnings is published by the U.S. Department of Labor, Bureau of Labor Statistics and lists the civilian labor force and number of unemployed persons for every state and selected metropolitan areas.

The figures provided for the state and selected metropolitan and micropolitan statistical areas are used to compute the unemployment rate for the portion or balance of the state that is not represented in a metropolitan or micropolitan statistical area. If a respondent resides in a metropolitan or micropolitan area that is listed in Employment and Earnings, then the unemployment rate is the unemployment rate for that metropolitan or micropolitan area. Otherwise, the unemployment rate is the computed balance of state unemployment rate for the state in which the respondent resides.

From 1979-2002, the respondent's metropolitan statistical area was assigned based on the county, state, and zip code of current residence. Beginning in 2004, the metropolitan or micropolitan statistical area is assigned based on the latitude and longitude of current residence. (For a detailed discussion of the hand-editing and merging process with other data files used to create the geographic variables, including the metropolitan statistical area, see Appendix 10: Geocode Documentation.)

As with other geographic based variables, respondents who are in the military, who are living outside of the United States, or who have invalid geographic data for a given survey year are valid skips on these variables.

The geocode data files contain the continuous unemployment rate as it was calculated for the area of residence.

NLSY79 Appendix 6: Urban-Rural and SMSA-Central City Variables

1979-1996 Urban-Rural Residence

Through 1996, the NLSY79 Urban-Rural Residence variables were constructed using the total and urban population data for the county of residence from the 1970 Census of Population Characteristics of the Population (for NLSY79 1979-1982) and from the 1980 Census of Population and Housing (for NLSY79 1983-1988). These data are included in the 1977 and 1983 County and City Data Book data files respectively.

The urban population consists of all inhabitants of urbanized areas. An urbanized area is defined as a central core or city and its adjacent, closely settled territory which have a combined total population of 50,000 or more (with exceptions in Alaska, New York, the New England states, and Wisconsin). These definitions have remained largely unchanged since 1950. For more detailed definitions and comments on exceptions, refer to the U.S. Bureau of the Census 1970/1980 Census of Population, Characteristics of the Population, Number of Inhabitants (Series PC80-1-A).

Calculation of the 1979-96 NLSY79 Urban-Rural Residence variables involved the following two steps:

  1. The percent of urban population was calculated by dividing the urban population of the county by the total county population and multiplying by 100.
  2. Rural counties for the NLSY79 variables were defined as those with between 0-49% urban population. Urban counties were defined as those with 50% or more urban population.

1998-2006 Urban-Rural Residence

Beginning with the 1998 release, the information needed to calculate whether the county was urban/rural was no longer available in the County and City Data Book releases. For 1998, a respondent is coded urban if living in an urbanized area or in a place with greater than 2500 population. There is no regard to county.

2008-2020 Urban-Rural Residence

For 2008-2020, the Urban/Rural variable is created using the definition of the US Census Bureau. A respondent is coded urban if living in an Urbanized Area or an Urban Cluster. All other respondents are considered rural. Respondents with quality of match of short street, long street or zip centroid are evaluated before assigning the urban/rural code. If the entire street or zip code falls within an area that fits the urban definition, the respondent is assigned an urban code. If the entire street or zip code falls within an area defined as rural, the respondent is assigned a rural code. If the street or zip code crosses an urban/rural boundary, the respondent is assigned an unknown code.

Non-interview respondents were assigned a valued of -5. Respondents who were residing outside of the United States were assigned a value of -4. Respondents who latitude and longitude of the current residence could not be determined were assigned a valued of -3.

User note

The method of calculating urban vs. rural prior to the 1998 data release designated an entire county as either urban or rural. For example, if a county contained multiple respondents, some living in an urban-like area and others in rural areas, they all received the same designation depending on the degree of urbanization of the county of residence. In 1998-2006, the method of calculating urban/rural allows a respondent living in a rural area of a county to be coded rural, while another respondent in an urban area of that same county can be coded urban. The net effect appears to be an increase in respondents living in rural areas.

For all survey years, non-interview cases are set to a -5 value on the Urban-Rural Residence variable. All other missing cases are valid skips on these variables.

For a detailed discussion of the procedures used for hand-editing and merging respondent data with other data in creating the geographic variables, see Appendix 10: Geocode Documentation in the NLSY79 Geocode Codebook Supplement.

1979-2020 SMSA-Central City Variables

The NLSY79 SMSA-Central City variables are constructed using data for the SMSA/MSA and Place Description (PD) included in the City Reference File (CRF) data files. The 1973 CRF was used for NLSY79 1979-1982 SMSA-Central City variables; the 1982 CRF was used for 1983 variables; 1983 CRF was used for 1984-1987 variables; the 1987 CRF was used for the 1988-1992 variables; and the 1992 CRF was used for the 1993-1998 variables. See below for information on the 2000-2020 variables. (For a more detailed discussion of changes in official terminology and geographic designations and comparability across years, see Appendix 10: Geocode Documentation in the NLSY79 Geocode Codebook Supplement.)

1979-1998 SMSA-Central City Residence

Through 1998, calculation of the SMSA-Central City Residence variables involved the following two steps:

  1. A respondent's SMSA/MSA and PD were assigned based on the county, state, and zip code of current residence. (For a detailed discussion of the procedures used for hand-editing and merging respondent data with other data in creating the geographic variables, including the SMSA/MSA, see Appendix 10: Geocode Documentation in the NLSY79 Geocode Codebook Supplement.)
  2. Based on their PD and SMSA/MSAs, respondents were assigned to one of the following categories:
  • Respondents not residing in an SMSA/MSA were defined as "not in SMSA."
  • Respondents residing in an SMSA/MSA, but not in a central city of an SMSA/MSA according to the PD, were defined as "SMSA, not central city."
  • Respondents for whom the PD leads to an ambiguous central city residence status were defined as "SMSA, central city not known." These cases generally resulted from zip codes that cover more than one geographically-defined area.
  • Respondents residing in both an SMSA/MSA and the central city of an SMSA/MSA according to the PD were defined as "SMSA in central city."

Non-interview respondents were assigned a value of -5. Respondents with an ambiguous SMSA/MSA residence status or missing values for reasons other than non-interview are valid skips on these variables.

2000-2002 SMSA-Central City Residence

Beginning with the 2000 release, the calculation of the central city variable was revised slightly. The process still consists of two components. The first delineation is MSA/non-MSA residence. For respondents in an MSA, the residence is further defined by placement inside or outside a central city as defined by the Census Bureau.

Respondents who live in an MSA who have a quality of match code of either manual edit or zip centroid are evaluated before assigning the central city code. If the street (manual edit match) or the zip code area (zip centroid match) falls entirely within the boundaries of the central city they are coded as central city. If the street or zip code area fall completely outside the central city boundary, they are coded as not in a central city. Otherwise, these respondents are coded as central city unknown.

A further complication is that Maptitude, the software currently being used, does not include central city boundary files for several areas. Regardless of quality of match code, respondents in those areas are coded as being in a MSA with an unknown central city status since the mailing address is insufficient to reveal whether the respondent resides within the central city boundaries. When updates of Maptitude are available, the city boundaries will be updated.

2004-2020 CBSA-Principal City

The 2004-2020 CBSA-principal city variables were constructed using data for the CBSA (Core Based Statistical Area) and principal city. The creation of principal city variables involved the following two steps:

  1. A respondent's CBSA and principal city were assigned based on the latitude and longitude of the current residence (For more detailed discussion of the procedures, see Appendix 10: Geocode Documentation in the NLSY Geocode Codebook Supplement)
  2. Based on their CBSA and principal city residence, respondents were assigned to one of the following categories:
  • Respondents not residing in an CBSA were coded as "not in CBSA"
  • Respondents residing in a CBSA but not in a principal city of a CBSA were coded as "CBSA, not in principal city"
  • Respondents residing in both a CBSA and a principal city were coded as "CBSA, in principal city"
  • Respondents with an ambiguous CBSA or principal city residence status were coded as"CBSA, central city unknown." These cases generally resulted from street or zip code that covers more than one geographically-defined area.

Respondents who have a quality of match code of either manual edit or zip centroid are evaluated before assigning the CBSA-principal city code. If the street (manual edit match) or the zip code area (zip centroid match) falls entirely outside the boundaries of the CBSA, they are coded as"not in CBSA." If the street or zip code area falls entirely within the boundaries of the CBSA and the principal city they are coded as"CBSA, in a principal city." If the street or zip code area falls completely within the boundary of the CBSA but outside the principal city boundary, they are coded as "CBSA, not in a principal city." Otherwise, these respondents are coded as "CBSA, principal city unknown."

Non-interviewed respondents were assigned a valued of -5. Respondents who were residing outside of the United States were assigned a value of -4. Respondents for whom latitude and longitude of the current residence could not be determined were assigned a value of -3.

NLSY79 Appendix 5: Supplemental Fertility and Relationship Variables

File Contents

The supplemental fertility data file, found in the "Fertility and Relationship History/Created" area of interest, contains a variety of constructed and edited variables based on the fertility and marriage histories of respondents, as well as the household record, from the 1979-2020 National Longitudinal Surveys of Youth 1979 cohort (NLSY79). These variables enable users to more easily access the wealth of demographic information provided by the surveys and improve the internal consistency of such data across survey years. The file contains dates of birth, sex, and usual living arrangements for all respondents' children based on a review of the longitudinal data record. Beginning in 1994, the two-digit IDs of the biological children of the female respondents were added to FERTILITY AND RELATIONSHIP HISTORY, as were separate edit flags for male and female respondents. Beginning in 2014, the two-digit IDs of the biological children of the interviewed males have been included and a single edit flag for both male and female respondents has been created. Also included are created variables that summarize dates of marriage(s), number and type of marriage and/or cohabiting relationships, number of live births and other pregnancy outcomes, spacing between births, spacing between first birth and first marriage, and age of the respondent at the time of the first marriage and key fertility events. The variables included in this file are based upon the youth fertility data as revised in a data cleanup program undertaken in 1982-1983 with additional editing provided at selected subsequent survey points.

Prior to 2008, the fertility and relationship variables have been produced only as cross-sectional variable sets for each round. Beginning with the 2008 release, a cross-round (XRND) version of these variables is also being released. XRND variables have been created for all respondents using the data from the last point at which the respondent was interviewed.  The XRND variables created include the dates of birth and gender of all biological children, as well as the pregnancy and marriage history variables.  Included in this variable set are some additional variables: the last known residence of each child as well as a year of last interview variable. The last known residence variables are intended to help users to easily identify children who are deceased or adopted out.  These last known residence variables in no way replace the year-specific residence variables, which are likely to be of interest to researchers considering residence trends across time. Users should be careful to note the year of last interview variable, as these XRND variables include data for members of the dropped oversamples as well as respondents who have not been interviewed for many rounds for other reasons. The traditional cross-sectional variables will continue to be available and created for each subsequent round, and the XRND variables will also continue to be updated.

1982 Data Quality Check and 1986-1990 Revisions

Many of the inputs into these fertility variables (specifically month and year of child's birth) were revised in 1982 in order to maximize internal consistency across years. All of the fertility-related variables in the current file are based on these "revised" data items, with the exception of those variables created directly from the respondent's household record. The variable R08988.01 (Consistency of Fertility Data 79-82) specifies for each case whether, after revision, any discrepancy in the fertility history from 1979 to 1982 still remains. In general, when a respondent was interviewed each year from 1979 to 1982, the revised 1982 variables give an accurate picture of the respondent's fertility history as of 1982. However, some inconsistencies in the data over the period were irresolvable. In such cases, the original 1982 data were left intact and a code was assigned to indicate the nature of the remaining inconsistency. A code of "1" means that the 1982 data are consistent with previous survey years, "2" indicates that a dating error remains, and "3" means that an error in the number of children still remains as of 1982. When an error on dating and on number of children occurred simultaneously, the respondent was coded as having an error on number of children since this type of misreport was considered to be more serious.

Further edits to children's dates of births for female respondents occurred in 1986 as a result of preparation for the first round of the new child-mother data tape, and in 1987 for male respondents. In 1989, attention was given to correcting subsequent inconsistencies for both males and females. With each successive survey round, an effort is made to fill in previously missing values on children's birth dates and to include children the respondent has previously failed to report. Since 1990, additional information collected on the children of the female NLSY79 respondents and released on the "Children/Young Adults of the NLSY79" file, has been used to help reconcile inconsistent information for those respondents in the Fertility and Relationship History file. In general, the quality of the fertility record for the female respondents is superior to that reported for the male respondents. 

1994 Data Quality Check

Beginning in 1994, the supplemental fertility file includes several variables not available for earlier years. For each child of a female respondent, there is now a two-digit identification number variable, which will allow users to more accurately link data from the fertility file with data from the NLSY79 Child file. There is also a comprehensive edit flag for female respondents, allowing users to know which female respondents have had changes made to their fertility record for each survey year compared to previous data releases and what the nature of the change is. Detailed information about the coding categories is provided in the last section of this document. For male respondents, three types of edit flags are provided: two which show the extent of discrepancies between the most recent fertility record available and the current CRF data, and one which indicates cases edited to correct birth order.

As part of the preparation of the 1994 Fertility and Relationship History file, a major data reconciliation was undertaken, comparing the birth records of the female NLSY79 respondents across years. As a result, users may notice discrepancies in these variables across time. It is important for the user to understand that when a date of birth is corrected, we do not change the data for earlier points in time. Thus, there may be inconsistencies in the dates of birth and ages of specific children between the 1994 data and earlier or subsequent reports.

1993 Variable Construction

Although NLSY79 respondents were interviewed in 1993, the Fertility and Relationship History area of interest originally did not contain constructed variables for the 1993 survey year. Data collected in 1993 were used in the 1994 data reconciliation, and some information, such as dates of birth and death, were incorporated into the 1994 or later variables where appropriate. As part of the data work for the NLSY79 2000-2002 data releases, however, these 1993 variables were added to the Fertility and Relationship History area of interest.

The set of variables constructed for 1993 is similar to the sets created for other years in which the full battery of pre- and post-natal questions were not asked, such as 1989 or 1991, in that the pregnancy history variables were not created. Dates of birth, gender, and usual residence are constructed for all children, and 2-digit IDs are provided for the children of female respondents. As with the 1994 data, information for the male respondents was not examined as closely as was the information for female respondents. There is a detailed edit flag for the female respondents, as well as the three edit flags for the male respondents. The marriage history variables were also constructed for 1993.

Although the pattern of data evaluation and the creation of edit flags follow that of the 1994 data reconciliation, data comparisons were done only with data from the 1992 survey and earlier. Because of this approach to the data reconciliation and variable construction, the transition from 1993 to 1994 will not be seamless. Users are always advised to use Fertility and Relationship History data from the most recent survey in which a respondent was interviewed.

1979-2020 Relationship History Variables

As an outgrowth of research funded by the National Institute of Child Health and Human Development (NICHD), a series of cross-sectional relationship history variables has been added to the Fertility and Relationship History area of interest. Survey staff carefully examined the names and relationships of household members as reported in the household roster, as well as in the marriage history information collected in various rounds. An attempt was made to identify all cohabiting partners listed in the household record at any point and to combine this information with the marriage data reported by respondents. In this way, the number of spouse/partners reported across survey years was identified.

Two variables per survey year have been constructed for all interviews through 2018. For each survey, the first variable indicates the total number of spouses/partners a respondent has ever been known to have. The second variable reports the respondent's relationship to the current spouse/partner. Respondents with no current spouse/partner will have a value of zero on this variable, even if they have reported a spouse/partner in previous rounds. The possible relationship codes are spouse (1), opposite-sex partner (33), same-sex partner (75) or other (36); respondents with no known spouses or partners are coded -999. The code of "other" is used for cases where someone is listed in the household record of a given survey as, for example, an "other non-relative" but is listed as either a partner or a spouse in the preceding or subsequent survey.

These two variables can be used in conjunction to establish a numeric ID for the current or most recent spouse/partner for any given year. The value of the first variable (0-9 as of 2004) is the first digit of the ID, and the value of the second variable (1, 33, or 36) is the remainder. The resulting number indicates the sequential order of the spouse/partner in the respondent's relationship history and the respondent's relationship to that person.

Users should note that the total count of spouses and partners may be understated, because these variables are based on information reported on the interview date. A spouse or partner may have appeared between survey rounds but not have been present at any survey point. Early examination suggests that this applies to only a modest proportion of cases. In some instances, identification of spouses who were present only between rounds may be possible by using the NLSY79 marriage history, as well as the marriage transition information available at each survey point.

2012 Expansion of Marital Transition Variables

Prior to the 2012 data release, the supplemental fertility file included constructed variables for dates of marital transition up through the beginning of the third marriage. In order to provide users with the full range of dates of marital transition, survey staff carefully examined the all of the marital transition data collected in the NLSY79 to identify marriage transitions beyond the beginning of the third marriage. Beginning with the 2012 data release, constructed variables are available for marital transitions up through the beginning of the seventh marriage. These data will continue to be updated and expanded as needed.

2014 Data Quality Check

As part of the preparation of the 2014 Fertility and Relationship History file, a major data reconciliation was undertaken, comparing the birth records of the male NLSY79 respondents who were interviewed in R26 across previous interview years. As a result, users may notice discrepancies in these variables across time. It is important for the user to understand that when a date of birth is corrected, we do not change the data for earlier points in time. Thus, there may be inconsistencies in the dates of birth and ages of specific children between the 2014 data and earlier or subsequent reports.

There is a comprehensive edit flag for all respondents, allowing users to know which respondents have had changes made to their fertility record for each survey year compared to previous data releases and what the nature of the change is. Detailed information about the coding categories is provided in the last section of this document.

2016 Historical Reconciliation for Females

Prior to the 2016 data release, survey staff carefully examined the all of the data collected about children ever born in the NLSY79 for females last interviewed before 1993 and compared these data with the date of birth data in the NLSY79 Child and Young Adult data file. This historic reconciliation resulted in some changes to the dates of birth on a small number of children as well as the addition of a small number of previously missed children.

2018 Historical Reconciliation for Males

As part of the preparation of the 2018 Fertility and Relationship History file, a major data reconciliation was undertaken, comparing the birth records of the male NLSY79 respondents who were interviewed in R28 or had been last interviewed before R26 (2014). As a result, users may notice discrepancies in these variables across time. This historic reconciliation resulted in some changes to the dates of birth on a small number of children as well as the removal of a small number of children determined to be non-biological children.

It is important for the user to understand that when a date of birth is corrected, we do not change the data for earlier points in time. Thus, there may be inconsistencies in the dates of birth and ages of specific children between the cross-round variables and later data and earlier reports.

The supplemental fertility file now includes the two-digit ID for each child of both female and male respondents. Users should exercise caution when using the two-digit IDs of the children of male respondents to connect data from past rounds, as there is greater inconsistency in these than in the IDs of the children of female respondents. 

Published Reports

Since 1982, the NLSY79 fertility data have been collected with the support of funding from the National Institute of Child Health and Human Development (NICHD). The 1982 data quality check was also completed under the auspices of NICHD. A comprehensive description of the evaluation procedures used in revising the data, as well as a variety of tabular and multivariate analyses, can be found in the reports entitled "Fertility-Related Data in the 1982 National Longitudinal Survey of Work Experience of Youth: An Evaluation of Data Quality and Some Preliminary Analytical Results" and "Evaluation of Fertility Data and Preliminary Analytical Results from the 1983 (5th round) Survey of the National Longitudinal Surveys of Work Experience of Youth," both prepared by Frank L. Mott, Center for Human Resource Research. The latter report also includes a detailed evaluation of the NLSY79 abortion data. Additional tables referencing the 1986 data can also be found in "Selected Tables: National Longitudinal Surveys of Youth Cohort, May 1987." Evaluations of the marital history data are provided in R. Jean Haurin, "Inconsistencies in the NLSY Marital History Data - 1986 Supplemental Fertility File" and "Marriage and Childbearing of Adults: An Evaluation of the 1992 National Longitudinal Survey of Youth." These reports are available from NLS User Services.

Questions regarding the nature of the fertility data should be directed to Canada Keck, who can be reached via email at canada.keck@chrr.osu.edu.

Data Description

The current Fertility and Relationship History file includes a small set of fertility and relationship items for all respondents for 1979-1981 and a more extensive set of variables for 1982-2020, as well as cross-round (XRND) versions of key variables. These variables include the marriage, relationship and fertility histories of both male and female respondents and the pregnancy histories of the females. The 2020 Fertility and Relationship History file, along with the XRND variables, contains what we believe to be the most accurate information for the female respondents as of that survey point. Information about the biological children of the male respondents was not as closely scrutinized as was the females. Users should note several caveats with regard to the creation of specific variables:

  1. The fertility data of male respondents was typically less closely scrutinized than that of the female respondent. From 1993 to 2012, separate edit flags for males and females were added to the Fertility and Relationship History record. Beginning in 2014, the fertility data of the males were reconciled, and only one edit flag is provided for both male and female respondent.
  2. Users may notice discrepancies in dates of birth or gender variables across time. These discrepancies arise as part of the data reconciliation process. Occasionally, a child who is initially reported as a biological child has been later found to be a stillbirth or a non-biological child and removed from the fertility record. It is important for the user to understand that when a date of birth or other information is corrected, we do not change the data for earlier points in time. Thus, there may be inconsistencies in the dates of birth and ages of specific children, or the total number of children, between the current fertility record and earlier reports.
  3. Variables indicating the number of children or the age of the youngest child in the household refer to the respondent's biological, adopted, or step-children present in the household at the time of the interview. These variables are created by cycling through the household record for the given survey year. The variable titles and labels were historically adjusted for the 1998 data release to make this distinction more apparent.
  4. Variables relating to the female pregnancy histories such as number of pregnancies, number of miscarriages/stillbirths, month and year began first pregnancy, age began first pregnancy, and outcome of first pregnancy have valid values only for female respondents interviewed at the survey year in question and who were also interviewed at the time of the 1982 and 1983 surveys when full retrospective pregnancy histories were collected. All male respondents as well as female respondents not interviewed in both 1982 and 1983 are coded as a "-4" on these variables since a complete pregnancy profile is unavailable. Beginning with 1992, miscarriages and stillbirths are collapsed into a single code ("2") on the variable "Outcome of First Pregnancy."
    Confidential abortion reports were collected in 1984, 1986, 1988, 1990, 1992, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, and 2012. This information has been incorporated into the creation of the pregnancy-related variables. For that small subset of female respondents for whom full pregnancy histories are unavailable, some will have full abortion data if they were interviewed in 1984. Thus, there are smaller numbers of respondents with a code of "-4" on the variable for number of abortions than on the other pregnancy variables. Current pregnancies are included in the count of the number of pregnancies as of a given survey date, and twins/triplets represent a single pregnancy. Where questionnaire items for the beginning date of the first pregnancy are unavailable and the outcome was a live birth, 9 months are subtracted from the child's birth date to obtain the beginning date of the first pregnancy. Where the outcome of the first pregnancy was an abortion reported only in one of the confidential reports, 3 months are subtracted.
  5. Beginning with the release of the 1985 marriage variables, an effort has been made to reconcile marriage dates with the key variables for current marital status made available in the "Key Variables" area of interest. For approximately 100 cases there are inconsistencies in the marriage histories over time, with some respondents changing their marital status from ever-married to never-married or vice-versa based on the marital status change item provided on the information sheet. Also, where the change was made very early in the longitudinal record and the respondent continued to verify the changed status in subsequent surveys, the marriage variables for 1985 and subsequent years have been altered accordingly and will differ from the marriage variables provided earlier. Where a change is recorded from never-married to ever-married using the information sheet item only, marriage dates were not collected and thus the respondent is missing information (or coded "-3") on the date of marriage. For all survey years, a marriage is considered to have ended only if the respondent reports a change to widowhood or divorce. Beginning with the 2012 release, the constructed dates of marriage variables have been expanded to include all reported marriages by NLSY79 respondents.
  6. All age variables referenced to events are constructed with the original date of birth of the respondent provided at the 1979 survey (R00003., R00004. and R00005). These variables were used to define a respondent's eligibility to be included in the NLSY79 sample.
  7. The variables indicating months between first marriage and first birth have traditionally ranged from negative to positive numbers, with specialized codes to indicate non-interview, no first child, no first marriage, and missing date information. Beginning with the 1998 data release, these data indicating months between first marriage and first birth for each FERTILE record 1982-2020 have been converted to all positive numbers. These variables are paired with a flag variable that indicates whether the first marriage occurred before or after the first birth. Both variables have been assigned new reference numbers. The specialized codes for non-interviews have been dropped; however, the other specialized codes have been retained. The original versions of these variables do not appear in the public release.
  8. The newly added relationship history variables help users track the number of spouse/partners identified through our data collection process. However, not all cohabiting partners may have been reported as such, and cohabiting partners could also have entered and exited households between survey rounds and thus be unavailable for identification.

Codebook Categories

The following variables have special coding specifications that users need to be aware of when using the 1994-2018 supplemental fertility data.

  • R50882. Edit Flag for Female Respondents 1994 Survey
  • R51735. Edit Flag for Female Respondents 1996 Survey
  • R64871. Edit Flag for Female Respondents 1998 Survey
  • R70149. Edit Flag for Female Respondents 2000 Survey
  • R77125. Edit Flag for Female Respondents 2002 Survey
  • R85050. Edit Flag for Female Respondents 2004 Survey
  • T09861. Edit Flag for Female Respondents 2006 Survey
  • T22185. Edit Flag for Female Respondents 2008 Survey
  • T31165. Edit Flag for Female Respondents 2010 Survey
  • T41210. Edit Flag for Female Respondents 2012 Survey
  • T50322. Edit Flag for ALL Respondents 2014 Survey
  • T57804. Edit Flag for ALL Respondents 2016 Survey
  • T82275. Edit Flag for ALL Respondents 2018 Survey
  • T87968. Edit Flag for ALL Respondents 2020 Survey

This edit flag is a general code that indicates the status of the MOTHER'S fertility record, and the indicated changes do not specify which child was affected.

0 = Consistent with previous supplemental fertility file records
1 = A child made younger
2 = A child made older
3 = Corrected previously missing information
4 = Information inconsistent with previous supplemental fertility; previous supplemental fertility information used
5 = Information inconsistent with previous supplemental fertility; mother’s current information accepted reluctantly
6 = IDs assigned out of birth order
7 = Discrepancy between CRF and FERTILE; current FERTILE will be consistent with previous supplemental fertility, but CRF preserved for next survey round
8 = Child removed from FERTILE; incorrectly recorded non-biological child
9 = Child removed from FERTILE; incorrectly recorded pregnancy loss
10 = IDs assigned out of birth order AND made a child younger
11 = IDs assigned out of birth order AND made a child older
12 = Gender changed from previous supplemental fertility
13 = Data from mother inconsistent; one child deleted, another added
14 = IDs out of birth order AND discrepancy between FERTILE and CRF (CRF preserved for next survey round)
15 = Child removed from FERTILE; incorrectly recorded pregnancy loss AND changed gender on another child from previous FERTILE
16 = Made current supplemental fertility consistent with current Child Supplement (new child)
17 = Sex missing from current CRF (new child); used information from current CS
18 = Child assessed in current round but inexplicably missing from current CRF; added to current supplemental fertility with residence information from HHR if possible
19 = Hand edited date of death
20 = Day of birth ONLY discrepancy between previous supplemental fertility and current CRF; unedited CRF day used
21 = Child assessed in current survey round but mother is a noninterview
22 = Mother added surprise older child; IDs out of birth order
23 = Incorrect code of 99 (deleted) generated for deceased/adopted out child; information corrected
24 = Duplicate date of birth of existing child on CRF; edited to reflect previous supplemental fertility
25 = Non-biological child not previously on FERTILE deleted from current CRF
26 = Incorrect code of 99 (deleted) generated for live child; status corrected and residence taken from HHR if possible
27 = Incorrect HH flag generated by CAPI for deceased/adopted out child; information corrected (New code in 1996)
28 = Residence missing from CRF; information from fertility section and/or HHR used (New code in 1996)
29 = Partial interview; used previous supplemental fertility file; residence coded from HH record if possible (New code in 1998)
30 = Incorrect code of 8 (deceased) generated for live child; status corrected and residence taken from HHR if possible (new code in 1998)
31 = Information corrected based on YA respondent correcting birth, age not affected
32 = Information corrected based on YA respondent correcting birth, age made older
33 = Information corrected based on YA respondent correcting birth, age made younger
34 = Child removed from FERTILE, added through interviewer error but not caught previously
35 = Residence coded based on information from HHR
36 = Residence coded from YA interview
37 = Year of birth corrected based on information from HHR
38 = Duplicate child removed from CRF, not previously in FERTILE
39 = Gender and day of birth changed from previous supplemental fertility
40 = One or more children made older and one or more younger, and IDs out of birth order
41 = One or more children made older and one or more children younger
42 = Child made older and missing child added
43 = Removed duplicate caused by interviewer error and made one child younger
44 = Corrected interviewer error that led to child missing from CRF
45 = Edited to resolve historical FERTILE/CRF inconsistencies
46 = Information inconsistent with previous supplemental fertility; respondent’s current information accepted reluctantly and non-biological child not previously on FERTILE deleted from current CRF
47 = Removed duplicate caused by interviewer error and made one child older
48 = Removed both duplicate child and nonbiological child
49 = Removed nonbiological child and made one child younger
50 = Removed nonbiological child and IDs out of birth order

There are three edit flags for MALE respondents for 1993-2012. The coding scheme for these flags appears in the codebook.

NLSY79 Appendix 4: Job Characteristics Index 1979-1982

Included in the 1979 and 1982 surveys is a measure of perceived job characteristics developed by Sims, Szilagyi, and Keller.1 This scale, the Job Characteristics Index (JCI), is an extension of the work first begun by Turner and Lawrence in 1965.2 The JCI was preceded by an instrument developed by Hackman and Oldham known as the Job Diagnostic Survey (JDS),3 whose dimensions are also incorporated in the JCI, but in a simpler format.

Comparisons of the JCI and JDS by Dunham et al.4 have shown that both scales tend to collapse to a one-dimensional scale measuring job-complexity. Therefore, the JCI was shortened by selecting one scale item which loaded strongly on each of the dimensions of job complexity shown to be important in earlier research. In their 1976 article, Sims et al. reported the necessary factor analysis scores used to obtain the abbreviated scale. The seven questionnaire items that comprise the shortened JCI scale are in Section 8, question 23, sub-questions 1-5, and questions 24A and C (Reference numbers 481.-486. and 488.) for 1979; for 1982, the items are in Section 5, question 36, sub-questions 1-5, and questions 36B and 36D (Reference numbers R7054.-R7059. and R7061.).

Notes

1 Sims, Henry R., Szilagyi, Andrew, And Keller, Robert. "The Measurement of Job Characteristics," Academy of Management Journal 26,2 (June, 1976): 195-212.

2 Turner, A.N. and Lawrence, P.R. Industrial Jobs and the Workers: An Investigation of Responses to Task Attributes. Boston: Harvard University Press, 1965.

3 Hackman, J.R. and Oldham, J.R. "Development of the Job Diagnostic Survey," Journal of Applied Psychology 60 (1975): 159-170.

4 Dunham, Randall, B., Aldag, Ramon, and Brief, Arthur P. "Dimensionality of Task Design as Measured by the Job Diagnostic Survey," Academy of Management Journal 20,2 (June, 1977): 209-223.

5 Pierce, Jon L. and Dunham, Randall B. "The Measurement of Perceived Job Characteristics: The Job Diagnostic Survey vs. the Job Characteristics Inventory, Academy of Management Journal 21,1 (March, 1978): 123-128.

NLSY79 Appendix 3: Job Satisfaction Measures

Included in the 1979 through 1982 NLSY79 is a measure of job satisfaction with econometric properties that make it better than the global job satisfaction measure also included in the surveys. The job satisfaction measure is a seven-item scale that has greater variance than the global satisfaction measure. The scale has been tested previously on broad cross-sections of national data.

The following is a list of the reference numbers for the job satisfaction scale variables and the global satisfaction variables for all of the current survey years in which it was used.

Survey Year

Reference # for Scale Items

Reference # for 
Global Satisfaction

1979

R00489.

R00490.

R00494.

R00496.

R00497.

R00506.

R00508.

1980

R02659.

R02660.

R02664.

R02666.

R02667.

R02676.

R02678.

1981

R04473.

R04474.

R04478.

R04480.

R04481.

R04490.

R04492.

1982

R07034.

R07035.

R07039.

R07041.

R07042.

R07052.

R07065.

1988

R25296.

R25297.

R25302.

R25304.

R25305.

--

R25329.

This scale is a shortened form of the job satisfaction scales perfected for use in the University of Michigan's Quality of Employment Surveys of 1969, 1973, and 1977. Short forms were developed and documented by Robert Quinn.1 The Quality of Employment Survey scale was chosen for inclusion in the NLS because it has been analyzed for its reliability across a broad cross-section of workers. It is also much easier to administer for a large multi-purpose survey than are many of the other job satisfaction scales that exist.2

To construct the full seven-item scale, raw scores for each item should be converted to z scores for each respondent. The scores can then be multiplied by 100 to remove decimals and combined to obtain an unweighted average of the seven z scores. The resulting scores for the satisfaction index are either positive or negative numbers that can be interpreted as deviations from the mean for the total sample of respondents in the survey.

Notes

1Quinn, R.B. and Mangione, T.W. "Jobsat '72 and Its Kinfolk - A Brief Manual." Chapter 5 in The 1969-1970 Survey of Working Conditions: Chronicles of an Unfinished Enterprise. Ann Arbor: Survey Research Center, Institute for Social Research, University of Michigan, 1973.

2Data on the validities of the job satisfaction measures in the Quality of Employment Survey are reported in Mangione, T., "The Validity of Job Satisfaction." Doctoral dissertation, The University of Michigan, 1973. For a review of job satisfaction indicators, see Seashore, S. and Taber, T., "Job Satisfaction Indicators and Their Correlates." American Behavioral Scientist 18 (1975), 333-368.

NLSY79 Appendix 2: Total Net Family Income Variable Creation (1979-2020)

Click a topic below to view details:

VARIABLE CREATION: TOTAL NET FAMILY INCOME 1979-83

          DCL 1 FAMILY_INCOME (5),

               5 AFDC,

               5 ALIM,

               5 CHSP,

               5 CPS,

               5 ED,

               5 EDSS,

               5 FAMILY,

               5 FAMINC,

               5 FARM,

               5 FOOD,

               5 GIFT,

               5 INC,

               5 INCOME,

               5 LEVEL,

               5 MIL,

               5 MILS,

               5 MN (3),

               5 OTHER,

               5 POVERTY,

               5 PUBLIC,

               5 R,

               5 RELREG,

               5 RELWEL,

               5 S,

               5 SEI,

               5 SEIS,

               5 SUMN,

               5 TABLE (3,2,15),

               5 UI,

               5 UIS,

               5 VET,

               5 WELF,

               5 WPS,

               5 WPSS,

               5 YOUTH;

1979 VARIABLES

         INC(1)=R(1903.10);

          IF R(1547.)=-4 THEN MIL(1)=0;

          ELSE MIL=R(1547.);

          IF R(1554.)=-4 THEN WPS(1)=0;

          ELSE WPS(1)=R(1554.);

          IF R(1560.)=-4 THEN SEI(1)=0;

          ELSE SEI(1)=R(1560.);

          IF R(1588.)=-4 & R(1590.)=-4 THEN UI(1)=0;

          ELSE IF R(1588.)>0 & R(1590.)>0 THEN UI(1)=R(1588.) * R(1590.);

          ELSE UI(1)=R(1590.);

          MILS(1)=0;

          IF R(1555.)=-4 THEN WPSS(1)=0;

          ELSE WPSS(1)=R(1555.);

          IF R(1561.)=-4 THEN SEIS(1)=0;

          ELSE SEIS(1)=R(1561.);

          IF R(1589.)=-4 & R(1591.)=-4 THEN UIS(1)=0;

          ELSE IF R(1589.)>0 & R(1591.)>0 THEN UIS(1)=R(1589.) * R(1591.);

          ELSE UIS(1)=R(1591.);

          IF R(1594.)=-4 THEN ALIM(1)=0;

          ELSE ALIM(1)=R(1594.);

          CHSP(1)=0;

          IF R(1608.)=-4 THEN AFDC(1)=0;

          ELSE DO;

             B=0;

             DO J=1596. TO 1607.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(1608.)<0 THEN AFDC(1)=R(1608.);

             ELSE IF B<=0 THEN AFDC(1)=-3;

             ELSE AFDC(1)=R(1608.) * B;

          END;

          IF R(1623.)=-4 THEN FOOD(1)=0;

          ELSE DO;

             B=0;

             DO J=1610. TO 1621.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF B<=0 THEN FOOD(1)=-3;

             ELSE IF R(1622.)>=0 & R(1623.)>0 THEN FOOD(1)=(R(1623.)-R(1622.))

                  * B;

             ELSE FOOD(1)=-3;

          END;

          WELF(1)=0;

          IF R(1640.)=-4 THEN PUBLIC(1)=0;

          ELSE DO;

             B=0;

             DO J=1628. TO 1639.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(1640.)<0 THEN PUBLIC(1)=R(1640.);

             ELSE IF B<=0 THEN PUBLIC(1)=-3;

             ELSE PUBLIC(1)=R(1640.) * B;    END;

          IF R(1645.)=-4 THEN ED(1)=0;

          ELSE ED(1)=R(1645.);

          IF R(1646.)=-4 THEN EDSS(1)=0;

          ELSE EDSS(1)=R(1646.);

          VET(1)=0;

          IF R(1649.)=-4 THEN GIFT(1)=0;

          ELSE GIFT(1)=R(1649.);

          IF R(1651.)=-4 THEN OTHER(1)=0;

          ELSE OTHER(1)=R(1651.);

          RELWEL(1)=0;

          IF R(1664.)=-4 THEN RELREG(1)=0;

          ELSE RELREG(1)=R(1664.);

/*  1979 FAMILY POVERTY STATUS, 1979 FAMILY POVERTY LEVEL, AND 1979 FAMILY POVERTY

     FLAG  */

 DCL PUBID PIC '99999';

 DCL S79            FIXED DEC(9);

     FAMILY79       FIXED DEC(9);

     FARM79         FIXED DEC(9);

     SCREENSZ       FIXED DEC(9);

     FLAG           FIXED DEC(9);

     INCOME79       FLOAT DEC(6);

     CAL_INCOME     FLOAT DEC(6);

     LEVEL79        FLOAT DEC(6);

     STATE79        FLOAT DEC(6);

     CPS79          FLOAT DEC(6);

     R79            FLOAT DEC(6);

     TABLE(3,2,15)  FLOAT DEC(6);

     R(1.10)        FLOAT DEC(6);

     R(2179.)       FLOAT DEC(6);

     R(1691.)       FLOAT DEC(6);

     R(1697.)       FLOAT DEC(6);

     R(1743.)       FLOAT DEC(6);

     R(1916.10)     FLOAT DEC(6);

     R(1921.)       FLOAT DEC(6);

     R(1919.)       FLOAT DEC(6);

     FAMSZ79        FLOAT DEC(6);

     WPS            FLOAT DEC(6);

     WPSS           FLOAT DEC(6);

     SEI            FLOAT DEC(6);

     SEIS           FLOAT DEC(6);

     MIL            FLOAT DEC(6);

     OTHER          FLOAT DEC(6);

     RELINC         FLOAT DEC(6);

     GIFT           FLOAT DEC(6);

 LEVEL79=-4;

 DO I=1 TO 3;

    DO J=1 TO 2;

       DO K=1 TO 15;

          TABLE(I,J,K)=-4;

       END;

    END;

 END;

END;

 FARM79=1;

 IF R(1919.)>4 THEN FARM79=2;

 /* TO CREATE FAMILY SIZE (I.E. FAMSZ79) SEARCH THRU THE

    HOUSEHOLD ENUMERATION INCREMENT FAMILY SIZE, IF THE

    RELATIONSHIP TO THE YOUTH IS A RELATIVE.  DO NOT

    INCREASE FAMILY SIZE, IF THE CODE IS <0 OR (>=33 & <=36) OR

    =45 OR =46 OR *>=50 & <=54) */

 IF FAMSZ79=0 THEN FAMILY79=1;

 ELSE FAMILY79=FAMSZ79;

 INCOME79=R(2179.);

 R79=0;

 IF R(1691.)>=0 THEN R79=R79+R(1691.);

 IF R(1697.)>=0 THEN R79=R79+R(1697.);

 IF FAMILY79>0 THEN DO;

    LEVEL79=TABLE(S79,FARM79,FAMILY79);

    IF INCOME79>LEVEL79 THEN CPS79=0;

    ELSE IF INCOME79>= 0 & INCOME79<=LEVEL79 THEN CPS79=1;

    ELSE IF R79>TABLE(S79,FARM79,FAMILY79) THEN CPS79=0;

    ELSE CPS79=-3;

 END;

FLAG=0;

 CAL_INCOME=0;

 IF CPS79=-3 & INCOME79<0 THEN DO;

    IF WPS>=0 THEN CAL_INCOME=CAL_INCOME + WPS;

    IF WPSS>=0 THEN CAL_INCOME=CAL_INCOME + WPSS;

    IF SEI>=0 THEN CAL_INCOME=CAL_INCOME + SEI;

    IF SEIS>=0 THEN CAL_INCOME=CAL_INCOME + SEIS;

    IF MIL>=0 THEN CAL_INCOME=CAL_INCOME + MIL;

    IF OTHER>=0 THEN CAL_INCOME=CAL_INCOME + OTHER;

    IF RELINC>=0 THEN CAL_INCOME=CAL_INCOME + RELINC;

    IF GIFT>=0 THEN CAL_INCOME=CAL_INCOME + GIFT;

    IF CAL_INCOME>0 THEN DO;

       IF CAL_INCOME>LEVEL79 THEN DO;

          CPS79=0;

          FLAG=1;

       END;

    END;

 END;

 IF CPS79=-3 & R(1916.10)>0 & R(1921.)>0 THEN DO;

    SCREENSZ=R(1921.);

    IF SCREENSZ=-4 THEN FAMILY79=1;

    ELSE FAMILY79=SCREENSZ;

    LEVEL79=TABLE(S79,FARM79,FAMILY79);

    IF R(1916.10)>LEVEL79 THEN DO;

       CPS79=0;

       FLAG=2;

    END;

    ELSE IF R(1916.10)<=LEVEL79 THEN DO;

       CPS79=1;

       FLAG=2;

    END;

 END;

CPS79=R(2179.10);

LEVEL79=R(2179.20);

FLAG79=R(2179.30);

1980 VARIABLES

          IF R(4052.)<=0 THEN INC(2)=-5;

          ELSE INC(2)=R(4045.10);

          IF R(3120.)=-4 THEN MIL(2)=0;

          ELSE MIL(2)=R(3120.);

          IF R(3123.)=-4 THEN WPS(2)=0;

          ELSE WPS(2)=R(3123.);

          IF R(3126.)=-4 THEN SEI(2)=0;

          ELSE SEI(2)=R(3126.);

          IF R(3146.)=-4 & R(3132.)=-4 THEN UI(2)=0;

          ELSE IF R(3146.)>0 & R(3132.)>0 THEN UI(2)=R(3146.) * R(3132.);

          ELSE UI(2)=R(3132.);

          IF R(3122.)=-4 THEN MILS(2)=0;

          ELSE MILS(2)=R(3122.);

          IF R(3127.10)=-4 THEN WPSS(2)=0;

          ELSE WPSS(2)=R(3127.10);

          IF R(3130.)=-4 THEN SEIS(2)=0;

          ELSE SEIS(2)=R(3130.);

          IF R(3160.)=-4 & R(3161.)=-4 THEN UIS(2)=0;

          ELSE IF R(3160.)>0 & R(3161.)>0 THEN UIS(2)=R(3160.) * R(3161.);

          ELSE UIS(2)=R(3161.);

          IF R(3164.)=-4 THEN ALIM(2)=0;

          ELSE ALIM(2)=R(3164.);

          CHSP(2)=0;

          IF R(3178.)=-4 THEN AFDC(2)=0;

          ELSE DO;

             B=0;

             DO J=3166. TO 3177.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(3178.)<0 THEN AFDC(2)=R(3178.);

             ELSE IF B<=0 THEN AFDC(2)=-3;

             ELSE AFDC(2)=R(3178.) * B;

          END;

          IF R(3192.)=-4 THEN FOOD(2)=0;

          ELSE DO;

             B=0;

             DO J=3180. TO 3191.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(3192.)=-4 THEN FOOD(2)=R(3192.);

             ELSE IF B<=0 THEN FOOD(2)=-3;

             ELSE FOOD(2)=R(3192.) * B;

          END;

          IF R(3206.)=-4 THEN WELF(2)=0;

          ELSE DO;

             B=0;

             DO J=3194. TO 3205.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(3206.)<0 THEN WELF(2)=R(3206.);

             ELSE IF B<=0 THEN WELF(2)=-3;

             ELSE WELF(2)=R(3206.) * B;

          END;

          IF R(3220.)=-4 THEN PUBLIC(2)=0;

          ELSE DO;

             B=0;

             DO J=3208. TO 3219.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(3220.)<0 THEN PUBLIC(2)=R(3220.);

             ELSE IF B<=0 THEN PUBLIC(2)=-3;

             ELSE PUBLIC(2)=R(3220.) * B;

          END;

          IF R(3225.)=-4 THEN ED(2)=0;

          ELSE ED(2)=R(3225.);

          IF R(3226.)=-4 THEN EDSS(2)=0;

          ELSE EDSS(2)=R(3226.);

          IF R(3228.)=-4 THEN VET(2)=0;

          ELSE VET(2)=R(3228.);

          IF R(3233.)=-4 THEN GIFT(2)=0;

          ELSE GIFT(2)=R(3233.);

          IF R(3235.)=-4 THEN OTHER(2)=0;

          ELSE OTHER(2)=R(3235.);

          IF R(3244.)=-4 THEN RELWEL(2)=0;

          ELSE RELWEL(2)=R(3244.);

          IF R(3251.10)=-4 THEN RELREG(2)=0;

          ELSE RELREG(2)=R(3251.10);

          IF R(4047.)=-4 THEN POVERTY(2)=0;

          ELSE POVERTY(2)=R(4047.);

          FAMILY(2)=0;

          DO J=3939. TO 4023. BY 6;

             IF R(J)<0 ! (R(J)>=33 & R(J)<=36) ! R(J)=45 ! R(J)=46 !

                (R(J)>=50 & R(J)<=53) THEN A=1;

                ELSE FAMILY(2)=FAMILY(2)+1;

          END;

1981 VARIABLES

          IF R(6146.)<=0 THEN INC(3)=-5;

          ELSE INC(3)=R(6138.10);

          YOUTH(3)=0;

          END;

          FARM(3)=1;

          IF R(6125.)>4 THEN FARM(3)=2;

          LEVEL(3)=-4;

          IF R(4825.)=-4 THEN MIL(3)=0;

          ELSE MIL(3)=R(4825.);

          IF R(4826.)=-4 THEN WPS(3)=0;

          ELSE WPS(3)=R(4826.);

          IF R(4832.)=-4 THEN SEI(3)=0;

          ELSE SEI(3)=R(4832.);

          IF R(4849.)=-4 & R(4850.)=-4 THEN UI(3)=0;

          ELSE IF R(4849.)>0 & R(4850.)>0 THEN UI(3)=R(4849.) * R(4850.);

          ELSE UI(3)=R(4850.);

          IF R(4828.)=-4 THEN MILS(3)=0;

          ELSE MILS(3)=R(4828.);

          IF R(4829.10)=-4 THEN WPSS(3)=0;

          ELSE WPSS(3)=R(4829.10);

          IF R(4835.)=-4 THEN SEIS(3)=0;

          ELSE SEIS(3)=R(4835.);

          IF R(4865.)=-4 & R(4866.)=-4 THEN UIS(3)=0;

          ELSE IF R(4865.)>0 & R(4866.)>0 THEN UIS(3)=R(4865.) * R(4866.);

          ELSE UIS(3)=R(4866.);

          IF R(4869.)=-4 THEN ALIM(3)=0;

          ELSE ALIM(3)=R(4869.);

          CHSP(3)=0;

          IF R(4883.)=-4 THEN AFDC(3)=0;

          ELSE DO;

             B=0;

             DO J=4871. TO 4882.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(4883.)<0 THEN AFDC(3)=R(4883.);

             ELSE IF B<=0 THEN AFDC(3)=-3;

             ELSE AFDC(3)=R(4883.) * B;

          END;

          IF R(4897.)=-4 THEN FOOD(3)=0;

          ELSE DO;

             B=0;

             DO J=4885. TO 4896.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(4897.)<0 THEN FOOD(3)=R(4897.);

             ELSE IF B<=0 THEN FOOD(3)=-3;

             ELSE FOOD(3)=R(4897.) * B;

          END;

          IF R(4911.)=-4 THEN WELF(3)=0;

          ELSE DO;

             B=0;

             DO J=4899. TO 4910.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(4911.)<0 THEN WELF(3)=R(4911.);

             ELSE IF B<=0 THEN WELF(3)=-3;

             ELSE WELF(3)=R(4911.) * B;

          END;

          IF R(4925.)=-4 THEN PUBLIC(3)=0;

          ELSE DO;

             B=0;

             DO J=4913. TO 4924.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(4925.)<0 THEN PUBLIC(3)=R(4925.);

             ELSE IF B<=0 THEN PUBLIC(3)=-3;

             ELSE PUBLIC(3)=R(4925.) * B;

          END;

          IF R(4930.)=-4 THEN ED(3)=0;

          ELSE ED(3)=R(4930.);

          IF R(4931.)=-4 THEN EDSS(3)=0;

          ELSE EDSS(3)=R(4931.);

          IF R(4933.)=-4 THEN VET(3)=0;

          ELSE VET(3)=R(4933.);

          IF R(4938.)=-4 THEN GIFT(3)=0;

          ELSE GIFT(3)=R(4938.);

          IF R(4940.)=-4 THEN OTHER(3)=0;

          ELSE OTHER(3)=R(4940.);

          IF R(4949.)=-4 THEN RELWEL(3)=0;

          ELSE RELWEL(3)=R(4949.);

          IF R(4956.10)=-4 THEN RELREG(3)=0;

          ELSE RELREG(3)=R(4956.10);

          IF R(6140.)=-4 THEN POVERTY(3)=0;

          ELSE POVERTY(3)=R(6140.);

          FAMILY(3)=0;

          DO J=6033. TO 6117. BY 6;

             IF R(J)<0 ! (R(J)>=33 & R(J)<=36) ! R(J)=45 ! R(J)=46 !

                (R(J)>=50 & R(J)<=53) THEN A=1;

             ELSE FAMILY(3)=FAMILY(3)+1;

          END;

1982 VARIABLES

 IF R(8967.)<=0 THEN INC(4)=-5;

          ELSE INC(4)=R(8304.);

          YOUTH(4)=0;

          IF R(7986.)>=0 THEN YOUTH(4)=R(7986.);

          IF R(7988.)>=0 THEN YOUTH(4)=Y(4)+R(7988.);

          IF R(7992.)>=0 THEN YOUTH(4)=Y(4)+R(7992.);

          END;

          FARM(4)=1;

          LEVEL(4)=-4;

          IF R(7820.)=-4 THEN MIL(4)=0;

          ELSE MIL(4)=R(7820.);

          IF R(7821.)=-4 THEN WPS(4)=0;

          ELSE WPS(4)=R(7821.);

          IF R(7824.)=-4 THEN SEI(4)=0;

          ELSE SEI(4)=R(7824.);

          IF R(7838.)=-4 & R(7839.)=-4 THEN UI(4)=0;

          ELSE IF R(7838.)>0 & R(7839.)>0 THEN UI(4)=R(7838.) * R(7839.);

          ELSE UI(4)=R(7839.);

          IF R(7842.)=-4 THEN MILS(4)=0;

          ELSE MILS(4)=R(7842.);

          IF R(7843.)=-4 THEN WPSS(4)=0;

          ELSE WPSS(4)=R(7843.);

          IF R(7846.)=-4 THEN SEIS(4)=0;

          ELSE SEIS(4)=R(7846.);

          IF R(7860.)=-4 & R(7861.)=-4 THEN UIS(4)=0;

          ELSE IF R(7860.)>0 & R(7861.)>0 THEN UIS(4)=R(7860.) * R(7861.);

          ELSE UIS(4)=R(7861.);

          IF R(7864.)=-4 THEN ALIM(4)=0;

          ELSE ALIM(4)=R(7864.);

          IF R(7869.)=-4 THEN CHSP(4)=0;

          ELSE CHSP(4)=R(7869.);

          IF R(7885.)=-4 THEN AFDC(4)=0;

          ELSE DO;

             B=0;

             DO J=7873. TO 7884.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(7885.)<0 THEN AFDC(4)=R(7885.);

             ELSE IF B<=0 THEN AFDC(4)=-3;

             ELSE AFDC(4)=R(7885.) * B;

          END;

          IF R(7899.)=-4 THEN FOOD(4)=0;

          ELSE DO;

             B=0;

             DO J=7887. TO 7898.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(7899.)<0 THEN FOOD(4)=R(7899.);

             ELSE IF B<=0 THEN FOOD(4)=-3;

             ELSE FOOD(4)=R(7899.) * B;

          END;

          IF R(7913.)=-4 THEN WELF(4)=0;

          ELSE DO;

             B=0;

             DO J=7901. TO 7912.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(7913.)<0 THEN WELF(4)=R(7913.);

             ELSE IF B<=0 THEN WELF(4)=-3;

             ELSE WELF(4)=R(7913.) * B;

          END;

          IF R(7927.)=-4 THEN PUBLIC(4)=0;

          ELSE DO;

             DO J=7915. TO 7926.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(7927.)<0 THEN PUBLIC(4)=R(7927.);

             ELSE IF B<=0 THEN PUBLIC(4)=-3;

             ELSE PUBLIC(4)=R(7927.) * B;

          END;

          IF R(7932.)=-4 THEN ED(4)=0;

          ELSE ED(4)=R(7932.);

          IF R(7933.)=-4 THEN EDSS(4)=0;

          ELSE EDSS(4)=R(7933.);

          IF R(7935.)=-4 THEN VET(4)=0;

          ELSE VET(4)=R(7935.);

          IF R(7939.)=-4 THEN GIFT(4)=0;

          ELSE GIFT(4)=R(7939.);

          IF R(7941.)=-4 THEN OTHER(4)=0;

          ELSE OTHER(4)=R(7941.);

          IF R(7949.)=-4 THEN RELWEL(4)=0;

          ELSE RELWEL(4)=R(7949.);

          IF R(7956.)=-4 THEN RELREG(4)=0;

          ELSE RELREG(4)=R(7956.);

          IF R(8306.)=-4 THEN POVERTY(4)=0;

          ELSE POVERTY(4)=R(8306.);

          FAMILY(4)=0;

          DO J=8177. TO 8275. BY 7;

             IF R(J)<0 ! (R(J)>=33 & R(J)<=36) ! R(J)=45 ! R(J)=46 !

                (R(J)>=50 & R(J)<=53) THEN A=1;

                ELSE FAMILY(4)=FAMILY(4)+1;

          END;

1983 VARIABLES

          IF R(11444.)<=0 THEN INC(5)=-5;

          ELSE INC(5)=R(10777.);

          YOUTH(5)=0;

          END;

          FARM(5)=1;

          IF R(10764.)>4 THEN FARM(5)=2;

          LEVEL(5)=-4;

          IF R(10239.)=-4 THEN MIL(5)=0;

          ELSE MIL(5)=R(10239.);

          IF R(10240.)=-4 THEN WPS(5)=0;

          ELSE WPS(5)=R(10240.);

          IF R(10243.)=-4 THEN SEI(5)=0;

          ELSE SEI(5)=R(10243.);

          IF R(10257.)=-4 & R(10258.)=-4 THEN UI(5)=0;

          ELSE IF R(10257.)>0 & R(10258.)>0 THEN UI(5)=R(10257.) * R(10258.);

          ELSE IF R(10258.)<0 THEN UI(5)=R(10258.);

          ELSE UI(5)=-3;

          IF R(10261.)=-4 THEN MILS(5)=0;

          ELSE MILS(5)=R(10261.);

          IF R(10262.)=-4 THEN WPSS(5)=0;

          ELSE WPSS(5)=R(10262.);

          IF R(10265.)=-4 THEN SEIS(5)=0;

          ELSE SEIS(5)=R(10265.);

          IF R(10279.)=-4 & R(10280.)=-4 THEN UIS(5)=0;

          ELSE IF R(10279.)>0 & R(10280.)>0 THEN UIS(5)=R(10279.) * R(10280.);

          ELSE IF R(10280.)<0 THEN UIS(5)=R(10280.);

          ELSE UIS(5)=-3;

          IF R(10283.)=-4 THEN ALIM(5)=0;

          ELSE ALIM(5)=R(10283.);

          IF R(10288.)=-4 THEN CHSP(5)=0;

          ELSE CHSP(5)=R(10288.);

          IF R(10304.)=-4 THEN AFDC(5)=0;

          ELSE DO;

             B=0;

             DO J=10292. TO 10303.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(10304.)<0 THEN AFDC(5)=R(10304.);

             ELSE IF B<=0 THEN AFDC(5)=-3;

             ELSE AFDC(5)=R(10304.) * B;

          END;

          IF R(10318.)=-4 THEN FOOD(5)=0;

          ELSE DO;

             B=0;

             DO J=10306. TO 10317.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(10318.)<0 THEN FOOD(5)=R(10318.);

             ELSE IF B<=0 THEN FOOD(5)=-3;

             ELSE FOOD(5)=R(10318.) * B;

          END;

          IF R(10332.)=-4 THEN WELF(5)=0;

          ELSE DO;

             B=0;

             DO J=10320. TO 10331.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(10332.)<0 THEN WELF(5)=R(10332.);

             ELSE IF B<=0 THEN WELF(5)=-3;

             ELSE WELF(5)=R(10332.) * B;

          END;

          IF R(10346.)=-4 THEN PUBLIC(5)=0;

          ELSE DO;

             B=0;

             DO J=10334. TO 10345.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(10346.)<0 THEN PUBLIC(5)=R(10346.);

             ELSE IF B<=0 THEN PUBLIC(5)=-3;

             ELSE PUBLIC(5)=R(10346.) * B;

          END;

          IF R(10351.)=-4 THEN ED(5)=0;

          ELSE ED(5)=R(10351.);

          IF R(10352.)=-4 THEN EDSS(5)=0;

          ELSE EDSS(5)=R(10352.);

          IF R(10354.)=-4 THEN VET(5)=0;

          ELSE VET(5)=R(10354.);

          IF R(10358.)=-4 THEN GIFT(5)=0;

          ELSE GIFT(5)=R(10358.);

          IF R(10360.)=-4 THEN OTHER(5)=0;

          ELSE OTHER(5)=R(10360.);

          IF R(10368.)=-4 THEN RELWEL(5)=0;

          ELSE RELWEL(5)=R(10368.);

          IF R(10375.)=-4 THEN RELREG(5)=0;

          ELSE RELREG(5)=R(10375.);

          IF R(10779.)=-4 THEN POVERTY(5)=0;

          ELSE POVERTY(5)=R(10779.);

          FAMILY(5)=0;

          DO J=10556. TO 10654. BY 7;

             IF R(J)<0 ! (R(J)>=33 & R(J)<=36) ! R(J)=45 ! R(J)=46 !

                (R(J)>=50 & R(J)<=54) THEN A=1;

                ELSE FAMILY(5)=FAMILY(5)+1;

          END;

          DO I=1 TO 5;

             MN=0;

             FAMINC(I)=0;

             DO K=MIL(I),MILS(I),WPS(I),WPSS(I),SEI(I),SEIS(I),UI(I),

                UIS(I),ALIM(I),CHSP(I),AFDC(I),FOOD(I),WELF(I),

                PUBLIC(I),ED(I),EDSS(I) VET(I),GIFT(I),OTHER(I),

                RELWEL(I),RELREG(I);

                IF K<0 THEN MN(I,ABS(K))=MN(I,ABS(K))+1;

                ELSE FAMINC(I)=FAMINC(I) + K;

             END;

             SUMN(I)=MN(I,1) + MN(I,2) + MN(I,3);

             INCOME(I)=-3;

             IF INC(I)=-5 THEN DO;

                INCOME(I),CPS(I)=-5;

             END;

             ELSE INC(I)^=-4 THEN INCOME(I)=INC(I);

             ELSE DO;

                IF SUMN(I)=0 THEN INCOME(I)=FAMINC(I);

                ELSE DO J=1 TO 3;

                   IF MN(I,J)>0 THEN INCOME(I)=-J;

                END;

             END;

             IF I>2 THEN DO;

                IF FAMILY(I)>0 THEN DO;

                   LEVEL(I)=TABLE(I,S(I),FARM(I),FAMILY(I));

                   IF INC(I)>LEVEL(I) ! FAMINC(I)>LEVEL(I) THEN CPS(I)=0;

                   ELSE IF INC(I)>=0 ! (SUMN(I)=0 & INC(I)=-4) THEN CPS(I)=1;

                   ELSE IF POVERTY(I)>0 THEN CPS(I)=POVERTY(I)-1;

                   ELSE CPS(I)=-3;

                END;

                END;

                IF CPS(I)=-3 & FAMILY(I)>0 & YOUTH(I)>

                   TABLE(I,S(I),FARM(I),FAMILY(I)) THEN CPS(I)=0;

             END;

          IF I=2 THEN DO;

             IF INCOME(2)=-5 THEN CPS(2)=-5;

             ELSE DO;

                   IF INC(2)>=0 & FAMILY(2)>0 THEN CPS(2)=1;

                   ELSE DO;

                      IF SUMN(2)=0 & (R(4027.)=3 ! R(4029.)>1) & FAMILY(2)>0

                         THEN CPS(2)=1;

                      ELSE IF POVERTY(2)>0 THEN CPS(2)=POVE RTY(2)-1;

                      ELSE CPS(2)=-3;

                   END;

                END;

             END;

          END;

          R(2179.)=INCOME(1);

          R(4060.)=INCOME(2);

          R(4061.)=POVERTY(2);

          R(6184.10)=INCOME(3);

          R(6185.)=POVERTY(3);

          R(8986.)=INCOME(4);

          R(8987.)=POVERTY(4);

          R(11445.10)=INCOME(5);

          R(11448.)=POVERTY(5);

VARIABLE CREATION: TOTAL NET FAMILY INCOME 1984-86

         DCL

           1 FAMILY_INCOME (6:8),

             5 AFDC,

             5 ALIM,

             5 CHSP,

             5 CPS,

             5 ED,

             5 EDSS,

             5 FAMILY,

             5 FAMINC,

             5 FARM,

             5 FOOD,

             5 GIFT,

             5 INC,

             5 INCOME,

             5 LEVEL,

             5 MIL,

             5 MILS,

             5 MN (3),

             5 OTHER,

             5 POVERTY,

             5 PUBLIC,

             5 RELREG,

             5 RELWEL,

             5 S,

             5 SEI,

             5 SEIS,

             5 SUMN,

             5 TABLE(3,15),

             5 UI,

             5 UIS,

             5 VET,

             5 WELF,

             5 WPS,

             5 WPSS;

1984 VARIABLES

          FAMILY_INCOME=-4;

          IF R(15196.)=0 THEN INC(6)=-5;

          ELSE INC(6)=R(14534.);

          END;

          FARM(6)=1;

          LEVEL(6)=-4;

          IF R(14106.)=-4 THEN MIL(6)=0;

          ELSE MIL(6)=R(14106.);

          IF R(14107.)=-4 THEN WPS(6)=0;

          ELSE WPS(6)=R(14107.);

          IF R(14110.)=-4 THEN SEI(6)=0;

          ELSE SEI(6)=R(14110.);

          IF R(14124.)=-4 & R(14125.)=-4 THEN UI(6)=0;

          ELSE IF R(14124.)>0 & R(14125.)>0 THEN UI(6)=R(14124.) * R(14125.);

          ELSE IF R(14125.)<0 THEN UI(6)=R(14125.);

          ELSE UI(6)=-3;

          IF R(14128.)=-4 THEN MILS(6)=0;

          ELSE MILS(6)=R(14128.);

          IF R(14129.)=-4 THEN WPSS(6)=0;

          ELSE WPSS(6)=R(14129.);

          IF R(14132.)=-4 THEN SEIS(6)=0;

          ELSE SEIS(6)=R(14132.);

          IF R(14146.)=-4 & R(14147.)=-4 THEN UIS(6)=0;

          ELSE IF R(14146.)>0 & R(14147.)>0 THEN UIS(6)=R(14146.) * R(14147.);

          ELSE IF R(14147.)<0 THEN UIS(6)=R(14147.);

          ELSE UIS(6)=-3;

          IF R(14150.)=-4 THEN ALIM(6)=0;

          ELSE ALIM(6)=R(14150.);

          IF R(14155.)=-4 THEN CHSP(6)=0;

          ELSE CHSP(6)=R(14155.);

          IF R(14171.)=-4 THEN AFDC(6)=0;

          ELSE DO;

             B=0;

             DO J=14159. TO 14170.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(14171.)<0 THEN AFDC(6)=R(14171.);

             ELSE IF B<=0 THEN AFDC(6)=-3;

             ELSE AFDC(6)=R(14171.) * B;

          END;

          IF R(14185.)=-4 THEN FOOD(6)=0;

          ELSE DO;

             B=0;

             DO J=14173. TO 14184.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(14185.)<0 THEN FOOD(6)=R(14185.);

             ELSE IF B<=0 THEN FOOD(6)=-3;

             ELSE FOOD(6)=R(14185.) * B;

          END;

          IF R(14199.)=-4 THEN WELF(6)=0;

          ELSE DO;

             B=0;

             DO J=14187. TO 14198.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(14199.)<0 THEN WELF(6)=R(14199.);

             ELSE IF B<=0 THEN WELF(6)=-3;

             ELSE WELF(6)=R(14199.) * B;

          END;

          IF R(14213.)=-4 THEN PUBLIC(6)=0;

          ELSE DO;

             B=0;

             DO J=14201. TO 14212.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(14213.)<0 THEN PUBLIC(6)=R(14213.);

             ELSE IF B<=0 THEN PUBLIC(6)=-3;

             ELSE PUBLIC(6)=R(14213.) * B;

          END;

          IF R(14218.)=-4 THEN ED(6)=0;

          ELSE ED(6)=R(14218.);

          IF R(14219.)=-4 THEN EDSS(6)=0;

          ELSE EDSS(6)=R(14219.);

          IF R(14221.)=-4 THEN VET(6)=0;

          ELSE VET(6)=R(14221.);

          IF R(14225.)=-4 THEN GIFT(6)=0;

          ELSE GIFT(6)=R(14225.);

          IF R(14227.)=-4 THEN OTHER(6)=0;

          ELSE OTHER(6)=R(14227.);

          IF R(14235.)=-4 THEN RELWEL(6)=0;

          ELSE RELWEL(6)=R(14235.);

          IF R(14242.)=-4 THEN RELREG(6)=0;

          ELSE RELREG(6)=R(14242.);

          IF R(14536.)=-4 THEN POVERTY(6)=0;

          ELSE POVERTY(6)=R(14536.);

          FAMILY(6)=FAMSIZE; /* TO CREATE FAMILY SIZE (I.E. FAMSIZE)

                                SEARCH THRU THE HOUSEHOLD ENUMERATION

                                INCREMENT FAMILY SIZE, IF THE

                                RELATIONSHIP TO THE YOUTH IS A RELATIVE.

                                DO NOT INCREASE FAMILY SIZE, IF THE CODE

                                IS <0 OR (>=33 & <=36) OR =45 OR =46 OR

                                (>=50 & <=54) */

1985 VARIABLES

          IF R(18902.)=0 THEN INC(7)=-5;

          ELSE INC(7)=R(18006.);

          END;

          FARM(7)=1;

          LEVEL(7)=-4;

          IF R(17784.)=-4 THEN MIL(7)=0;

          ELSE MIL(7)=R(17784.);

          IF R(17785.)=-4 THEN WPS(7)=0;

          ELSE WPS(7)=R(17785.);

          IF R(17788.)=-4 THEN SEI(7)=0;

          ELSE SEI(7)=R(17788.);

          IF R(17802.)=-4 & R(17803.)=-4 THEN UI(7)=0;

          ELSE IF R(17802.)>0 & R(17803.)>0 THEN UI(7)=R(17802.) * R(17803.);

          ELSE IF R(17803.)<0 THEN UI(7)=R(17803.);

          ELSE UI(7)=-3;

          IF R(17806.)=-4 THEN MILS(7)=0;

          ELSE MILS(7)=R(17806.);

          IF R(17807.)=-4 THEN WPSS(7)=0;

          ELSE WPSS(7)=R(17807.);

          IF R(17810.)=-4 THEN SEIS(7)=0;

          ELSE SEIS(7)=R(17810.);

          IF R(17824.)=-4 & R(17825.)=-4 THEN UIS(7)=0;

          ELSE IF R(17824.)>0 & R(17825.)>0 THEN UIS(7)=R(17824.) * R(17825.);

          ELSE IF R(17825.)<0 THEN UIS(7)=R(17825.);

          ELSE UIS(7)=-3;

          IF R(17828.)=-4 THEN ALIM(7)=0;

          ELSE ALIM(7)=R(17828.);

          IF R(17833.)=-4 THEN CHSP(7)=0;

          ELSE CHSP(7)=R(17833.);

          IF R(17849.)=-4 THEN AFDC(7)=0;

          ELSE DO;

             B=0;

             DO J=17837. TO 17848.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(17849.)<0 THEN AFDC(7)=R(17849.);

             ELSE IF B<=0 THEN AFDC(7)=-3;

             ELSE AFDC(7)=R(17849.) * B;

          END;

          IF R(17863.)=-4 THEN FOOD(7)=0;

          ELSE DO;

             B=0;

             DO J=17851. TO 17862.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(17863.)<0 THEN FOOD(7)=R(17863.);

             ELSE IF B<=0 THEN FOOD(7)=-3;

             ELSE FOOD(7)=R(17863.) * B;

          END;

          IF R(17877.)=-4 THEN PUBLIC(7)=0;

          ELSE DO;

             B=0;

             DO J=17865. TO 17876.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(17877.)<0 THEN PUBLIC(7)=R(17877.);

             ELSE IF B<=0 THEN PUBLIC(7)=-3;

             ELSE PUBLIC(7)=R(17877.) * B;

          END;

          IF R(17882.)=-4 THEN ED(7)=0;

          ELSE ED(7)=R(17882.);

          IF R(17883.)=-4 THEN EDSS(7)=0;

          ELSE EDSS(7)=R(17883.);

          IF R(17885.)=-4 THEN VET(7)=0;

          ELSE VET(7)=R(17885.);

          IF R(17887.)=-4 THEN OTHER(7)=0;

          ELSE OTHER(7)=R(17887.);

          IF R(17895.)=-4 THEN RELWEL(7)=0;

          ELSE RELWEL(7)=R(17895.);

          IF R(17897.)=-4 THEN RELREG(7)=0;

          ELSE RELREG(7)=R(17897.);

          IF R(18008.)=-4 THEN POVERTY(7)=0;

          ELSE POVERTY(7)=R(18008.);

          FAMILY(7)=FAMSZ85; /* TO CREATE FAMILY SIZE (I.E. FAMSZ85)

                                SEARCH THRU THE HOUSEHOLD ENUMERATION

                                INCREMENT FAMILY SIZE, IF THE

                                RELATIONSHIP TO THE YOUTH IS A RELATIVE.

                                DO NOT INCREASE FAMILY SIZE, IF THE CODE

                                IS <0 OR (>=33 & <=36) OR =45 OR =46 OR

                                (>=50 & <=54) */

1986 VARIABLES

          IF R(22573.)=0 THEN INC(8)=-5;

          ELSE INC(8)=R(21622.);

          END;

          FARM(8)=1;

          LEVEL(8)=-4;

          IF R(21415.)=-4 THEN MIL(8)=0;

          ELSE MIL(8)=R(21415.);

          IF R(21416.)=-4 THEN WPS(8)=0;

          ELSE WPS(8)=R(21416.);

          IF R(21419.)=-4 THEN SEI(8)=0;

          ELSE SEI(8)=R(21419.);

          IF R(21433.)=-4 & R(21434.)=-4 THEN UI(8)=0;

          ELSE IF R(21433.)>0 & R(21434.)>0 THEN UI(8)=R(21433.) * R(21434.);

          ELSE IF R(21434.)<0 THEN UI(8)=R(21434.);

          ELSE UI(8)=-3;

          IF R(21437.)=-4 THEN MILS(8)=0;

          ELSE MILS(8)=R(21437.);

          IF R(21438.)=-4 THEN WPSS(8)=0;

          ELSE WPSS(8)=R(21438.);

          IF R(21441.)=-4 THEN SEIS(8)=0;

          ELSE SEIS(8)=R(21441.);

          IF R(21455.)=-4 & R(21456.)=-4 THEN UIS(8)=0;

          ELSE IF R(21455.)>0 & R(21456.)>0 THEN UIS(8)=R(21455.) * R(21456.);

          ELSE IF R(21456.)<0 THEN UIS(8)=R(21456.);

          ELSE UIS(8)=-3;

          IF R(21459.)=-4 THEN ALIM(8)=0;

          ELSE ALIM(8)=R(21459.);

          IF R(21464.)=-4 THEN CHSP(8)=0;

          ELSE CHSP(8)=R(21464.);

          IF R(21480.)=-4 THEN AFDC(8)=0;

          ELSE DO;

             B=0;

             DO J=21468. TO 21479.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(21480.)<0 THEN AFDC(8)=R(21480.);

             ELSE IF B<=0 THEN AFDC(8)=-3;

             ELSE AFDC(8)=R(21480.) * B;

          END;

          IF R(21494.)=-4 THEN FOOD(8)=0;

          ELSE DO;

             B=0;

             DO J=21482. TO 21493.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(21494.)<0 THEN FOOD(8)=R(21494.);

             ELSE IF B<=0 THEN FOOD(8)=-3;

             ELSE FOOD(8)=R(21494.) * B;

          END;

          IF R(21508.)=-4 THEN PUBLIC(8)=0;

          ELSE DO;

             B=0;

             DO J=21496. TO 21507.;

                IF R(J)>0 & B^=NA THEN B=B+1;

                ELSE IF R(J)>-4 & R(J)<0 THEN B=NA;

             END;

             IF R(21508.)<0 THEN PUBLIC(8)=R(21508.);

             ELSE IF B<=0 THEN PUBLIC(8)=-3;

             ELSE PUBLIC(8)=R(21508.) * B;

          END;

          IF R(21513.)=-4 THEN ED(8)=0;

          ELSE ED(8)=R(21513.);

          IF R(21514.)=-4 THEN EDSS(8)=0;

          ELSE EDSS(8)=R(21514.);

          IF R(21516.)=-4 THEN VET(8)=0;

          ELSE VET(8)=R(21516.);

          IF R(21518.)=-4 THEN OTHER(8)=0;

          ELSE OTHER(8)=R(21518.);

          IF R(21526.)=-4 THEN RELWEL(8)=0;

          ELSE RELWEL(8)=R(21526.);

          IF R(21528.)=-4 THEN RELREG(8)=0;

          ELSE RELREG(8)=R(21528.);

          IF R(21624.)=-4 THEN POVERTY(8)=0;

          ELSE POVERTY(8)=R(21624.);

          FAMILY(8)=FAMSZ86; /* TO CREATE FAMILY SIZE (I.E. FAMSZ86)

                                SEARCH THRU THE HOUSEHOLD ENUMERATION

                                INCREMENT FAMILY SIZE, IF THE

                                RELATIONSHIP TO THE YOUTH IS A RELATIVE.

                                DO NOT INCREASE FAMILY SIZE, IF THE CODE

                                IS <0 OR (>=33 & <=36) OR =45 OR =46 OR

                                (>=50 & <=54) */

         DO I=6 TO 8;

            MN(I,1)=0; MN(I,2)=0; MN(I,3)=0;

            FAMINC(I)=0;

            DO K=MIL(I),MILS(I),WPS(I),WPSS(I),SEI(I),SEIS(I),UI(I),

                 UIS(I),ALIM(I),CHSP(I),AFDC(I),FOOD(I),WELF(I),

                 PUBLIC(I),ED(I),EDSS(I),VET(I),GIFT(I),OTHER(I),

                 RELWEL(I),RELREG(I);

                 IF K>-4 THEN DO;

                    IF K<0 THEN MN(I,ABS(K))=MN(I,ABS(K))+1;

                    ELSE FAMINC(I)=FAMINC(I) + K;

                 END;

            END;

            SUMN(I)=MN(I,1) + MN(I,2) + MN(I,3);

            INCOME(I)=-3;

            IF INC(I)=-5 THEN DO;

               INCOME(I)=-5; CPS(I)=-5;

            END;

            ELSE IF INC(I)^=-4 THEN DO;

               INCOME(I)=INC(I);

               IF INC(I)<0 THEN DO;

                   MN(I,ABS(INC(I)))=1;

                   SUMN(I)=1;

               END;

            END;

            ELSE DO;

               IF SUMN(I)=0 THEN INCOME(I)=FAMINC(I);

               ELSE DO J=1 TO 3;

                   IF MN(I,J)>0 THEN INCOME(I)=-J;

               END;

            END;

            IF FAMILY(I)>0 THEN DO;

                LEVEL(I)=TABLE(I,S(I),FAMILY(I));

                IF INC(I)>LEVEL(I) ! FAMINC(I)>LEVEL(I) THEN CPS(I)=0;

                ELSE IF INC(I)>=0 ! (SUMN(I)=0 & INC(I)=-4)

                     THEN CPS(I)=1;

                ELSE IF POVERTY(I)>0 THEN CPS(I)=POVERTY(I)-1;

                ELSE CPS(I)=-3;

            END;

            ELSE IF CPS(I)^=-5 THEN DO;

                ELSE IF POVERTY(I)>0 THEN CPS(I)=POVERTY(I)-1;

                ELSE CPS(I)=-3;

            END;

        END;

 INCOME(6)=R(15197.);

 CPS(6)=R(15198.);

 INCOME(7)=R(18904.);

 CPS(7)=R(18905.);

 INCOME(8)=R(22575.);

 CPS(8)=R(22576.);

1987 VARIABLES

          DCL

           1 FAMILY_INCOME (9),

             5 AFDC,

             5 ALIM,

             5 CHSP,

             5 CPS,

             5 ED,

             5 EDSS,

             5 FAMILY,

             5 FAMINC,

             5 FAMINC_CENSUS,

             5 FARM,

             5 FOOD,

             5 GIFT,

             5 INC,

             5 INCOME,

             5 INCOME_CENSUS,

             5 LEVEL,

             5 MIL,

             5 MILS,

             5 MN (3),

             5 MN_CENSUS (3),

             5 OTHER,

             5 POVERTY,

             5 PUBLIC,

             5 RELREG,

             5 RELWEL,

             5 S,

             5 SEI,

             5 SEIS,

             5 SUMN,

             5 SUMN_CENSUS,

             5 TABLE(3,15),

             5 UI,

             5 UIS,

             5 VET,

             5 WELF,

             5 WPS,

             5 WPSS;

          /* 1987 POVERTY INCOME GUIDELINES TABLE */

          IF R(23502.)=-4 THEN MIL(9)=0;

          ELSE MIL(9)=R(23502.);

          IF R(23503.)=-4 THEN WPS(9)=0;

          ELSE WPS(9)=R(23503.);

          IF R(23506.)=-4 THEN SEI(9)=0;

          ELSE SEI(9)=R(23506.);

          IF R(23520.)=-4 & R(23521.)=-4 THEN UI(9)=0;

          ELSE IF R(23520.)>0 & R(23521.)>0 THEN UI(9)=R(23520.) * R(23521.);

          ELSE IF R(23521.)<0 THEN UI(9)=R(23521.);

          ELSE UI(9)=-3;

          IF R(23524.)=-4 THEN MILS(9)=0;

          ELSE MILS(9)=R(23524.);

          IF R(23525.)=-4 THEN WPSS(9)=0;

          ELSE WPSS(9)=R(23525.);

          IF R(23528.)=-4 THEN SEIS(9)=0;

          ELSE SEIS(9)=R(23528.);

          IF R(23542.)=-4 & R(23543.)=-4 THEN UIS(9)=0;

          ELSE IF R(23542.)>0 & R(23543.)>0 THEN UIS(9)=R(23542.) * R(23543.);

          ELSE IF R(23543.)<0 THEN UIS(9)=R(23543.);

          ELSE UIS(9)=-3;

          IF R(23546.)=-4 THEN ALIM(9)=0;

          ELSE ALIM(9)=R(23546.);

          IF R(23551.)=-4 THEN CHSP(9)=0;

          ELSE CHSP(9)=R(23551.);

          IF R(23567.)=-4 THEN AFDC(9)=0;

          ELSE DO;

             B=0;

                IF R(23555.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23555.)>-4 & R(23555.)<0 THEN B=NA;

                IF R(23556.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23556.)>-4 & R(23556.)<0 THEN B=NA;

                IF R(23557.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23557.)>-4 & R(23557.)<0 THEN B=NA;

                IF R(23558.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23558.)>-4 & R(23558.)<0 THEN B=NA;

                IF R(23559.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23559.)>-4 & R(23559.)<0 THEN B=NA;

                IF R(23560.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23560.)>-4 & R(23560.)<0 THEN B=NA;

                IF R(23561.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23561.)>-4 & R(23561.)<0 THEN B=NA;

                IF R(23562.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23562.)>-4 & R(23562.)<0 THEN B=NA;

                IF R(23563.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23563.)>-4 & R(23563.)<0 THEN B=NA;

                IF R(23564.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23564.)>-4 & R(23564.)<0 THEN B=NA;

                IF R(23565.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23565.)>-4 & R(23565.)<0 THEN B=NA;

                IF R(23566.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23566.)>-4 & R(23566.)<0 THEN B=NA;

             IF R(23567.)<0 THEN AFDC(9)=R(23567.);

             ELSE IF B<=0 THEN AFDC(9)=-3;

             ELSE AFDC(9)=R(23567.) * B;

          END;

          IF R(23581.)=-4 THEN FOOD(9)=0;

          ELSE DO;

             B=0;

                IF R(23569.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23569.)>-4 & R(23569.)<0 THEN B=NA;

                IF R(23570.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23570.)>-4 & R(23570.)<0 THEN B=NA;

                IF R(23571.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23571.)>-4 & R(23571.)<0 THEN B=NA;

                IF R(23572.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23572.)>-4 & R(23572.)<0 THEN B=NA;

                IF R(23573.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23573.)>-4 & R(23573.)<0 THEN B=NA;

                IF R(23574.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23574.)>-4 & R(23574.)<0 THEN B=NA;

                IF R(23575.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23575.)>-4 & R(23575.)<0 THEN B=NA;

                IF R(23576.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23576.)>-4 & R(23576.)<0 THEN B=NA;

                IF R(23577.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23577.)>-4 & R(23577.)<0 THEN B=NA;

                IF R(23578.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23578.)>-4 & R(23578.)<0 THEN B=NA;

                IF R(23579.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23579.)>-4 & R(23579.)<0 THEN B=NA;

                IF R(23580.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23580.)>-4 & R(23580.)<0 THEN B=NA;

             IF R(23581.)<0 THEN FOOD(9)=R(23581.);

             ELSE IF B<=0 THEN FOOD(9)=-3;

             ELSE FOOD(9)=R(23581.) * B;

          END;

          IF R(23595.)=-4 THEN PUBLIC(9)=0;

          ELSE DO;

             B=0;

                IF R(23583.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23583.)>-4 & R(23583.)<0 THEN B=NA;

                IF R(23584.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23584.)>-4 & R(23584.)<0 THEN B=NA;

                IF R(23585.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23585.)>-4 & R(23585.)<0 THEN B=NA;

                IF R(23586.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23586.)>-4 & R(23586.)<0 THEN B=NA;

                IF R(23587.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23587.)>-4 & R(23587.)<0 THEN B=NA;

                IF R(23588.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23588.)>-4 & R(23588.)<0 THEN B=NA;

                IF R(23589.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23589.)>-4 & R(23589.)<0 THEN B=NA;

                IF R(23590.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23590.)>-4 & R(23590.)<0 THEN B=NA;

                IF R(23591.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23591.)>-4 & R(23591.)<0 THEN B=NA;

                IF R(23592.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23592.)>-4 & R(23592.)<0 THEN B=NA;

                IF R(23593.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23593.)>-4 & R(23593.)<0 THEN B=NA;

                IF R(23594.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(23594.)>-4 & R(23594.)<0 THEN B=NA;

             IF R(23595.)<0 THEN PUBLIC(9)=R(23595.);

             ELSE IF B<=0 THEN PUBLIC(9)=-3;

             ELSE PUBLIC(9)=R(23595.) * B;

          END;

          IF R(23600.)=-4 THEN ED(9)=0;

          ELSE ED(9)=R(23600.);

          IF R(23601.)=-4 THEN EDSS(9)=0;

          ELSE EDSS(9)=R(23601.);

          IF R(23603.)=-4 THEN VET(9)=0;

          ELSE VET(9)=R(23603.);

          IF R(23605.)=-4 THEN OTHER(9)=0;

          ELSE OTHER(9)=R(23605.);

          IF VET(9)>0 & OTHER(9)=VET(9) THEN OTHER(9)=0;

          IF R(23612.)=-4 THEN RELWEL(9)=0;

          ELSE RELWEL(9)=R(23612.);

          IF R(23614.)=-4 THEN RELREG(9)=0;

          ELSE RELREG(9)=R(23614.);

          FAMILY(9)=FAMSZ87; /* TO CREATE FAMILY SIZE (I.E. FAMSZ87)

                                SEARCH THRU THE HOUSEHOLD ENUMERATION

                                INCREMENT FAMILY SIZE, IF THE

                                RELATIONSHIP TO THE YOUTH IS A RELATIVE.

                                DO NOT INCREASE FAMILY SIZE, IF THE CODE

                                IS <0 OR (>=33 & <=36) OR =45 OR =46 OR

                                (>=50 & <=54) */

         DCL COMPONENT(19) FIXED DEC(9);

         DO I=9;

            MN(I,1)=0; MN(I,2)=0; MN(I,3)=0;

            MN_CENSUS(I,1)=0; MN_CENSUS(I,2)=0; MN_CENSUS(I,3)=0;

            FAMINC(I)=0;

            FAMINC_CENSUS(I)=0;

            INCOME(I)=-3;

            INCOME_CENSUS(I)=-3;

            COMPONENT(1)=MIL(I);

            COMPONENT(2)=MILS(I);

            COMPONENT(3)=WPS(I);

            COMPONENT(4)=WPSS(I);

            COMPONENT(5)=SEI(I);

            COMPONENT(6)=SEIS(I);

            COMPONENT(7)=UI(I);

            COMPONENT(8)=UIS(I);

            COMPONENT(9)=ALIM(I);

            COMPONENT(10)=CHSP(I);

            COMPONENT(11)=AFDC(I);

            COMPONENT(12)=PUBLIC(I);

            COMPONENT(13)=ED(I);

            COMPONENT(14)=EDSS(I);

            COMPONENT(15)=VET(I);

            COMPONENT(16)=OTHER(I);

            COMPONENT(17)=RELWEL(I);

            COMPONENT(18)=RELREG(I);

            COMPONENT(19)=FOOD(I);

            IF WEIGHT(I)=0 THEN DO;

               INCOME(I)=-5;

               INCOME_CENSUS(I)=-5;

               CPS(I)=-5;

               LEVEL(I)=-5;

            END;

            ELSE DO;

                 DO K=1 TO 19;

                    IF COMPONENT(K)>-4 THEN DO;

                       IF COMPONENT(K)<0 THEN

                          MN(I,ABS(COMPONENT(K)))=MN(I,ABS(COMPONENT(K)))+1;

                       ELSE FAMINC(I)=FAMINC(I)+COMPONENT(K);

                     END;

                 IF K<19 THEN DO;

                       IF COMPONENT(K)<0 THEN

                          MN_CENSUS(I,ABS(COMPONENT(K)))=

                             MN_CENSUS(I,ABS(COMPONENT(K)))+1;

                       ELSE FAMINC_CENSUS(I)=FAMINC_CENSUS(I)+COMPONENT(K);

                     END;

                  END;

               SUMN(I)=MN(I,1) + MN(I,2) + MN(I,3);

               SUMN_CENSUS(I)=MN_CENSUS(I,1) + MN_CENSUS(I,2) +

                              MN_CENSUS(I,3);

               IF SUMN(I)=0 THEN INCOME(I)=FAMINC(I);

               ELSE DO J=1 TO 3;

                   IF MN(I,J)>0 THEN INCOME(I)=-J;

               END;

               IF SUMN_CENSUS(I)=0 THEN INCOME_CENSUS(I)=FAMINC_CENSUS(I);

               ELSE DO J=1 TO 3;

                   IF MN_CENSUS(I,J)>0 THEN INCOME_CENSUS(I)=-J;

               END;

            IF FAMILY(I)>0 THEN DO;

                LEVEL(I)=TABLE(I,S(I),FAMILY(I));

                IF INCOME(I)>LEVEL(I) THEN CPS(I)=0;

                ELSE IF INCOME(I)>= 0 & INCOME(I)<=LEVEL(I) THEN CPS(I)=1;

                ELSE CPS(I)=-3;

            END;

          END;

        END;

   DO I=1 TO 3;

      IF MN(9,I)>0 THEN MN(9,I)=1;

      IF MN_CENSUS(9,I)>0 THEN MN_CENSUS(9,I)=1;

   END;

   IF SUMN(9)>0 THEN SUMN(9)=1;

   IF SUMN_CENSUS(9)>0 THEN SUMN_CENSUS(9)=1;

 INCOME(9)=R(24447.);

 INCOME_CENSUS(9)=R(24448.);

 CPS(9)=R(24449.);

 LEVEL(9)=R(24450.);

1988 VARIABLES

         DCL

           1 FAMILY_INCOME (10),

             5 (AFDC,

                ALIM,

                CHSP,

                CPS,

                ED,

                EDSS,

                FAMILY,

                FAMINC,

                FOOD,

                INCOME,

                LEVEL,

                MIL,

                MILS,

                MN (3),

                OTHER,

                PUBLIC,

                RELREG,

                RELWEL,

                S,

                SEI,

                SEIS,

                SUMN,

                TABLE(3,15),

                UI,

                UIS,

                VET,

                WPS,

                WPSS) FIXED DEC(9);

    /* 1988 POVERTY INCOME GUIDELINES TABLE */

 

          IF R(27224.)=-4 THEN MIL(10)=0;

          ELSE MIL(10)=R(27224.);

          IF R(27225.)=-4 THEN WPS(10)=0;

          ELSE WPS(10)=R(27225.);

          IF R(27228.)=-4 THEN SEI(10)=0;

          ELSE SEI(10)=R(27228.);

          IF R(27242.)=-4 & R(27243.)=-4 THEN UI(10)=0;

          ELSE IF R(27242.)>0 & R(27243.)>0 THEN UI(10)=R(27242.) * R(27243.);

          ELSE IF R(27243.)<0 THEN UI(10)=R(27243.);

          ELSE UI(10)=-3;

          IF R(27246.)=-4 THEN MILS(10)=0;

          ELSE MILS(10)=R(27246.);

          IF R(27247.)=-4 THEN WPSS(10)=0;

          ELSE WPSS(10)=R(27247.);

          IF R(27250.)=-4 THEN SEIS(10)=0;

          ELSE SEIS(10)=R(27250.);

          IF R(27264.)=-4 & R(27265.)=-4 THEN UIS(10)=0;

          ELSE IF R(27264.)>0 & R(27265.)>0 THEN UIS(10)=R(27264.)*R(27265.);

          ELSE IF R(27265.)<0 THEN UIS(10)=R(27265.);

          ELSE UIS(10)=-3;

          IF R(27268.)=-4 THEN ALIM(10)=0;

          ELSE ALIM(10)=R(27268.);

          IF R(27273.)=-4 THEN CHSP(10)=0;

          ELSE CHSP(10)=R(27273.);

          IF R(27289.)=-4 THEN AFDC(10)=0;

          ELSE DO;

             B=0;

                IF R(27277.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27277.)>-4 & R(27277.)<0 THEN B=NA;

                IF R(27278.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27278.)>-4 & R(27278.)<0 THEN B=NA;

                IF R(27279.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27279.)>-4 & R(27279.)<0 THEN B=NA;

                IF R(27280.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27280.)>-4 & R(27280.)<0 THEN B=NA;

                IF R(27281.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27281.)>-4 & R(27281.)<0 THEN B=NA;

                IF R(27282.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27282.)>-4 & R(27282.)<0 THEN B=NA;

                IF R(27283.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27283.)>-4 & R(27283.)<0 THEN B=NA;

                IF R(27284.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27284.)>-4 & R(27284.)<0 THEN B=NA;

                IF R(27285.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27285.)>-4 & R(27285.)<0 THEN B=NA;

                IF R(27286.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27286.)>-4 & R(27286.)<0 THEN B=NA;

                IF R(27287.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27287.)>-4 & R(27287.)<0 THEN B=NA;

                IF R(27288.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27288.)>-4 & R(27288.)<0 THEN B=NA;

             IF R(27289.)<0 THEN AFDC(10)=R(27289.);

             ELSE IF B<=0 THEN AFDC(10)=-3;

             ELSE AFDC(10)=R(27289.) * B;

          END;

          IF R(27303.)=-4 THEN FOOD(10)=0;

          ELSE DO;

             B=0;

                IF R(27291.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27291.)>-4 & R(27291.)<0 THEN B=NA;

                IF R(27292.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27292.)>-4 & R(27292.)<0 THEN B=NA;

                IF R(27293.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27293.)>-4 & R(27293.)<0 THEN B=NA;

                IF R(27294.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27294.)>-4 & R(27294.)<0 THEN B=NA;

                IF R(27295.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27295.)>-4 & R(27295.)<0 THEN B=NA;

                IF R(27296.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27296.)>-4 & R(27296.)<0 THEN B=NA;

                IF R(27297.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27297.)>-4 & R(27297.)<0 THEN B=NA;

                IF R(27298.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27298.)>-4 & R(27298.)<0 THEN B=NA;

                IF R(27299.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27299.)>-4 & R(27299.)<0 THEN B=NA;

                IF R(27300.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27300.)>-4 & R(27300.)<0 THEN B=NA;

                IF R(27301.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27301.)>-4 & R(27301.)<0 THEN B=NA;

                IF R(27302.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27302.)>-4 & R(27302.)<0 THEN B=NA;

             IF R(27303.)<0 THEN FOOD(10)=R(27303.);

             ELSE IF B<=0 THEN FOOD(10)=-3;

             ELSE FOOD(10)=R(27303.) * B;

          END;

          IF R(27317.)=-4 THEN PUBLIC(10)=0;

          ELSE DO;

             B=0;

                IF R(27305.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27305.)>-4 & R(27305.)<0 THEN B=NA;

                IF R(27306.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27306.)>-4 & R(27306.)<0 THEN B=NA;

                IF R(27307.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27307.)>-4 & R(27307.)<0 THEN B=NA;

                IF R(27308.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27308.)>-4 & R(27308.)<0 THEN B=NA;

                IF R(27309.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27309.)>-4 & R(27309.)<0 THEN B=NA;

                IF R(27310.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27310.)>-4 & R(27310.)<0 THEN B=NA;

                IF R(27311.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27311.)>-4 & R(27311.)<0 THEN B=NA;

                IF R(27312.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27312.)>-4 & R(27312.)<0 THEN B=NA;

                IF R(27313.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27313.)>-4 & R(27313.)<0 THEN B=NA;

                IF R(27314.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27314.)>-4 & R(27314.)<0 THEN B=NA;

                IF R(27315.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27315.)>-4 & R(27315.)<0 THEN B=NA;

                IF R(27316.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(27316.)>-4 & R(27316.)<0 THEN B=NA;

             IF R(27317.)<0 THEN PUBLIC(10)=R(27317.);

             ELSE IF B<=0 THEN PUBLIC(10)=-3;

             ELSE PUBLIC(10)=R(27317.) * B;

          END;

          IF R(27322.)=-4 THEN ED(10)=0;

          ELSE ED(10)=R(27322.);

          IF R(27323.)=-4 THEN EDSS(10)=0;

          ELSE EDSS(10)=R(27323.);

          IF R(27325.)=-4 THEN VET(10)=0;

          ELSE VET(10)=R(27325.);

          IF R(27332.)=-4 THEN OTHER(10)=0;

          ELSE OTHER(10)=R(27332.);

          IF VET(10)>0 & OTHER(10)=VET(10) THEN OTHER(10)=0;

          IF R(27339.)=-4 THEN RELWEL(10)=0;

          ELSE RELWEL(10)=R(27339.);

          IF R(27341.)=-4 THEN RELREG(10)=0;

          ELSE RELREG(10)=R(27341.);

          FAMILY(10)=FAMSZ88; /* TO CREATE FAMILY SIZE (I.E. FAMSZ88)

                                SEARCH THRU THE HOUSEHOLD ENUMERATION

                                INCREMENT FAMILY SIZE, IF THE

                                RELATIONSHIP TO THE YOUTH IS A RELATIVE.

                                DO NOT INCREASE FAMILY SIZE, IF THE CODE

                                IS <0 OR (>=33 & <=36) OR =45 OR =46 OR

                                (>=50 & <=54) */

         DCL COMPONENT(19) FIXED DEC(9);

         DO I=10;

            MN(I,1)=0; MN(I,2)=0; MN(I,3)=0;

            FAMINC(I)=0;

            INCOME(I)=-3;

            COMPONENT(1)=MIL(I);

            COMPONENT(2)=MILS(I);

            COMPONENT(3)=WPS(I);

            COMPONENT(4)=WPSS(I);

            COMPONENT(5)=SEI(I);

            COMPONENT(6)=SEIS(I);

            COMPONENT(7)=UI(I);

            COMPONENT(8)=UIS(I);

            COMPONENT(9)=ALIM(I);

            COMPONENT(10)=CHSP(I);

            COMPONENT(11)=AFDC(I);

            COMPONENT(12)=PUBLIC(I);

            COMPONENT(13)=ED(I);

            COMPONENT(14)=EDSS(I);

            COMPONENT(15)=VET(I);

            COMPONENT(16)=OTHER(I);

            COMPONENT(17)=RELWEL(I);

            COMPONENT(18)=RELREG(I);

            COMPONENT(19)=FOOD(I);

            IF WEIGHT(I)=0 THEN DO;

               INCOME(I)=-5;

               CPS(I)=-5;

               LEVEL(I)=-5;

            END;

            ELSE DO;

                 DO K=1 TO 19;

                    IF COMPONENT(K)>-4 THEN DO;

                       IF COMPONENT(K)<0 THEN

                          MN(I,ABS(COMPONENT(K)))=MN(I,ABS(COMPONENT(K)))+1;

                       ELSE FAMINC(I)=FAMINC(I)+COMPONENT(K);

                     END;

                  END;

               SUMN(I)=MN(I,1) + MN(I,2) + MN(I,3);

               IF SUMN(I)=0 THEN INCOME(I)=FAMINC(I);

               ELSE DO J=1 TO 3;

                   IF MN(I,J)>0 THEN INCOME(I)=-J;

               END;

            IF FAMILY(I)>0 THEN DO;

                LEVEL(I)=TABLE(I,S(I),FAMILY(I));

                IF INCOME(I)>LEVEL(I) THEN CPS(I)=0;

                ELSE IF INCOME(I)>= 0 & INCOME(I)<=LEVEL(I) THEN CPS(I)=1;

                ELSE CPS(I)=-3;

            END;

          END;

        END;

   DO I=1 TO 3;

      IF MN(10,I)>0 THEN MN(10,I)=1;

   END;

   IF SUMN(10)>0 THEN SUMN(10)=1;

INCOME(10)=R(28702.);

CPS(10)=R(28704.);

LEVEL(10)=R(28705.);

1989 VARIABLES

         DCL

           1 FAMILY_INCOME (11),

             5 (AFDC,

                ALIM,

                CHSP,

                CPS,

                ED,

                EDSS,

                FAMILY,

                FAMINC,

                FOOD,

                INCOME,

                LEVEL,

                MIL,

                MILS,

                MN (3),

                OTHER,

                PUBLIC,

                RELREG,

                RELWEL,

                S,

                SEI,

                SEIS,

                SUMN,

                TABLE(3,15),

                UI,

                UIS,

                VET,

                WPS,

                WPSS) FIXED DEC(9);

    /* 1989 POVERTY INCOME GUIDELINES TABLE */

 

          IF R(29713.)=-4 THEN MIL(11)=0;

          ELSE MIL(11)=R(29713.);

          IF R(29714.)=-4 THEN WPS(11)=0;

          ELSE WPS(11)=R(29714.);

          IF R(29717.)=-4 THEN SEI(11)=0;

          ELSE SEI(11)=R(29717.);

          IF R(29731.)=-4 & R(29732.)=-4 THEN UI(11)=0;

          ELSE IF R(29731.)>0 & R(29732.)>0 THEN UI(11)=R(29731.) * R(29732.);

          ELSE IF R(29732.)<0 THEN UI(11)=R(29732.);

          ELSE UI(11)=-3;

          IF R(29735.)=-4 THEN MILS(11)=0;

          ELSE MILS(11)=R(29735.);

          IF R(29736.)=-4 THEN WPSS(11)=0;

          ELSE WPSS(11)=R(29736.);

          IF R(29739.)=-4 THEN SEIS(11)=0;

          ELSE SEIS(11)=R(29739.);

          IF R(29753.)=-4 & R(29754.)=-4 THEN UIS(11)=0;

          ELSE IF R(29753.)>0 & R(29754.)>0 THEN UIS(11)=R(29753.) * R(29754.);

          ELSE IF R(29754.)<0 THEN UIS(11)=R(29754.);

          ELSE UIS(11)=-3;

          IF R(29757.)=-4 THEN ALIM(11)=0;

          ELSE ALIM(11)=R(29757.);

          IF R(29759.)=-4 THEN CHSP(11)=0;

          ELSE CHSP(11)=R(29759.);

          IF R(29773.)=-4 THEN AFDC(11)=0;

          ELSE DO;

             B=0;

                IF R(29761.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29761.)>-4 & R(29761.)<0 THEN B=NA;

                IF R(29762.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29762.)>-4 & R(29762.)<0 THEN B=NA;

                IF R(29763.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29763.)>-4 & R(29763.)<0 THEN B=NA;

                IF R(29764.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29764.)>-4 & R(29764.)<0 THEN B=NA;

                IF R(29765.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29765.)>-4 & R(29765.)<0 THEN B=NA;

                IF R(29766.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29766.)>-4 & R(29766.)<0 THEN B=NA;

                IF R(29767.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29767.)>-4 & R(29767.)<0 THEN B=NA;

                IF R(29768.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29768.)>-4 & R(29768.)<0 THEN B=NA;

                IF R(29769.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29769.)>-4 & R(29769.)<0 THEN B=NA;

                IF R(29770.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29770.)>-4 & R(29770.)<0 THEN B=NA;

                IF R(29771.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29771.)>-4 & R(29771.)<0 THEN B=NA;

                IF R(29772.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29772.)>-4 & R(29772.)<0 THEN B=NA;

             IF R(29773.)<0 THEN AFDC(11)=R(29773.);

             ELSE IF B<=0 THEN AFDC(11)=-3;

             ELSE AFDC(11)=R(29773.) * B;

          END;

          IF R(29787.)=-4 THEN FOOD(11)=0;

          ELSE DO;

             B=0;

                IF R(29775.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29775.)>-4 & R(29775.)<0 THEN B=NA;

                IF R(29776.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29776.)>-4 & R(29776.)<0 THEN B=NA;

                IF R(29777.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29777.)>-4 & R(29777.)<0 THEN B=NA;

                IF R(29778.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29778.)>-4 & R(29778.)<0 THEN B=NA;

                IF R(29779.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29779.)>-4 & R(29779.)<0 THEN B=NA;

                IF R(29780.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29780.)>-4 & R(29780.)<0 THEN B=NA;

                IF R(29781.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29781.)>-4 & R(29781.)<0 THEN B=NA;

                IF R(29782.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29782.)>-4 & R(29782.)<0 THEN B=NA;

                IF R(29783.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29783.)>-4 & R(29783.)<0 THEN B=NA;

                IF R(29784.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29784.)>-4 & R(29784.)<0 THEN B=NA;

                IF R(29785.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29785.)>-4 & R(29785.)<0 THEN B=NA;

                IF R(29786.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29786.)>-4 & R(29786.)<0 THEN B=NA;

             IF R(29787.)<0 THEN FOOD(11)=R(29787.);

             ELSE IF B<=0 THEN FOOD(11)=-3;

             ELSE FOOD(11)=R(29787.) * B;

          END;

          IF R(29801.)=-4 THEN PUBLIC(11)=0;

          ELSE DO;

             B=0;

                IF R(29789.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29789.)>-4 & R(29789.)<0 THEN B=NA;

                IF R(29790.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29790.)>-4 & R(29790.)<0 THEN B=NA;

                IF R(29791.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29791.)>-4 & R(29791.)<0 THEN B=NA;

                IF R(29792.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29792.)>-4 & R(29792.)<0 THEN B=NA;

                IF R(29793.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29793.)>-4 & R(29793.)<0 THEN B=NA;

                IF R(29794.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29794.)>-4 & R(29794.)<0 THEN B=NA;

                IF R(29795.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29795.)>-4 & R(29795.)<0 THEN B=NA;

                IF R(29796.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29796.)>-4 & R(29796.)<0 THEN B=NA;

                IF R(29797.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29797.)>-4 & R(29797.)<0 THEN B=NA;

                IF R(29798.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29798.)>-4 & R(29798.)<0 THEN B=NA;

                IF R(29799.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29799.)>-4 & R(29799.)<0 THEN B=NA;

                IF R(29800.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(29800.)>-4 & R(29800.)<0 THEN B=NA;

             IF R(29801.)<0 THEN PUBLIC(11)=R(29801.);

             ELSE IF B<=0 THEN PUBLIC(11)=-3;

             ELSE PUBLIC(11)=R(29801.) * B;

          END;

          IF R(29806.)=-4 THEN ED(11)=0;

          ELSE ED(11)=R(29806.);

          IF R(29807.)=-4 THEN EDSS(11)=0;

          ELSE EDSS(11)=R(29807.);

          IF R(29809.)=-4 THEN VET(11)=0;

          ELSE VET(11)=R(29809.);

          IF R(29813.)=-4 THEN OTHER(11)=0;

          ELSE OTHER(11)=R(29813.);

          IF VET(11)>0 & OTHER(11)=VET(11) THEN OTHER(11)=0;

          IF R(29820.)=-4 THEN RELWEL(11)=0;

          ELSE RELWEL(11)=R(29820.);

          IF R(29822.)=-4 THEN RELREG(11)=0;

          ELSE RELREG(11)=R(29822.);

          FAMILY(11)=FAMSZ89; /* TO CREATE FAMILY SIZE (I.E. FAMSZ89)

                                SEARCH THRU THE HOUSEHOLD ENUMERATION

                                INCREMENT FAMILY SIZE, IF THE

                                RELATIONSHIP TO THE YOUTH IS A RELATIVE.

                                DO NOT INCREASE FAMILY SIZE, IF THE CODE

                                IS <0 OR (>=33 & <=36) OR =45 OR =46 OR

                                (>=50 & <=54) */

         DCL COMPONENT(19) FIXED DEC(9);

         DO I=11;

            MN(I,1)=0; MN(I,2)=0; MN(I,3)=0;

            FAMINC(I)=0;

            INCOME(I)=-3;

            COMPONENT(1)=MIL(I);

            COMPONENT(2)=MILS(I);

            COMPONENT(3)=WPS(I);

            COMPONENT(4)=WPSS(I);

            COMPONENT(5)=SEI(I);

            COMPONENT(6)=SEIS(I);

            COMPONENT(7)=UI(I);

            COMPONENT(8)=UIS(I);

            COMPONENT(9)=ALIM(I);

            COMPONENT(10)=CHSP(I);

            COMPONENT(11)=AFDC(I);

            COMPONENT(12)=PUBLIC(I);

            COMPONENT(13)=ED(I);

            COMPONENT(14)=EDSS(I);

            COMPONENT(15)=VET(I);

            COMPONENT(16)=OTHER(I);

            COMPONENT(17)=RELWEL(I);

            COMPONENT(18)=RELREG(I);

            COMPONENT(19)=FOOD(I);

            IF WEIGHT(I)=0 THEN DO;

               INCOME(I)=-5;

               CPS(I)=-5;

               LEVEL(I)=-5;

            END;

            ELSE DO;

                 DO K=1 TO 19;

                    IF COMPONENT(K)>-4 THEN DO;

                       IF COMPONENT(K)<0 THEN

                          MN(I,ABS(COMPONENT(K)))=MN(I,ABS(COMPONENT(K)))+1;

                       ELSE FAMINC(I)=FAMINC(I)+COMPONENT(K);

                     END;

                  END;

               SUMN(I)=MN(I,1) + MN(I,2) + MN(I,3);

               IF SUMN(I)=0 THEN INCOME(I)=FAMINC(I);

               ELSE DO J=1 TO 3;

                   IF MN(I,J)>0 THEN INCOME(I)=-J;

               END;

            IF FAMILY(I)>0 THEN DO;

                LEVEL(I)=TABLE(I,S(I),FAMILY(I));

                IF INCOME(I)>LEVEL(I) THEN CPS(I)=0;

                ELSE IF INCOME(I)>= 0 & INCOME(I)<=LEVEL(I) THEN CPS(I)=1;

                ELSE CPS(I)=-3;

            END;

          END;

        END;

   DO I=1 TO 3;

      IF MN(11,I)>0 THEN MN(11,I)=1;

   END;

   IF SUMN(11)>0 THEN SUMN(11)=1;

 INCOME(11)=R(30740);

 CPS(11)=R(30741);

 LEVEL(11)=R(30742);

1990 VARIABLES

           DO I=12;

                AFDC(I)=-4;

                ALIM(I)=-4;

                CHSP(I)=-4;

                CPS(I)=-4;

                ED(I)=-4;

                EDSS(I)=-4;

                FAMILY(I)=-4;

                FAMINC(I)=-4;

                FOOD(I)=-4;

                INCOME(I)=-4;

                LEVEL(I)=-4;

                MIL(I)=-4;

                MILS(I)=-4;

                DO J=1 TO 3;

                   MN(I,J)=-4;

                END;

                OTHER(I)=-4;

                PUBLIC(I)=-4;

                RELREG(I)=-4;

                RELWEL(I)=-4;

                S(I)=-4;

                SEI(I)=-4;

                SEIS(I)=-4;

                SUMN(I)=-4;

                DO J=1 TO 3;

                   DO K=1 TO 15;

                     TABLE(I,J,K)=-4;

                   END;

                END;

                UI(I)=-4;

                UIS(I)=-4;

                VET(I)=-4;

                WPS(I)=-4;

                WPSS(I)=-4;

          END;

          IF R(32793.)=-4 THEN MIL(12)=0;

          ELSE MIL(12)=R(32793.);

          IF R(32794.)=-4 THEN WPS(12)=0;

          ELSE WPS(12)=R(32794.);

          IF R(32797.)=-4 THEN SEI(12)=0;

          ELSE SEI(12)=R(32797.);

          IF R(32811.)=-4 & R(32812.)=-4 THEN UI(12)=0;

          ELSE IF R(32811.)>0 & R(32812.)>0 THEN UI(12)=R(32811.) * R(32812.);

          ELSE IF R(32812.)<0 THEN UI(12)=R(32812.);

          ELSE UI(12)=-3;

          IF R(32815.)=-4 THEN MILS(12)=0;

          ELSE MILS(12)=R(32815.);

          IF R(32816.)=-4 THEN WPSS(12)=0;

          ELSE WPSS(12)=R(32816.);

          IF R(32819.)=-4 THEN SEIS(12)=0;

          ELSE SEIS(12)=R(32819.);

          IF R(32833.)=-4 & R(32834.)=-4 THEN UIS(12)=0;

          ELSE IF R(32833.)>0 & R(32834.)>0 THEN UIS(12)=R(32833.) * R(32834.);

          ELSE IF R(32834.)<0 THEN UIS(12)=R(32834.);

          ELSE UIS(12)=-3;

          IF R(32837.)=-4 THEN ALIM(12)=0;

          ELSE ALIM(12)=R(32837.);

          IF R(32839.)=-4 THEN CHSP(12)=0;

          ELSE CHSP(12)=R(32839.);

          IF R(32853.)=-4 THEN AFDC(12)=0;

          ELSE DO;

             B=0;

                IF R(32841.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32841.)>-4 & R(32841.)<0 THEN B=NA;

                IF R(32842.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32842.)>-4 & R(32842.)<0 THEN B=NA;

                IF R(32843.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32843.)>-4 & R(32843.)<0 THEN B=NA;

                IF R(32844.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32844.)>-4 & R(32844.)<0 THEN B=NA;

                IF R(32845.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32845.)>-4 & R(32845.)<0 THEN B=NA;

                IF R(32846.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32846.)>-4 & R(32846.)<0 THEN B=NA;

                IF R(32847.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32847.)>-4 & R(32847.)<0 THEN B=NA;

                IF R(32848.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32848.)>-4 & R(32848.)<0 THEN B=NA;

                IF R(32849.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32849.)>-4 & R(32849.)<0 THEN B=NA;

                IF R(32850.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32850.)>-4 & R(32850.)<0 THEN B=NA;

                IF R(32851.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32851.)>-4 & R(32851.)<0 THEN B=NA;

                IF R(32852.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32852.)>-4 & R(32852.)<0 THEN B=NA;

             IF R(32853.)<0 THEN AFDC(12)=R(32853.);

             ELSE IF B<=0 THEN AFDC(12)=-3;

             ELSE AFDC(12)=R(32853.) * B;

          END;

          IF R(32867.)=-4 THEN FOOD(12)=0;

          ELSE DO;

             B=0;

                IF R(32855.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32855.)>-4 & R(32855.)<0 THEN B=NA;

                IF R(32856.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32856.)>-4 & R(32856.)<0 THEN B=NA;

                IF R(32857.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32857.)>-4 & R(32857.)<0 THEN B=NA;

                IF R(32858.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32858.)>-4 & R(32858.)<0 THEN B=NA;

                IF R(32859.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32859.)>-4 & R(32859.)<0 THEN B=NA;

                IF R(32860.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32860.)>-4 & R(32860.)<0 THEN B=NA;

                IF R(32861.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32861.)>-4 & R(32861.)<0 THEN B=NA;

                IF R(32862.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32862.)>-4 & R(32862.)<0 THEN B=NA;

                IF R(32863.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32863.)>-4 & R(32863.)<0 THEN B=NA;

                IF R(32864.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32864.)>-4 & R(32864.)<0 THEN B=NA;

                IF R(32865.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32865.)>-4 & R(32865.)<0 THEN B=NA;

                IF R(32866.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32866.)>-4 & R(32866.)<0 THEN B=NA;

             IF R(32867.)<0 THEN FOOD(12)=R(32867.);

             ELSE IF B<=0 THEN FOOD(12)=-3;

             ELSE FOOD(12)=R(32867.) * B;

          END;

          IF R(32893.)=-4 THEN PUBLIC(12)=0;

          ELSE DO;

             B=0;

                IF R(32881.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32881.)>-4 & R(32881.)<0 THEN B=NA;

                IF R(32882.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32882.)>-4 & R(32882.)<0 THEN B=NA;

                IF R(32883.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32883.)>-4 & R(32883.)<0 THEN B=NA;

                IF R(32884.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32884.)>-4 & R(32884.)<0 THEN B=NA;

                IF R(32885.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32885.)>-4 & R(32885.)<0 THEN B=NA;

                IF R(32886.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32886.)>-4 & R(32886.)<0 THEN B=NA;

                IF R(32887.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32887.)>-4 & R(32887.)<0 THEN B=NA;

                IF R(32888.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32888.)>-4 & R(32888.)<0 THEN B=NA;

                IF R(32889.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32889.)>-4 & R(32889.)<0 THEN B=NA;

                IF R(32890.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32890.)>-4 & R(32890.)<0 THEN B=NA;

                IF R(32891.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32891.)>-4 & R(32891.)<0 THEN B=NA;

                IF R(32892.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(32892.)>-4 & R(32892.)<0 THEN B=NA;

             IF R(32893.)<0 THEN PUBLIC(12)=R(32893.);

             ELSE IF B<=0 THEN PUBLIC(12)=-3;

             ELSE PUBLIC(12)=R(32893.) * B;

          END;

          IF R(32900.)=-4 THEN ED(12)=0;

          ELSE ED(12)=R(32900.);

          IF R(32901.)=-4 THEN EDSS(12)=0;

          ELSE EDSS(12)=R(32901.);

          IF R(32902.)=-4 THEN VET(12)=0;

          ELSE VET(12)=R(32902.);

          IF R(32906.)=-4 THEN OTHER(12)=0;

          ELSE OTHER(12)=R(32906.);

          IF VET(12)>0 & OTHER(12)=VET(12) THEN OTHER(12)=0;

          IF R(32916.)=-4 THEN RELWEL(12)=0;

          ELSE RELWEL(12)=R(32916.);

          IF R(32918.)=-4 THEN RELREG(12)=0;

          ELSE RELREG(12)=R(32918.);

          FAMILY(12)=FAMSZ90; /* TO CREATE FAMILY SIZE (I.E. FAMSZ90)

                                SEARCH THRU THE HOUSEHOLD ENUMERATION

                                INCREMENT FAMILY SIZE, IF THE

                                RELATIONSHIP TO THE YOUTH IS A RELATIVE.

                                DO NOT INCREASE FAMILY SIZE, IF THE CODE

                                IS <0 OR (>=33 & <=36) OR =45 OR =46 OR

                                (>=50 & <=54) */

         DCL COMPONENT(19) FIXED DEC(9);

         DO I=12;

            MN(I,1)=0; MN(I,2)=0; MN(I,3)=0;

            FAMINC(I)=0;

            INCOME(I)=-3;

            COMPONENT(1)=MIL(I);  

            COMPONENT(2)=MILS(I);  

            COMPONENT(3)=WPS(I);   

            COMPONENT(4)=WPSS(I);  

            COMPONENT(5)=SEI(I);

            COMPONENT(6)=SEIS(I);  

            COMPONENT(7)=UI(I);    

            COMPONENT(8)=UIS(I);   

            COMPONENT(9)=ALIM(I);  

            COMPONENT(10)=CHSP(I); 

            COMPONENT(11)=AFDC(I); 

            COMPONENT(12)=PUBLIC(I);

            COMPONENT(13)=ED(I);   

            COMPONENT(14)=EDSS(I); 

            COMPONENT(15)=VET(I);  

            COMPONENT(16)=OTHER(I);

            COMPONENT(17)=RELWEL(I);

            COMPONENT(18)=RELREG(I);

            COMPONENT(19)=FOOD(I); 

            IF WEIGHT(I)=0 THEN DO;

               INCOME(I)=-5;

               CPS(I)=-5;

               LEVEL(I)=-5;

            END;

            ELSE DO;

                 DO K=1 TO 19;

                    IF COMPONENT(K)>-4 THEN DO;

                       IF COMPONENT(K)<0 THEN

                          MN(I,ABS(COMPONENT(K)))=MN(I,ABS(COMPONENT(K)))+1;

                       ELSE FAMINC(I)=FAMINC(I)+COMPONENT(K);

                     END;

                  END;  

               SUMN(I)=MN(I,1) + MN(I,2) + MN(I,3);

               IF SUMN(I)=0 THEN INCOME(I)=FAMINC(I);

               ELSE DO J=1 TO 3;

                   IF MN(I,J)>0 THEN INCOME(I)=-J;

               END;

            IF FAMILY(I)>0 THEN DO;

                LEVEL(I)=TABLE(I,S(I),FAMILY(I));

                IF INCOME(I)>LEVEL(I) THEN CPS(I)=0;

                ELSE IF INCOME(I)>= 0 & INCOME(I)<=LEVEL(I) THEN CPS(I)=1;

                ELSE CPS(I)=-3;

            END;

          END;

        END;

   DO I=1 TO 3;

      IF MN(12,I)>0 THEN MN(12,I)=1;

   END;

   IF SUMN(12)>0 THEN SUMN(12)=1;

INCOME(12)=R(34007.)

   CPS(12)=R(34008.)

   LEVEL(12)=R(34009.)

1991 VARIABLES

           DO I=13;

                AFDC(I)=-4;

                ALIM(I)=-4;

                CHSP(I)=-4;

                CPS(I)=-4;

                ED(I)=-4;

                EDSS(I)=-4;

                FAMILY(I)=-4;

                FAMINC(I)=-4;

                FOOD(I)=-4;

                INCOME(I)=-4;

                LEVEL(I)=-4;

                MIL(I)=-4;

                MILS(I)=-4;

                DO J=1 TO 3;

                   MN(I,J)=-4;

                END;

                OTHER(I)=-4;

                PUBLIC(I)=-4;

                RELREG(I)=-4;

                RELWEL(I)=-4;

                S(I)=-4;

                SEI(I)=-4;

                SEIS(I)=-4;

                SUMN(I)=-4;

                DO J=1 TO 3;

                   DO K=1 TO 15;

                     TABLE(I,J,K)=-4;

                   END;

                END;

                UI(I)=-4;

                UIS(I)=-4;

                VET(I)=-4;

                WPS(I)=-4;

                WPSS(I)=-4;

          END;

          IF R(35589.)=-4 THEN MIL(13)=0;

          ELSE MIL(13)=R(35589.);

          IF R(35590.)=-4 THEN WPS(13)=0;

          ELSE WPS(13)=R(35590.);

          IF R(35593.)=-4 THEN SEI(13)=0;

          ELSE SEI(13)=R(35593.);

          IF R(35607.)=-4 & R(35608.)=-4 THEN UI(13)=0;

          ELSE IF R(35607.)>0 & R(35608.)>0 THEN UI(13)=R(35607.) * R(35608.);

          ELSE IF R(35608.)<0 THEN UI(13)=R(35608.);

          ELSE UI(13)=-3;

          IF R(35611.)=-4 THEN MILS(13)=0;

          ELSE MILS(13)=R(35611.);

          IF R(35612.)=-4 THEN WPSS(13)=0;

          ELSE WPSS(13)=R(35612.);

          IF R(35615.)=-4 THEN SEIS(13)=0;

          ELSE SEIS(13)=R(35615.);

          IF R(35629.)=-4 & R(35630.)=-4 THEN UIS(13)=0;

          ELSE IF R(35629.)>0 & R(35630.)>0 THEN UIS(13)=R(35629.) * R(35630.);

          ELSE IF R(35630.)<0 THEN UIS(13)=R(35630.);

          ELSE UIS(13)=-3;

          IF R(35633.)=-4 THEN ALIM(13)=0;

          ELSE ALIM(13)=R(35633.);

          IF R(35635.)=-4 THEN CHSP(13)=0;

          ELSE CHSP(13)=R(35635.);

          IF R(35649.)=-4 THEN AFDC(13)=0;

          ELSE DO;

             B=0;

                IF R(35637.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35637.)>-4 & R(35637.)<0 THEN B=NA;

                IF R(35638.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35638.)>-4 & R(35638.)<0 THEN B=NA;

                IF R(35639.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35639.)>-4 & R(35639.)<0 THEN B=NA;

                IF R(35640.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35640.)>-4 & R(35640.)<0 THEN B=NA;

                IF R(35641.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35641.)>-4 & R(35641.)<0 THEN B=NA;

                IF R(35642.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35642.)>-4 & R(35642.)<0 THEN B=NA;

                IF R(35643.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35643.)>-4 & R(35643.)<0 THEN B=NA;

                IF R(35644.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35644.)>-4 & R(35644.)<0 THEN B=NA;

                IF R(35645.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35645.)>-4 & R(35645.)<0 THEN B=NA;

                IF R(35646.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35646.)>-4 & R(35646.)<0 THEN B=NA;

                IF R(35647.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35647.)>-4 & R(35647.)<0 THEN B=NA;

                IF R(35648.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35648.)>-4 & R(35648.)<0 THEN B=NA;

             IF R(35649.)<0 THEN AFDC(13)=R(35649.);

             ELSE IF B<=0 THEN AFDC(13)=-3;

             ELSE AFDC(13)=R(35649.) * B;

          END;

          IF R(35663.)=-4 THEN FOOD(13)=0;

          ELSE DO;

             B=0;

                IF R(35651.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35651.)>-4 & R(35651.)<0 THEN B=NA;

                IF R(35652.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35652.)>-4 & R(35652.)<0 THEN B=NA;

                IF R(35653.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35653.)>-4 & R(35653.)<0 THEN B=NA;

                IF R(35654.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35654.)>-4 & R(35654.)<0 THEN B=NA;

                IF R(35655.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35655.)>-4 & R(35655.)<0 THEN B=NA;

                IF R(35656.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35656.)>-4 & R(35656.)<0 THEN B=NA;

                IF R(35657.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35657.)>-4 & R(35657.)<0 THEN B=NA;

                IF R(35658.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35658.)>-4 & R(35658.)<0 THEN B=NA;

                IF R(35659.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35659.)>-4 & R(35659.)<0 THEN B=NA;

                IF R(35660.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35660.)>-4 & R(35660.)<0 THEN B=NA;

                IF R(35661.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35661.)>-4 & R(35661.)<0 THEN B=NA;

                IF R(35662.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35662.)>-4 & R(35662.)<0 THEN B=NA;

             IF R(35663.)<0 THEN FOOD(13)=R(35663.);

             ELSE IF B<=0 THEN FOOD(13)=-3;

             ELSE FOOD(13)=R(35663.) * B;

          END;

          IF R(35689.)=-4 THEN PUBLIC(13)=0;

          ELSE DO;

             B=0;

                IF R(35677.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35677.)>-4 & R(35677.)<0 THEN B=NA;

                IF R(35678.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35678.)>-4 & R(35678.)<0 THEN B=NA;

                IF R(35679.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35679.)>-4 & R(35679.)<0 THEN B=NA;

                IF R(35680.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35680.)>-4 & R(35680.)<0 THEN B=NA;

                IF R(35681.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35681.)>-4 & R(35681.)<0 THEN B=NA;

                IF R(35682.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35682.)>-4 & R(35682.)<0 THEN B=NA;

                IF R(35683.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35683.)>-4 & R(35683.)<0 THEN B=NA;

                IF R(35684.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35684.)>-4 & R(35684.)<0 THEN B=NA;

                IF R(35685.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35685.)>-4 & R(35685.)<0 THEN B=NA;

                IF R(35686.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35686.)>-4 & R(35686.)<0 THEN B=NA;

                IF R(35687.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35687.)>-4 & R(35687.)<0 THEN B=NA;

                IF R(35688.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(35688.)>-4 & R(35688.)<0 THEN B=NA;

             IF R(35689.)<0 THEN PUBLIC(13)=R(35689.);

             ELSE IF B<=0 THEN PUBLIC(13)=-3;

             ELSE PUBLIC(13)=R(35689.) * B;

          END;

          IF R(35695.)=-4 THEN ED(13)=0;

          ELSE ED(13)=R(35695.);

          IF R(35696.)=-4 THEN EDSS(13)=0;

          ELSE EDSS(13)=R(35696.);

          IF R(35698.)=-4 THEN VET(13)=0;

          ELSE VET(13)=R(35698.);

          IF R(35702.)=-4 THEN OTHER(13)=0;

          ELSE OTHER(13)=R(35702.);

          IF VET(13)>0 & OTHER(13)=VET(13) THEN OTHER(13)=0;

          IF R(35712.)=-4 THEN RELWEL(13)=0;

          ELSE RELWEL(13)=R(35712.);

          IF R(35714.)=-4 THEN RELREG(13)=0;

          ELSE RELREG(13)=R(35714.);

          FAMILY(13)=FAMSZ91; /* TO CREATE FAMILY SIZE (I.E. FAMSZ91)

                                SEARCH THRU THE HOUSEHOLD ENUMERATION

                                INCREMENT FAMILY SIZE, IF THE

                                RELATIONSHIP TO THE YOUTH IS A RELATIVE.

                                DO NOT INCREASE FAMILY SIZE, IF THE CODE

                                IS <0 OR (>=33 & <=36) OR =45 OR =46 OR

                                (>=50 & <=54) */

         DCL COMPONENT(19) FIXED DEC(9);

         DO I=13;

            MN(I,1)=0; MN(I,2)=0; MN(I,3)=0;

            FAMINC(I)=0;

            INCOME(I)=-3;

            COMPONENT(1)=MIL(I);  

            COMPONENT(2)=MILS(I);  

            COMPONENT(3)=WPS(I);   

            COMPONENT(4)=WPSS(I);  

            COMPONENT(5)=SEI(I);

            COMPONENT(6)=SEIS(I);  

            COMPONENT(7)=UI(I);    

            COMPONENT(8)=UIS(I);   

            COMPONENT(9)=ALIM(I);  

            COMPONENT(10)=CHSP(I); 

            COMPONENT(11)=AFDC(I); 

            COMPONENT(13)=PUBLIC(I);

            COMPONENT(13)=ED(I);   

            COMPONENT(14)=EDSS(I); 

            COMPONENT(15)=VET(I);  

            COMPONENT(16)=OTHER(I);

            COMPONENT(17)=RELWEL(I);

            COMPONENT(18)=RELREG(I);

            COMPONENT(19)=FOOD(I); 

            IF WEIGHT(I)=0 THEN DO;

               INCOME(I)=-5;

               CPS(I)=-5;

               LEVEL(I)=-5;

            END;

            ELSE DO;

                 DO K=1 TO 19;

                    IF COMPONENT(K)>-4 THEN DO;

                       IF COMPONENT(K)<0 THEN

                          MN(I,ABS(COMPONENT(K)))=MN(I,ABS(COMPONENT(K)))+1;

                       ELSE FAMINC(I)=FAMINC(I)+COMPONENT(K);

                     END;

                  END;  

               SUMN(I)=MN(I,1) + MN(I,2) + MN(I,3);

               IF SUMN(I)=0 THEN INCOME(I)=FAMINC(I);

               ELSE DO J=1 TO 3;

                   IF MN(I,J)>0 THEN INCOME(I)=-J;

               END;

            IF FAMILY(I)>0 THEN DO;

                LEVEL(I)=TABLE(I,S(I),FAMILY(I));

                IF INCOME(I)>LEVEL(I) THEN CPS(I)=0;

                ELSE IF INCOME(I)>= 0 & INCOME(I)<=LEVEL(I) THEN CPS(I)=1;

                ELSE CPS(I)=-3;

            END;

          END;

        END;

   DO I=1 TO 3;

      IF MN(13,I)>0 THEN MN(13,I)=1;

   END;

   IF SUMN(13)>0 THEN SUMN(13)=1;

   INCOME(13)=R(36561.)

   CPS(13)=R(36562.)

   LEVEL(13)=R(36563.)

1992 VARIABLES

           DO I=14;

                AFDC(I)=-4;

                ALIM(I)=-4;

                CHSP(I)=-4;

                CPS(I)=-4;

                ED(I)=-4;

                EDSS(I)=-4;

                FAMILY(I)=-4;

                FAMINC(I)=-4;

                FOOD(I)=-4;

                INCOME(I)=-4;

                LEVEL(I)=-4;

                MIL(I)=-4;

                MILS(I)=-4;

                DO J=1 TO 3;

                   MN(I,J)=-4;

                END;

                OTHER(I)=-4;

                PUBLIC(I)=-4;

                RELREG(I)=-4;

                RELWEL(I)=-4;

                S(I)=-4;

                SEI(I)=-4;

                SEIS(I)=-4;

                SUMN(I)=-4;

                DO J=1 TO 3;

                   DO K=1 TO 15;

                     TABLE(I,J,K)=-4;

                   END;

                END;

                UI(I)=-4;

                UIS(I)=-4;

                VET(I)=-4;

                WPS(I)=-4;

                WPSS(I)=-4;

          END;

          IF R(38970.)=-4 THEN MIL(14)=0;

          ELSE MIL(14)=R(38970.);

          IF R(38971.)=-4 THEN WPS(14)=0;

          ELSE WPS(14)=R(38971.);

          IF R(38974.)=-4 THEN SEI(14)=0;

          ELSE SEI(14)=R(38974.);

          IF R(38988.)=-4 & R(38989.)=-4 THEN UI(14)=0;

          ELSE IF R(38988.)>0 & R(38989.)>0 THEN UI(14)=R(38988.) * R(38989.);

          ELSE IF R(38989.)<0 THEN UI(14)=R(38989.);

          ELSE UI(14)=-3;

          IF R(38992.)=-4 THEN MILS(14)=0;

          ELSE MILS(14)=R(38992.);

          IF R(38993.)=-4 THEN WPSS(14)=0;

          ELSE WPSS(14)=R(38993.);

          IF R(38996.)=-4 THEN SEIS(14)=0;

          ELSE SEIS(14)=R(38996.);

          IF R(39010.)=-4 & R(39011.)=-4 THEN UIS(14)=0;

          ELSE IF R(39010.)>0 & R(39011.)>0 THEN UIS(14)=R(39010.) * R(39011.);

          ELSE IF R(39011.)<0 THEN UIS(14)=R(39011.);

          ELSE UIS(14)=-3;

          IF R(39014.)=-4 THEN ALIM(14)=0;

          ELSE ALIM(14)=R(39014.);

          IF R(39016.)=-4 THEN CHSP(14)=0;

          ELSE CHSP(14)=R(39016.);

          IF R(39030.)=-4 THEN AFDC(14)=0;

          ELSE DO;

             B=0;

                IF R(39018.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39018.)>-4 & R(39018.)<0 THEN B=NA;

                IF R(39019.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39019.)>-4 & R(39019.)<0 THEN B=NA;

                IF R(39020.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39020.)>-4 & R(39020.)<0 THEN B=NA;

                IF R(39021.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39021.)>-4 & R(39021.)<0 THEN B=NA;

                IF R(39022.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39022.)>-4 & R(39022.)<0 THEN B=NA;

                IF R(39023.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39023.)>-4 & R(39023.)<0 THEN B=NA;

                IF R(39024.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39024.)>-4 & R(39024.)<0 THEN B=NA;

                IF R(39025.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39025.)>-4 & R(39025.)<0 THEN B=NA;

                IF R(39026.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39026.)>-4 & R(39026.)<0 THEN B=NA;

                IF R(39027.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39027.)>-4 & R(39027.)<0 THEN B=NA;

                IF R(39028.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39028.)>-4 & R(39028.)<0 THEN B=NA;

                IF R(39029.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39029.)>-4 & R(39029.)<0 THEN B=NA;

             IF R(39030.)<0 THEN AFDC(14)=R(39030.);

             ELSE IF B<=0 THEN AFDC(14)=-3;

             ELSE AFDC(14)=R(39030.) * B;

          END;

          IF R(39044.)=-4 THEN FOOD(14)=0;

          ELSE DO;

             B=0;

                IF R(39032.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39032.)>-4 & R(39032.)<0 THEN B=NA;

                IF R(39033.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39033.)>-4 & R(39033.)<0 THEN B=NA;

                IF R(39034.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39034.)>-4 & R(39034.)<0 THEN B=NA;

                IF R(39035.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39035.)>-4 & R(39035.)<0 THEN B=NA;

                IF R(39036.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39036.)>-4 & R(39036.)<0 THEN B=NA;

                IF R(39037.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39037.)>-4 & R(39037.)<0 THEN B=NA;

                IF R(39038.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39038.)>-4 & R(39038.)<0 THEN B=NA;

                IF R(39039.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39039.)>-4 & R(39039.)<0 THEN B=NA;

                IF R(39040.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39040.)>-4 & R(39040.)<0 THEN B=NA;

                IF R(39041.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39041.)>-4 & R(39041.)<0 THEN B=NA;

                IF R(39042.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39042.)>-4 & R(39042.)<0 THEN B=NA;

                IF R(39043.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39043.)>-4 & R(39043.)<0 THEN B=NA;

             IF R(39044.)<0 THEN FOOD(14)=R(39044.);

             ELSE IF B<=0 THEN FOOD(14)=-3;

             ELSE FOOD(14)=R(39044.) * B;

          END;

          IF R(39070.)=-4 THEN PUBLIC(14)=0;

          ELSE DO;

             B=0;

                IF R(39058.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39058.)>-4 & R(39058.)<0 THEN B=NA;

                IF R(39059.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39059.)>-4 & R(39059.)<0 THEN B=NA;

                IF R(39060.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39060.)>-4 & R(39060.)<0 THEN B=NA;

                IF R(39061.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39061.)>-4 & R(39061.)<0 THEN B=NA;

                IF R(39062.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39062.)>-4 & R(39062.)<0 THEN B=NA;

                IF R(39063.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39063.)>-4 & R(39063.)<0 THEN B=NA;

                IF R(39064.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39064.)>-4 & R(39064.)<0 THEN B=NA;

                IF R(39065.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39065.)>-4 & R(39065.)<0 THEN B=NA;

                IF R(39066.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39066.)>-4 & R(39066.)<0 THEN B=NA;

                IF R(39067.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39067.)>-4 & R(39067.)<0 THEN B=NA;

                IF R(39068.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39068.)>-4 & R(39068.)<0 THEN B=NA;

                IF R(39069.)>0 & B^=NA THEN B=B+1;

                ELSE IF R(39069.)>-4 & R(39069.)<0 THEN B=NA;

             IF R(39070.)<0 THEN PUBLIC(14)=R(39070.);

             ELSE IF B<=0 THEN PUBLIC(14)=-3;

             ELSE PUBLIC(14)=R(39070.) * B;

          END;

          IF R(39076.)=-4 THEN ED(14)=0;

          ELSE ED(14)=R(39076.);

          IF R(39077.)=-4 THEN EDSS(14)=0;

          ELSE EDSS(14)=R(39077.);

          IF R(39079.)=-4 THEN VET(14)=0;

          ELSE VET(14)=R(39079.);

          IF R(39083.)=-4 THEN OTHER(14)=0;

          ELSE OTHER(14)=R(39083.);

          IF VET(14)>0 & OTHER(14)=VET(14) THEN OTHER(14)=0;

          IF R(39093.)=-4 THEN RELWEL(14)=0;

          ELSE RELWEL(14)=R(39093.);

          IF R(39095.)=-4 THEN RELREG(14)=0;

          ELSE RELREG(14)=R(39095.);

          FAMILY(14)=FAMSZ92; /* TO CREATE FAMILY SIZE (I.E. FAMSZ92)

                                SEARCH THRU THE HOUSEHOLD ENUMERATION

                                INCREMENT FAMILY SIZE, IF THE

                                RELATIONSHIP TO THE YOUTH IS A RELATIVE.

                                DO NOT INCREASE FAMILY SIZE, IF THE CODE

                                IS <0 OR (>=33 & <=36) OR =45 OR =46 OR

                                (>=50 & <=54) */

         DCL COMPONENT(19) FIXED DEC(9);

         DO I=13;

            MN(I,1)=0; MN(I,2)=0; MN(I,3)=0;

            FAMINC(I)=0;

            INCOME(I)=-3;

            COMPONENT(1)=MIL(I);  

            COMPONENT(2)=MILS(I);  

            COMPONENT(3)=WPS(I);   

            COMPONENT(4)=WPSS(I);  

            COMPONENT(5)=SEI(I);

            COMPONENT(6)=SEIS(I);  

            COMPONENT(7)=UI(I);    

            COMPONENT(8)=UIS(I);   

            COMPONENT(9)=ALIM(I);  

            COMPONENT(10)=CHSP(I); 

            COMPONENT(11)=AFDC(I); 

            COMPONENT(12)=PUBLIC(I);

            COMPONENT(13)=ED(I);   

            COMPONENT(14)=EDSS(I); 

            COMPONENT(15)=VET(I);  

            COMPONENT(16)=OTHER(I);

            COMPONENT(17)=RELWEL(I);

            COMPONENT(18)=RELREG(I);

            COMPONENT(19)=FOOD(I); 

            IF WEIGHT(I)=0 THEN DO;

               INCOME(I)=-5;

               CPS(I)=-5;

               LEVEL(I)=-5;

            END;

            ELSE DO;

                 DO K=1 TO 19;

                    IF COMPONENT(K)>-4 THEN DO;

                       IF COMPONENT(K)<0 THEN

                          MN(I,ABS(COMPONENT(K)))=MN(I,ABS(COMPONENT(K)))+1;

                       ELSE FAMINC(I)=FAMINC(I)+COMPONENT(K);

                     END;

                  END;  

               SUMN(I)=MN(I,1) + MN(I,2) + MN(I,3);

               IF SUMN(I)=0 THEN INCOME(I)=FAMINC(I);

               ELSE DO J=1 TO 3;

                   IF MN(I,J)>0 THEN INCOME(I)=-J;

               END;

    /* income trunc */

      IF INCOME(I) > 100000 THEN INCOME(I) = 833745;

            IF FAMILY(I)>0 THEN DO;

                LEVEL(I)=TABLE(I,S(I),FAMILY(I));

                IF INCOME(I)>LEVEL(I) THEN CPS(I)=0;

                ELSE IF INCOME(I)>= 0 & INCOME(I)<=LEVEL(I) THEN CPS(I)=1;

                ELSE CPS(I)=-3;

            END;

          END;

        END;

   DO I=1 TO 3;

      IF MN(14,I)>0 THEN MN(14,I)=1;

   END;

   IF SUMN(14)>0 THEN SUMN(14)=1;

   INCOME(14)=R(40066.)

   CPS(14)=R(40067.)

   LEVEL(14)=R(40068.)

1993 Variables

          DO I=15;

                AFDC(I)=-4;

                ALIM(I)=-4;

                CHSP(I)=-4;

                CPS(I)=-4;

                ED(I)=-4;

                EDSS(I)=-4;

                FAMILY(I)=-4;

                FAMINC(I)=-4;

                FOOD(I)=-4;

                INCOME(I)=-4;

                LEVEL(I)=-4;

                MIL(I)=-4;

                MILS(I)=-4;

                DO J=1 TO 3;

                   MN(I,J)=-4;

                END;

                OTHER(I)=-4;

                PUBLIC(I)=-4;

                RELREG(I)=-4;

                RELWEL(I)=-4;

                S(I)=-4;

                SEI(I)=-4;

                SEIS(I)=-4;

                SUMN(I)=-4;

                DO J=1 TO 3;

                   DO K=1 TO 15;

                     TABLE(I,J,K)=-4;

                   END;

                END;

                UI(I)=-4;

                UIS(I)=-4;

                VET(I)=-4;

                WPS(I)=-4;

                WPSS(I)=-4;

          END;

/* Several variables pertaining to recipiency from various government income programs were computed from            */

/* a number of different variables in 1993, due to the change to an event history format for data collection.                 */

/* these variables are as follows:                                                                                                                              */

/* WKTOT92U = Total number of weeks R received unemployment compensation in calendar year 1992                     */

/* RCTOT92U = Total amount of unemployment compensation R received in calendar year 1992              */

/* WKTOT92S = Total number of weeks R's spouse received unemployment compensation in calendar year    */

/*                         1992                                                                                                                              */

/* RCTOT92U = Total amount of unemployment compensation R's spouse received in calendar year 1992                  */

/* MOTOT92A = Total number of months R or spouse received AFDC payments in calendar year 1992  */

/* RCTOT92A = Total amount of AFDC R or spouse received in calendar year 1992                                    */

/* MOTOT92F = Total number of months R or spouse received government food stamps in calendar year                  */

/*                         1992                                                                                                                              */

/* RCTOT92F = Total amount of government food stamps R or spouse received in calendar year 1992    */

/* MOTOT92W = Total number of months R or spouse received other welfare or public assistance payments           */

/*                           in calendar year 1992                                                                                               */

/* RCTOT92W = Total amount of other welfare or public assistance payemnts R or spouse received in   */

/*                         calendar year 1992                                                                                                                          */

          IF R(42949.)=-4 THEN MIL(15)=0;

          ELSE MIL(15)=R(42949.);

          IF R(42951.)=-4 THEN WPS(15)=0;

          ELSE WPS(15)=R(42951.);

          IF R(42955.)=-4 THEN SEI(15)=0;

          ELSE SEI(15)=R(42955.);

          IF WKTOT92U=-4 & RCTOT92U=-4 THEN UI(15)=0;

          ELSE IF WKTOT92U>0 & RCTOT92U>0 THEN UI(15)=WKTOT92U * RCTOT92U;

          ELSE IF RCTOT92U<0 THEN UI(15)=RCTOT92U;

          ELSE UI(15)=-3;

          IF R(43142.)=-4 THEN MILS(15)=0;

          ELSE MILS(15)=R(43142.);

          IF R(43144.)=-4 THEN WPSS(15)=0;

          ELSE WPSS(15)=R(43144.);

          IF R(43149.)=-4 THEN SEIS(15)=0;

          ELSE SEIS(15)=R(43149.);

          IF WKTOT92S=-4 & RCTOT92S=-4 THEN UIS(15)=0;

          ELSE IF WKTOT92S>0 & RCTOT92S>0 THEN UIS(15)=WKTOT92S * RCTOT92S;

          ELSE IF RCTOT92S<0 THEN UIS(15)=RCTOT92S;

          ELSE UIS(15)=-3;

          IF R(43325.)=-4 THEN ALIM(15)=0;

          ELSE ALIM(15)=R(43325.);

          IF R(43341.)=-4 THEN CHSP(15)=0;

          ELSE CHSP(15)=R(43341.);

          IF R(43351.)=-4 THEN CHSP(15)=0;

          ELSE CHSP(15)=R(43351.);

          IF RCTOT92A=-4 THEN AFDC(15)=0;

          ELSE DO;

             IF RCTOT92A<0 THEN AFDC(15)=RCTOT92A;

             ELSE IF MOTOT92A<=0 THEN AFDC(15)=-3;

             ELSE AFDC(15)=RCTOT92A * MOTOT92A;

          END;

          IF RCTOT92F=-4 THEN FOOD(15)=0;

          ELSE DO;

             IF RCTOT92F<0 THEN FOOD(15)=RCTOT92F;

             ELSE IF MOTOT92F<=0 THEN FOOD(15)=-3;

             ELSE FOOD(15)=RCTOT92F * MOTOT92F;

          END;

          IF RCTOT92W=-4 THEN PUBLIC(15)=0;

          ELSE DO;

             IF RCTOT92W<0 THEN PUBLIC(15)=RCTOT92W;

             ELSE IF MOTOT92W<=0 THEN PUBLIC(15)=-3;

             ELSE PUBLIC(15)=RCTOT92W * MOTOT92W;

          END;

          IF R(43879.)=-4 THEN ED(15)=0;

          ELSE ED(15)=R(43879.);

          IF R(43881.)=-4 THEN EDSS(15)=0;

          ELSE EDSS(15)=R(43881.);

          IF R(43883.)=-4 THEN VET(15)=0;

          ELSE VET(15)=R(43883.);

          IF R(43888.)=-4 THEN OTHER(15)=0;

          ELSE OTHER(15)=R(43888.);

          IF VET(15)>0 & OTHER(15)=VET(15) THEN OTHER(15)=0;

          IF R(43900.)=-4 THEN RELWEL(15)=0;

          ELSE RELWEL(15)=R(43900.);

          IF R(43903.)=-4 THEN RELREG(15)=0;

          ELSE RELREG(15)=R(43903.);

          FAMILY(15)=R(44176.); /* TO CREATE FAMILY SIZE (I.E. R(44176.))

                                SEARCH THRU THE HOUSEHOLD ENUMERATION

                                INCREMENT FAMILY SIZE, IF THE

                                RELATIONSHIP TO THE YOUTH IS A RELATIVE.

                                DO NOT INCREASE FAMILY SIZE, IF THE CODE

                                IS <0 OR (>=33 & <=36) OR =45 OR =46 OR

                                (>=50 & <=54) */

         DCL COMPONENT(19) FIXED DEC(9);

         DO I=15;

            MN(I,1)=0; MN(I,2)=0; MN(I,3)=0;

            FAMINC(I)=0;

            INCOME(I)=-3;

            COMPONENT(1)=MIL(I);  

            COMPONENT(2)=MILS(I);  

            COMPONENT(3)=WPS(I);   

            COMPONENT(4)=WPSS(I);  

            COMPONENT(5)=SEI(I);

            COMPONENT(6)=SEIS(I);  

            COMPONENT(7)=UI(I);    

            COMPONENT(8)=UIS(I);   

            COMPONENT(9)=ALIM(I);  

            COMPONENT(10)=CHSP(I); 

            COMPONENT(11)=AFDC(I); 

            COMPONENT(12)=PUBLIC(I);

            COMPONENT(13)=ED(I);   

            COMPONENT(14)=EDSS(I); 

            COMPONENT(15)=VET(I);  

            COMPONENT(16)=OTHER(I);

            COMPONENT(17)=RELWEL(I);

            COMPONENT(18)=RELREG(I);

            COMPONENT(19)=FOOD(I); 

            IF WEIGHT(I)=0 THEN DO;

               INCOME(I)=-5;

               CPS(I)=-5;

               LEVEL(I)=-5;

            END;

            ELSE DO;

                 DO K=1 TO 19;

                    IF COMPONENT(K)>-4 THEN DO;

                       IF COMPONENT(K)<0 THEN

                          MN(I,ABS(COMPONENT(K)))=MN(I,ABS(COMPONENT(K)))+1;

                       ELSE FAMINC(I)=FAMINC(I)+COMPONENT(K);

                     END;

                  END;  

               SUMN(I)=MN(I,1) + MN(I,2) + MN(I,3);

               IF SUMN(I)=0 THEN INCOME(I)=FAMINC(I);

               ELSE DO J=1 TO 3;

                   IF MN(I,J)>0 THEN INCOME(I)=-J;

               END;

    /* imcome trunc  */

      IF INCOME(I) > 100000 THEN INCOME(I) = 160097;

            IF FAMILY(I)>0 THEN DO;

                LEVEL(I)=TABLE(I,S(I),FAMILY(I));

                IF INCOME(I)>LEVEL(I) THEN CPS(I)=0;

                ELSE IF INCOME(I)>= 0 & INCOME(I)<=LEVEL(I) THEN CPS(I)=1;

                ELSE CPS(I)=-3;

            END;

          END;

        END;

   DO I=1 TO 3;

      IF MN(15,I)>0 THEN MN(15,I)=1;

   END;

   IF SUMN(15)>0 THEN SUMN(15)=1;

INCOME(15)=R(44177.)

CPS(15)=R(44178.)

LEVEL(15)=R(44179.)

1994 Variables

            DO I=16;

                AFDC(I)=-4;

                ALIM(I)=-4;

                CHSP(I)=-4;

                CPS(I)=-4;

                ED(I)=-4;

                EDSS(I)=-4;

                FAMILY(I)=-4;

                FAMINC(I)=-4;

                FOOD(I)=-4;

                INCOME(I)=-4;

                LEVEL(I)=-4;

                MIL(I)=-4;

                MILS(I)=-4;

                DO J=1 TO 3;

                   MN(I,J)=-4;

                END;

                OTHER(I)=-4;

                PUBLIC(I)=-4;

                RELREG(I)=-4;

                RELWEL(I)=-4;

                S(I)=-4;

                SEI(I)=-4;

                SEIS(I)=-4;

                SUMN(I)=-4;

                DO J=1 TO 3;

                   DO K=1 TO 15;

                     TABLE(I,J,K)=-4;

                   END;

                END;

                UI(I)=-4;

                UIS(I)=-4;

                VET(I)=-4;

                WPS(I)=-4;

                WPSS(I)=-4;

          END;

/* Several variables pertaining to recipiency from various government income programs were computed from            */

/* a number of different variables in 1994, due to the change to an event history format for data collection.                 */

/* these variables are as follows:                                                                                                                              */

/* WKTOT93U = Total number of weeks R received unemployment compensation in calendar year 1993                     */

/* RCTOT93U = Total amount of unemployment compensation R received in calendar year 1993              */

/* WKTOT93S = Total number of weeks R's spouse received unemployment compensation in calendar year    */

/*                         1993                                                                                                                              */

/* RCTOT93U = Total amount of unemployment compensation R's spouse received in calendar year 1993                  */

/* MOTOT93A = Total number of months R or spouse received AFDC payments in calendar year 1993  */

/* RCTOT93A = Total amount of AFDC R or spouse received in calendar year 1993                                    */

/* MOTOT93F = Total number of months R or spouse received government food stamps in calendar year                  */

/*                         1993                                                                                                                              */

/* RCTOT93F = Total amount of government food stamps R or spouse received in calendar year 1993    */

/* MOTOT93W = Total number of months R or spouse received other welfare or public assistance payments           */

/*                           in calendar year 1993                                                                                               */

/* RCTOT93W = Total amount of other welfare or public assistance payemnts R or spouse received in   */

/*                         calendar year 1993                                                                                                                          */

          IF R(49826)=-4 THEN MIL(16)=0;

          ELSE MIL(16)=R(49826.);

          IF R(49828.)=-4 THEN WPS(16)=0;

          ELSE WPS(16)=R(49828.);

          IF R(49832.)=-4 THEN SEI(16)=0;

          ELSE SEI(16)=R(49832.);

          IF WKTOT93U=-4 & RCTOT93U=-4 THEN UI(16)=0;

          ELSE IF WKTOT93U>0 & RCTOT93U>0 THEN UI(16)=WKTOT93U * RCTOT93U;

          ELSE IF RCTOT93U<0 THEN UI(16)=RCTOT93U;

          ELSE UI(16)=-3;

          IF R(49958.)=-4 THEN MILS(16)=0;

          ELSE MILS(16)=R(49958.);

          IF R(49960.)=-4 THEN WPSS(16)=0;

          ELSE WPSS(16)=R(49960.);

          IF R(49966.)=-4 THEN SEIS(16)=0;

          ELSE SEIS(16)=R(49966.);

          IF WKTOT93S=-4 & RCTOT93S=-4 THEN UIS(16)=0;

          ELSE IF WKTOT93S>0 & RCTOT93S>0 THEN UIS(16)=WKTOT93S * RCTOT93S;

          ELSE IF RCTOT93S<0 THEN UIS(16)=RCTOT93S;

          ELSE UIS(16)=-3;

          IF R(50096.)=-4 THEN ALIM(16)=0;

          ELSE ALIM(16)=R(50096.);

          IF R(50119.)=-4 THEN CHSP(16)=0;

          ELSE CHSP(16)=R(50119.);

          IF R(50130.)=-4 THEN CHSP(16)=0;

          ELSE CHSP(16)=R(50130.);

          IF RCTOT93A=-4 THEN AFDC(16)=0;

          ELSE DO;

             IF RCTOT93A<0 THEN AFDC(16)=RCTOT93A;

             ELSE IF MOTOT93A<=0 THEN AFDC(16)=-3;

             ELSE AFDC(16)=RCTOT93A * MOTOT93A;

          END;

          IF RCTOT93F=-4 THEN FOOD(16)=0;

          ELSE DO;

             IF RCTOT93F<0 THEN FOOD(16)=RCTOT93F;

             ELSE IF MOTOT93F<=0 THEN FOOD(16)=-3;

             ELSE FOOD(16)=RCTOT93F * MOTOT93F;

          END;

          IF RCTOT93W=-4 THEN PUBLIC(16)=0;

          ELSE DO;

             IF RCTOT93W<0 THEN PUBLIC(16)=RCTOT93W;

             ELSE IF MOTOT93W<=0 THEN PUBLIC(16)=-3;

             ELSE PUBLIC(16)=RCTOT93W * MOTOT93W;

          END;

          IF R(50441.)=-4 THEN ED(16)=0;

          ELSE ED(16)=R(50441.);

          IF R(50443.)=-4 THEN EDSS(16)=0;

          ELSE EDSS(16)=R(50443.);

          IF R(50445.)=-4 THEN VET(16)=0;

          ELSE VET(16)=R(50445.);

          IF R(50450.)=-4 THEN OTHER(16)=0;

          ELSE OTHER(16)=R(50450.);

          IF VET(16)>0 & OTHER(16)=VET(16) THEN OTHER(16)=0;

          IF R(50462.)=-4 THEN RELWEL(16)=0;

          ELSE RELWEL(16)=R(50462.);

          IF R(50465.)=-4 THEN RELREG(16)=0;

          ELSE RELREG(16)=R(50465.);

          FAMILY(16)=FAMSZ94; /* TO CREATE FAMILY SIZE (I.E. FAMSZ94)

                                SEARCH THRU THE HOUSEHOLD ENUMERATION

                                INCREMENT FAMILY SIZE, IF THE

                                RELATIONSHIP TO THE YOUTH IS A RELATIVE.

                                DO NOT INCREASE FAMILY SIZE, IF THE CODE

                                IS <0 OR (>=33 & <=36) OR =45 OR =46 OR

                                (>=50 & <=54) */

         DCL COMPONENT(19) FIXED DEC(9);

         DO I=16;

            MN(I,1)=0; MN(I,2)=0; MN(I,3)=0;

            FAMINC(I)=0;

            INCOME(I)=-3;

            COMPONENT(1)=MIL(I);  

            COMPONENT(2)=MILS(I);  

            COMPONENT(3)=WPS(I);   

            COMPONENT(4)=WPSS(I);  

            COMPONENT(5)=SEI(I);

            COMPONENT(6)=SEIS(I);  

            COMPONENT(7)=UI(I);    

            COMPONENT(8)=UIS(I);   

            COMPONENT(9)=ALIM(I);  

            COMPONENT(10)=CHSP(I); 

            COMPONENT(11)=AFDC(I); 

            COMPONENT(12)=PUBLIC(I);

            COMPONENT(13)=ED(I);   

            COMPONENT(14)=EDSS(I); 

            COMPONENT(15)=VET(I);  

            COMPONENT(16)=OTHER(I);

            COMPONENT(17)=RELWEL(I);

            COMPONENT(18)=RELREG(I);

            COMPONENT(19)=FOOD(I); 

            IF WEIGHT(I)=0 THEN DO;

               INCOME(I)=-5;

               CPS(I)=-5;

               LEVEL(I)=-5;

            END;

            ELSE DO;

                 DO K=1 TO 19;

                    IF COMPONENT(K)>-4 THEN DO;

                       IF COMPONENT(K)<0 THEN

                          MN(I,ABS(COMPONENT(K)))=MN(I,ABS(COMPONENT(K)))+1;

                       ELSE FAMINC(I)=FAMINC(I)+COMPONENT(K);

                     END;

                  END;  

               SUMN(I)=MN(I,1) + MN(I,2) + MN(I,3);

               IF SUMN(I)=0 THEN INCOME(I)=FAMINC(I);

               ELSE DO J=1 TO 3;

                   IF MN(I,J)>0 THEN INCOME(I)=-J;

               END;

    /* income trunc  */

     /*   IF INCOME(I) > 100000 THEN INCOME(I) = 500000; */

            IF FAMILY(I)>0 THEN DO;

                LEVEL(I)=TABLE(I,S(I),FAMILY(I));

                IF INCOME(I)>LEVEL(I) THEN CPS(I)=0;

                ELSE IF INCOME(I)>= 0 & INCOME(I)<=LEVEL(I) THEN CPS(I)=1;

                ELSE CPS(I)=-3;

            END;

          END;

        END;

   DO I=1 TO 3;

      IF MN(16,I)>0 THEN MN(16,I)=1;

   END;

   IF SUMN(16)>0 THEN SUMN(16)=1;

INCOME(16)=R(50807.)

CPS(16)=R(50808.)

LEVEL(16)=R(50809.)

1996 Variables

           DO I=17;

                AFDC(I)=-4;

                ALIM(I)=-4;

                CHSP(I)=-4;

                CPS(I)=-4;

                ED(I)=-4;

                EDSS(I)=-4;

                FAMILY(I)=-4;

                FAMINC(I)=-4;

                FOOD(I)=-4;

                INCOME(I)=-4;

                LEVEL(I)=-4;

                MIL(I)=-4;

                MILS(I)=-4;

                DO J=1 TO 3;

                   MN(I,J)=-4;

                END;

                OTHER(I)=-4;

                PUBLIC(I)=-4;

                RELREG(I)=-4;

                RELWEL(I)=-4;

                S(I)=-4;

                SEI(I)=-4;

                SEIS(I)=-4;

                SUMN(I)=-4;

                DO J=1 TO 3;

                   DO K=1 TO 15;

                     TABLE(I,J,K)=-4;

                   END;

                END;

                UI(I)=-4;

                UIS(I)=-4;

                VET(I)=-4;

                WPS(I)=-4;

                WPSS(I)=-4;

          END;

/* Several variables pertaining to recipiency from various government income programs were computed from            */

/* a number of different variables in 1994, due to the change to an event history format for data collection.                 */

/* these variables are as follows:                                                                                                                              */

/* WKTOT95U = Total number of weeks R received unemployment compensation in calendar year 1995                     */

/* RCTOT95U = Total amount of unemployment compensation R received in calendar year 1995              */

/* WKTOT95S = Total number of weeks R's spouse received unemployment compensation in calendar year    */

/*                         1995                                                                                                                              */

/* RCTOT95U = Total amount of unemployment compensation R's spouse received in calendar year 1995                  */

/* MOTOT95A = Total number of months R or spouse received AFDC payments in calendar year 1995  */

/* RCTOT95A = Total amount of AFDC R or spouse received in calendar year 1995                                    */

/* MOTOT95F = Total number of months R or spouse received government food stamps in calendar year                  */

/*                         1995                                                                                                                              */

/* RCTOT95F = Total amount of government food stamps R or spouse received in calendar year 1995    */

/* MOTOT95W = Total number of months R or spouse received other welfare or public assistance payments           */

/*                           in calendar year 1995                                                                                               */

/* RCTOT95W = Total amount of other welfare or public assistance payments R or spouse received in   */

/*                         calendar year 1995                                                                                                                          */

          IF R(56260.)=-4 THEN MIL(17)=0;

          ELSE MIL(17)=R(56260.);

          IF R(56262.)=-4 THEN WPS(17)=0;

          ELSE WPS(17)=R(56262.);

          IF R(56266.)=-4 THEN SEI(17)=0;

          ELSE SEI(17)=R(56266.);

          IF WKTOT95U=-4 & RCTOT95U=-4 THEN UI(17)=0;

          ELSE IF WKTOT95U>0 & RCTOT95U>0 THEN UI(17)=WKTOT95U * RCTOT95U;

          ELSE IF RCTOT95U<0 THEN UI(17)=RCTOT95U;

          ELSE UI(17)=-3;

          IF Q13_16=-4 THEN MILS(17)=0;

          ELSE MILS(17)= Q13_16;

          IF R(56508.)=-4 THEN WPSS(17)=0;

          ELSE WPSS(17)=R(56508.);

          IF R(56514.)=-4 THEN SEIS(17)=0;

          ELSE SEIS(17)=R(56514.);

          IF WKTOT95S=-4 & RCTOT95S=-4 THEN UIS(17)=0;

          ELSE IF WKTOT95S>0 & RCTOT95S>0 THEN UIS(17)=WKTOT95S * RCTOT95S;

          ELSE IF RCTOT95S<0 THEN UIS(17)=RCTOT95S;

          ELSE UIS(17)=-3;

          IF Q13_32=-4 THEN ALIM(17)=0;

          ELSE ALIM(17)= Q13_32;

          IF Q13_33I=-4 THEN CHSP(17)=0;

          ELSE CHSP(17)= Q13_33I;

          IF Q13_33M=-4 THEN CHSP(17)=0;

          ELSE CHSP(17)= Q13_33M;

          IF RCTOT95A=-4 THEN AFDC(17)=0;

          ELSE DO;

             IF RCTOT95A<0 THEN AFDC(17)=RCTOT95A;

             ELSE IF MOTOT95A<=0 THEN AFDC(17)=-3;

             ELSE AFDC(17)=RCTOT95A * MOTOT95A;

          END;

          IF RCTOT95F=-4 THEN FOOD(17)=0;

          ELSE DO;

             IF RCTOT95F<0 THEN FOOD(17)=RCTOT95F;

             ELSE IF MOTOT95F<=0 THEN FOOD(17)=-3;

             ELSE FOOD(17)=RCTOT95F * MOTOT95F;

          END;

          IF RCTOT95W=-4 THEN PUBLIC(17)=0;

          ELSE DO;

             IF RCTOT95W<0 THEN PUBLIC(17)=RCTOT95W;

             ELSE IF MOTOT95W<=0 THEN PUBLIC(17)=-3;

             ELSE PUBLIC(17)=RCTOT95W * MOTOT95W;

          END;

          IF R(57255.)=-4 THEN ED(17)=0;

          ELSE ED(17)=R(57255.);

          IF R(57257.)=-4 THEN EDSS(17)=0;

          ELSE EDSS(17)=R(57257.);

          IF Q13_70=-4 THEN VET(17)=0;

          ELSE VET(17)= Q13_70;

          IF R(57264.)=-4 THEN OTHER(17)=0;

          ELSE OTHER(17)=R(57264.);

          IF VET(17)>0 & OTHER(17)=VET(17) THEN OTHER(17)=0;

          IF Q13_92=-4 THEN RELWEL(17)=0;

          ELSE RELWEL(17)= Q13_92;

          IF Q13_92C=-4 THEN RELREG(17)=0;

          ELSE RELREG(17)= Q13_92C;

          FAMILY(17)=FAMSZ96; /* TO CREATE FAMILY SIZE (I.E. FAMSZ96)

                                SEARCH THRU THE HOUSEHOLD ENUMERATION

                                INCREMENT FAMILY SIZE, IF THE

                                RELATIONSHIP TO THE YOUTH IS A RELATIVE.

                                DO NOT INCREASE FAMILY SIZE, IF THE CODE

                                IS <0 OR (>=33 & <=36) OR =45 OR =46 OR

                                (>=50 & <=54) */

         DCL COMPONENT(19) FIXED DEC(9);

         DO I=17;

            MN(I,1)=0; MN(I,2)=0; MN(I,3)=0;

            FAMINC(I)=0;

            INCOME(I)=-3;

            COMPONENT(1)=MIL(I);  

            COMPONENT(2)=MILS(I);  

            COMPONENT(3)=WPS(I);   

            COMPONENT(4)=WPSS(I);  

            COMPONENT(5)=SEI(I);

            COMPONENT(6)=SEIS(I);  

            COMPONENT(7)=UI(I);    

            COMPONENT(8)=UIS(I);   

            COMPONENT(9)=ALIM(I);  

            COMPONENT(10)=CHSP(I); 

            COMPONENT(11)=AFDC(I); 

            COMPONENT(12)=PUBLIC(I);

            COMPONENT(13)=ED(I);   

            COMPONENT(14)=EDSS(I); 

            COMPONENT(15)=VET(I);  

            COMPONENT(16)=OTHER(I);

            COMPONENT(17)=RELWEL(I);

            COMPONENT(18)=RELREG(I);

            COMPONENT(19)=FOOD(I); 

            IF WEIGHT(I)=0 THEN DO;

               INCOME(I)=-5;

               CPS(I)=-5;

               LEVEL(I)=-5;

            END;

            ELSE DO;

                 DO K=1 TO 19;

                    IF COMPONENT(K)>-4 THEN DO;

                       IF COMPONENT(K)<0 THEN

                          MN(I,ABS(COMPONENT(K)))=MN(I,ABS(COMPONENT(K)))+1;

                       ELSE FAMINC(I)=FAMINC(I)+COMPONENT(K);

                     END;

                  END;  

               SUMN(I)=MN(I,1) + MN(I,2) + MN(I,3);

               IF SUMN(I)=0 THEN INCOME(I)=FAMINC(I);

               ELSE DO J=1 TO 3;

                   IF MN(I,J)>0 THEN INCOME(I)=-J;

               END;

    /* income trunc  */

     /*   IF INCOME(I) > 100000 THEN INCOME(I) = 500000; */

            IF FAMILY(I)>0 THEN DO;

                LEVEL(I)=TABLE(I,S(I),FAMILY(I));

                IF INCOME(I)>LEVEL(I) THEN CPS(I)=0;

                ELSE IF INCOME(I)>= 0 & INCOME(I)<=LEVEL(I) THEN CPS(I)=1;

                ELSE CPS(I)=-3;

            END;

          END;

        END;

   DO I=1 TO 3;

      IF MN(17,I)>0 THEN MN(17,I)=1;

   END;

   IF SUMN(17)>0 THEN SUMN(17)=1;

INCOME(17)=R(51660.)

CPS(17)=R(51661.)

LEVEL(17)=R(51662.)

1998 Variables

/*programming for the 1998 variable TNFI is done in SPSS.   Only question numbers are listed.*/

COMPUTE AFDC_CUR=-4

COMPUTE CHSP_CUR=-4

COMPUTE CHSPS_C=-4

COMPUTE CPS_CUR=-4

COMPUTE ED_CUR=-4

COMPUTE EDSS_CUR=-4

COMPUTE FAMILY_C=-4 

COMPUTE FAMINC_C=-4

COMPUTE FOOD_CUR=-4

COMPUTE INCOME_C=-4

COMPUTE LEVEL_C=-4

COMPUTE MIL_CUR=-4

COMPUTE MILS_CUR=-4

COMPUTE MN1701=-4

COMPUTE MN1702=-4

COMPUTE MN1703=-4

COMPUTE OTHER_C=-4

COMPUTE SSI_CUR=-4

COMPUTE RELREG_C=-4

COMPUTE RELWEL_C=-4

COMPUTE S_CUR=-4

COMPUTE SEI_CUR=-4

COMPUTE SEIS_CUR=-4

COMPUTE SUMN_CUR=-4

COMPUTE UI_CUR=-4

COMPUTE UIS_CUR=-4

COMPUTE VET_CUR=-4

COMPUTE WPS_CUR=-4

COMPUTE WPSS_CUR=-4

/* Several variables pertaining to recipiency from various government income programs were computed from */

/* a number of different variables in 1997, due to the change to an event history format for data collection.*/

/* these variables are as follows:  */

/* WKTOT97U = Total number of weeks R received unemployment compensation in calendar year 1997*/

/* RCTOT97U = Total amount of unemployment compensation R received in calendar year 1997*/

/* WKTOT97S = Total number of weeks R's spouse received unemployment compensation in calendar year 1997*/

/* RCTOT97U = Total amount of unemployment compensation R's spouse received in calendar year 1997*/

/* MOTOT97A = Total number of months R or spouse received AFDC payments in calendar year 1997*/

/* RCTOT97A = Total amount of AFDC R or spouse received in calendar year 1997*/

/* MOTOT97F = Total number of months R or spouse received government food stamps in calendar year 1997*/

/* RCTOT97F = Total amount of government food stamps R or spouse received in calendar year 1997*/

/* MOTOT97W = Total number of months R or spouse received other welfare or public assistance payments*/

/*                           in calendar year 1997*/

/* RCTOT97W = Total amount of other welfare or public assistance payments R or spouse received in*/

/*                         calendar year 1997*/

DO IF (Q13_3 = -4)

COMPUTE MIL_CUR=0

ELSE

COMPUTE MIL_CUR=Q13_3

END IF

DO IF (Q13_5 = -4)

COMPUTE WPS_CUR=0

ELSE

COMPUTE WPS_CUR=Q13_5

END IF

DO IF (Q13_9 = -4)

COMPUTE SEI_CUR=0

ELSE

COMPUTE SEI_CUR=Q13_9

END IF

DO IF (WKTOT97U = -4 AND RCTOT97U = -4)

COMPUTE UI_CUR=0

ELSE IF (WKTOT97U = -4 AND RCTOT97U = 0)

COMPUTE UI_CUR=0

ELSE IF (WKTOT97U > 0 AND RCTOT97U > 0)

COMPUTE UI_CUR=(WKTOT97U * RCTOT97U)

ELSE IF (WKTOT97U < 0)

COMPUTE UI_CUR=WKTOT97U

ELSE IF (RCTOT97U < 0)

COMPUTE UI_CUR=RCTOT97U

ELSE

COMPUTE UI_CUR=-3

END IF

DO IF (PAFLAGA EQ 1 OR Q13_16 = -4)

COMPUTE MILS_CUR=0

ELSE

COMPUTE MILS_CUR=Q13_16

END IF

DO IF (PAFLAGA EQ 1 OR Q13_18 = -4)

COMPUTE WPSS_CUR=0

ELSE

COMPUTE WPSS_CUR=Q13_18

END IF

DO IF (PAFLAGA EQ 1 OR Q13_24 = -4)

COMPUTE SEIS_CUR=0

ELSE

COMPUTE SEIS_CUR=Q13_24

END IF

DO IF (PAFLAGA EQ 1 OR (WKTOT97S = -4 AND RCTOT97S = -4))

COMPUTE UIS_CUR=0

ELSE IF (PAFLAGA EQ 1 OR (WKTOT97S = -4 AND RCTOT97S = 0))

COMPUTE UIS_CUR=0

ELSE IF (WKTOT97S > 0 AND RCTOT97S > 0)

COMPUTE UIS_CUR=(WKTOT97S * RCTOT97S)

ELSE IF (WKTOT97S < 0)

COMPUTE UIS_CUR=WKTOT97S

ELSE IF (RCTOT97S < 0)

COMPUTE UIS_CUR=RCTOT97S 

ELSE

COMPUTE UIS_CUR=-3

END IF

DO IF (Q13_33I = -4)

COMPUTE CHSP_CUR=0

ELSE

COMPUTE CHSP_CUR=Q13_33I

END IF

DO IF (PAFLAGA EQ 1 OR Q13_33M = -4)

COMPUTE CHSPS_C=0

ELSE

COMPUTE CHSPS_C=Q13_33M

END IF

DO IF (RCTOT97A EQ -4 OR RCTOT97A EQ 0)

COMPUTE AFDC_CUR=0

ELSE IF (MOTOT97A EQ -4 OR MOTOT97A EQ 0)

COMPUTE AFDC_CUR=0

ELSE IF (RCTOT97A < 0)

COMPUTE AFDC_CUR=RCTOT97A

ELSE IF (MOTOT97A < 0)

COMPUTE AFDC_CUR=MOTOT97A

ELSE IF (MOTOT97A <= 0)

COMPUTE AFDC_CUR=-3

ELSE

COMPUTE AFDC_CUR=(RCTOT97A * MOTOT97A)

END IF

DO IF (RCTOT97F EQ -4 OR RCTOT97F EQ 0)

COMPUTE FOOD_CUR=0

ELSE IF (MOTOT97F EQ -4 OR MOTOT97F EQ 0)

COMPUTE FOOD_CUR=0

ELSE IF (RCTOT97F < 0)

COMPUTE FOOD_CUR=RCTOT97F 

ELSE IF (MOTOT97F < 0)

COMPUTE FOOD_CUR=MOTOT97F 

ELSE IF (MOTOT97F <= 0)

COMPUTE FOOD_CUR=-3

ELSE

COMPUTE FOOD_CUR=(RCTOT97F * MOTOT97F)

END IF

DO IF (RCTOT97W EQ -4 OR RCTOT97W EQ 0)

COMPUTE SSI_CUR=0

ELSE IF (MOTOT97W EQ -4 OR MOTOT97W EQ 0)

COMPUTE SSI_CUR=0

ELSE IF (RCTOT97W < 0)

COMPUTE SSI_CUR=RCTOT97W 

ELSE IF (MOTOT97W < 0)

COMPUTE SSI_CUR=MOTOT97W 

ELSE IF (MOTOT97W <= 0)

COMPUTE SSI_CUR=-3

ELSE

COMPUTE SSI_CUR=(RCTOT97W * MOTOT97W)

END IF

DO IF (Q13_66 = -4)

COMPUTE ED_CUR=0

ELSE

COMPUTE ED_CUR=Q13_66

END IF

DO IF (PAFLAGA EQ 1 OR Q13_68 = -4)

COMPUTE EDSS_CUR=0

ELSE 

COMPUTE EDSS_CUR=Q13_68

END IF

DO IF (Q13_70A = -4) 

COMPUTE VET_CUR=0

ELSE 

COMPUTE VET_CUR=Q13_70A

END IF

DO IF (Q13_75 = -4) 

COMPUTE OTHER_C=0

ELSE 

COMPUTE OTHER_C=Q13_75

END IF

IF (VET_CUR > 0 AND OTHER_C = VET_CUR) OTHER_C=0

DO IF (Q13_92 = -4)

COMPUTE RELWEL_C=0

ELSE

COMPUTE RELWEL_C=Q13_92

END IF

DO IF (Q13_92C = -4)

COMPUTE RELREG_C=0

ELSE 

COMPUTE RELREG_C=Q13_92C

END IF

COMPUTE FAMILY_C=FAMSZ98 /* TO CREATE FAMILY SIZE (I.E. FAMSZ98) */

                            /*  SEARCH THRU THE HOUSEHOLD ENUMERATION */

                            /*  INCREMENT FAMILY SIZE, IF THE     */

                            /*  RELATIONSHIP TO THE YOUTH IS A RELATIVE. */

                            /*  DO NOT INCREASE FAMILY SIZE, IF THE CODE */

                            /*  IS <0 OR (>=33 & <=36) OR =45 OR =46 OR */

                            /*  (>=50 & <=54) */

COMPUTE MN1701=0 

COMPUTE MN1702=0 

COMPUTE MN1703=0

COMPUTE FAMINC_C=0

COMPUTE INCOME_C=-3

COMPUTE COMPO1=MIL_CUR   

COMPUTE COMPO2=MILS_CUR   

COMPUTE COMPO3=WPS_CUR    

COMPUTE COMPO4=WPSS_CUR   

COMPUTE COMPO5=SEI_CUR

COMPUTE COMPO6=SEIS_CUR   

COMPUTE COMPO7=UI_CUR     

COMPUTE COMPO8=UIS_CUR    

COMPUTE COMPO9=CHSP_CUR  

COMPUTE COMPO10=AFDC_CUR  

COMPUTE COMPO11=SSI_CUR

COMPUTE COMPO12=ED_CUR    

COMPUTE COMPO13=EDSS_CUR  

COMPUTE COMPO14=VET_CUR   

COMPUTE COMPO15=OTHER_C 

COMPUTE COMPO16=RELWEL_C

COMPUTE COMPO17=RELREG_C

COMPUTE COMPO18=FOOD_CUR

COMPUTE COMPO19=CHSPS_C

DO IF (WKTOT97U EQ -4 AND RCTOT97U GT 0)

COMPUTE UI_CUR=-3

COMPUTE COMPO7=-3

ELSE IF (WKTOT97U LT 0 AND WKTOT97U GT -4)

COMPUTE UI_CUR=-3

COMPUTE COMPO7=-3

END IF

DO IF (WKTOT97S EQ -4 AND RCTOT97S GT 0)

COMPUTE UIS_CUR=-3

COMPUTE COMPO8=-3

ELSE IF (WKTOT97S LT 0 AND WKTOT97S GT -4)

COMPUTE UIS_CUR=-3

COMPUTE COMPO8=-3

END IF

DO IF (MOTOT97A EQ -4 AND RCTOT97A GT 0)

COMPUTE AFDC_CUR=-3

COMPUTE COMPO10=-3

ELSE IF (MOTOT97A LT 0 AND MOTOT97A GT -4)

COMPUTE AFDC_CUR=-3

COMPUTE COMPO10=-3

END IF

DO IF (MOTOT97F EQ -4 AND RCTOT97F GT 0)

COMPUTE FOOD_CUR=-3

COMPUTE COMPO18=-3

ELSE IF (MOTOT97F LT 0 AND MOTOT97F GT -4)

COMPUTE FOOD_CUR=-3

COMPUTE COMPO18=-3

END IF

DO IF (MOTOT97W EQ -4 AND RCTOT97W GT 0)

COMPUTE SSI_CUR=-3

COMPUTE COMPO11=-3

ELSE IF (MOTOT97W LT 0 AND MOTOT97W GT -4)

COMPUTE SSI_CUR=-3

COMPUTE COMPO11=-3

END IF

DO REPEAT COMPO=COMPO1 TO COMPO19

DO IF (COMPO > -4)

DO IF (COMPO < 0 AND COMPO EQ -1)

COMPUTE MN1701=(MN1701+1)

ELSE IF (COMPO < 0 AND COMPO EQ -2)

COMPUTE MN1702=(MN1702+1)

ELSE IF (COMPO < 0 AND COMPO EQ -3)

COMPUTE MN1703=(MN1703+1)

ELSE

COMPUTE FAMINC_C=(FAMINC_C + COMPO)

END IF

END IF

END REPEAT 

DO IF (SUMN_CUR = 0)

COMPUTE INCOME_C=FAMINC_C

ELSE

DO IF (MN1703 > 0)

COMPUTE INCOME_C=-3

ELSE IF (MN1702 > 0)

COMPUTE INCOME_C=-2

ELSE IF (MN1701 > 0)

COMPUTE INCOME_C=-1

END IF

END IF

IF (PAFLAGA EQ -5) INCOME_C=-5

    /* INCOME TRUNC  */

/* IF (INCOME_C >= 161400) INCOME_C=1022003 */

END IF

DO IF (INCOME_C > LEVEL_C)

COMPUTE CPS_CUR=0

ELSE IF (INCOME_C >= 0 AND INCOME_C <= LEVEL_C)

COMPUTE CPS_CUR=1

ELSE

COMPUTE CPS_CUR=-3

END IF

DO REPEAT MN=MN1701 TO MN1703

IF (MN > 0) MN=1

END REPEAT PRINT

IF (SUMN_CUR > 0) SUMN_CUR=1

IF (PAFLAGA EQ -5) LEVEL_C=-5

IF (PAFLAGA EQ -5) CPS_CUR=-5

2000 Variables

/*programming for the 2000 variable TNFI is done in SPSS.   Only question numbers are listed.*/

COMPUTE afdc_cur=-4

COMPUTE chsp_cur=-4

COMPUTE chsps_c=-4

COMPUTE cps_cur=-4

COMPUTE ed_cur=-4

COMPUTE edss_cur=-4

COMPUTE family_c=-4

COMPUTE faminc_c=-4

COMPUTE food_cur=-4

COMPUTE income_c=-4

COMPUTE level_c=-4

COMPUTE mil_cur=-4

COMPUTE mils_cur=-4

COMPUTE mn1701=-4

COMPUTE mn1702=-4

COMPUTE mn1703=-4

COMPUTE other_c=-4

COMPUTE ssi_cur=-4

COMPUTE relreg_c=-4

COMPUTE relwel_c=-4

COMPUTE s_cur=-4

COMPUTE sei_cur=-4

COMPUTE seis_cur=-4

 COMPUTE sumn_cur=-4

COMPUTE ui_cur=-4

COMPUTE uis_cur=-4

COMPUTE vet_cur=-4

COMPUTE wps_cur=-4

COMPUTE wpss_cur=-4

COMPUTE wkcmp_c=-4

/* Several variables pertaining to recipiency from various government income programs were computed from                 */

/* a number of different variables in 1999, due to the change to an event history format for data collection.                   */

/* these variables are as follows:                                                                                                                                                 */

/* WKTOT99U = Total number of weeks R received unemployment compensation in calendar year 1999                   */

/* RCTOT99U = Total amount of unemployment compensation R received in calendar year 1999                               */

/* WKTOT99S = Total number of weeks R's spouse received unemployment compensation in calendar year 1999      */

/* RCTOT99U = Total amount of unemployment compensation R's spouse received in calendar year 1999                 */

/* MOTOT99A = Total number of months R or spouse received AFDC payments in calendar year 1999                     */

/* RCTOT99A = Total amount of AFDC R or spouse received in calendar year 1999                                                      */

/* MOTOT99F = Total number of months R or spouse received government food stamps in calendar year 1999         */

/* RCTOT99F = Total amount of government food stamps R or spouse received in calendar year 1999                        */

/* MOTOT99W = Total number of months R or spouse received other welfare or public assistance payments              */

/*                           in calendar year 1999                                                                                                                                 */

/* RCTOT99W = Total amount of other welfare or public assistance payments R or spouse received in                          */

                                                

do if (Q13_3 = -4)

COMPUTE mil_cur=0                               

else

COMPUTE mil_cur=Q13_3        

end if                                          

do if (Q13_5 = -4)

COMPUTE wps_cur=0                               

else

COMPUTE wps_cur=Q13_5

end if                                          

/* new series to incorporate new farm & bus income qs */ COMPUTE fjt_inc=fjt_141

do if (fjt_inc eq -4)

COMPUTE farm_cur=0

else

COMPUTE farm_cur=fjt_inc

end if

COMPUTE bpjt_inc=bp_141

do if (bpjt_inc eq -4)

COMPUTE bus_cur=0

else

COMPUTE bus_cur=bpjt_inc

end if

COMPUTE fbr_inc=q13_132d

do if (fbr_inc eq -4)

COMPUTE fbr_cur=0

else

COMPUTE fbr_cur=fbr_inc

end if

do if (Q13_9 = -4)

COMPUTE sei_cur=0                               

else

COMPUTE sei_cur=Q13_9

end if

if (farm_cur gt 0) sei_cur=(sei_cur+farm_cur)

if (bus_cur gt 0) sei_cur=(sei_cur+bus_cur)

if (fbr_cur gt 0) sei_cur=(sei_cur+fbr_cur)

do if (wktot99u = -4 and rctot99u = -4)

COMPUTE ui_cur=0

else if (wktot99u = -4 and rctot99u = 0)

COMPUTE ui_cur=0

else if (wktot99u > 0 and rctot99u > 0)

COMPUTE ui_cur=rctot99u

else if (wktot99u < 0)

COMPUTE ui_cur=wktot99u

else if (rctot99u < 0)

COMPUTE ui_cur=rctot99u

else

COMPUTE ui_cur=-3

end if

do if (paflaga eq 1 or Q13_16 = -4)

COMPUTE mils_cur=0

else

COMPUTE mils_cur=Q13_16

end if

do if (paflaga eq 1 or Q13_18 = -4)

COMPUTE wpss_cur=0

else

COMPUTE wpss_cur=Q13_18                            end if

do if (paflaga eq 1 or Q13_24 = -4)

COMPUTE seis_cur=0

else

COMPUTE seis_cur=Q13_24

end if

do if (paflaga eq 1 or (wktot99s = -4 and rctot99s = -4))   

COMPUTE uis_cur=0

else if 

(paflaga eq 1 or (wktot99s = -4 and rctot99s = 0))   

COMPUTE uis_cur=0

else if 

(wktot99s > 0 and rctot99s > 0)

COMPUTE uis_cur=rctot99s

else if 

(wktot99s < 0)

COMPUTE uis_cur=wktot99s

else if (rctot99s < 0)

COMPUTE uis_cur=rctot99s

else

COMPUTE uis_cur=-3

end if

do if (q13_31b = -4)

COMPUTE wkcmp_c=0

else

COMPUTE wkcmp_c=q13_31b

end if

do if (Q13_33I = -4)

COMPUTE chsp_cur=0

else

COMPUTE chsp_cur=Q13_33I

end if

do if (paflaga eq 1 or Q13_33M = -4)

COMPUTE chsps_c=0

else

COMPUTE chsps_c=Q13_33M

end if

do if (rctot99a eq -4 or rctot99a eq 0)

COMPUTE afdc_cur=0

else if (motot99a eq -4 or motot99a eq 0)

COMPUTE afdc_cur=0

else if (rctot99a < 0)

COMPUTE afdc_cur=rctot99a

else if (motot99a < 0)     

COMPUTE afdc_cur=motot99a

else if (motot99a <= 0)

COMPUTE afdc_cur=-3

else                                                     

COMPUTE afdc_cur=rctot99a

end if

do if (rctot99f eq -4 or rctot99f eq 0)       

COMPUTE food_cur=0

else if (motot99f eq -4 or motot99f eq 0)   

COMPUTE food_cur=0

else if (rctot99f < 0)     

COMPUTE food_cur=rctot99f

else if (motot99f < 0)            

 COMPUTE food_cur=motot99f

else if (motot99f <= 0)            

COMPUTE food_cur=-3

else                

COMPUTE food_cur=rctot99f                              end if

do if (rctot99w eq -4 or rctot99w eq 0) 

COMPUTE ssi_cur=0

else if (motot99w eq -4 or motot99w eq 0)  

COMPUTE ssi_cur=0

else if (rctot99w < 0)    

COMPUTE ssi_cur=rctot99w

else if (motot99w < 0)  

COMPUTE ssi_cur=motot99w

else if (motot99w <= 0)     

COMPUTE ssi_cur=-3

else

COMPUTE ssi_cur=rctot99w 

   end if

do if (Q13_66 = -4)

COMPUTE ed_cur=0

else  

COMPUTE ed_cur=Q13_66                

end if

do if (paflaga eq 1 or Q13_68 = -4) 

COMPUTE edss_cur=0

else           

COMPUTE edss_cur=Q13_68   

end if

do if (q13_70 = -4)  

COMPUTE vet_cur=0

else      

COMPUTE vet_cur=q13_70    

end if

do if (Q13_75 = -4)

COMPUTE other_c=0

else      

COMPUTE other_c=Q13_75      

end if

 if (vet_cur > 0 and other_c = vet_cur) other_c=0

do if (Q13_92 = -4) 

COMPUTE relwel_c=0

else    

COMPUTE relwel_c=Q13_92  

end if

 do if (Q13_92C = -4) 

COMPUTE relreg_c=0

else    

COMPUTE relreg_c=Q13_92C  

end if

compute family_c=famsz00 /* To create family size (i.e. famsz00) search thru the household enumeration.  Increment family size, if the relationship to the youth is a relative.  Do not increase family size, if the code is <0 or (>=33 & <=36) or =45 or =46 or (>=50 & <=54) */

COMPUTE mn1701=0

COMPUTE mn1702=0

COMPUTE mn1703=0 

COMPUTE faminc_c=0

COMPUTE income_c=-3       

COMPUTE compo1=mil_cur  

COMPUTE compo2=mils_cur       

COMPUTE compo3=wps_cur   

COMPUTE compo4=wpss_cur      

COMPUTE compo5=sei_cur

COMPUTE compo6=seis_cur          

COMPUTE compo7=ui_cur    

COMPUTE compo8=uis_cur                    

COMPUTE compo9=chsp_cur 

COMPUTE compo10=afdc_cur 

COMPUTE compo11=ssi_cur

COMPUTE compo12=ed_cur       

COMPUTE compo13=edss_cur 

COMPUTE compo14=vet_cur     

COMPUTE compo15=other_c

COMPUTE compo16=relwel_c 

COMPUTE compo17=relreg_c

COMPUTE compo18=food_cur 

COMPUTE compo19=chsps_c

COMPUTE compo20=wkcmp_c

do if (wktot99u eq -4 and rctot99u gt 0)     

COMPUTE ui_cur=-3

COMPUTE compo7=-3

else if (wktot99u lt 0 and wktot99u gt -4)     

COMPUTE ui_cur=-3    

COMPUTE compo7=-3

end if

do if (wktot99s eq -4 and rctot99s gt 0)

COMPUTE uis_cur=-3   

COMPUTE compo8=-3

else if (wktot99s lt 0 and wktot99s gt -4)   

COMPUTE uis_cur=-3         

COMPUTE compo8=-3

end if

do if (motot99a eq -4 and rctot99a gt 0)   

COMPUTE afdc_cur=-3        

COMPUTE compo10=-3

else if (motot99a lt 0 and motot99a gt -4)   

COMPUTE afdc_cur=-3  

COMPUTE compo10=-3

end if

do if (motot99f eq -4 and rctot99f gt 0) 

COMPUTE food_cur=-3  

COMPUTE compo18=-3

else if (motot99f lt 0 and motot99f gt -4) 

COMPUTE food_cur=-3 

COMPUTE compo18=-3

end if

do if (motot99w eq -4 and rctot99w gt 0)

COMPUTE ssi_cur=-3   

COMPUTE compo11=-3

else if (motot99w lt 0 and motot99w gt -4)     

COMPUTE ssi_cur=-3  

COMPUTE compo11=-3

end if 

do repeat compo=compo1 to compo20

do if (compo > -4)

do if (compo < 0 and compo eq -1)

COMPUTE mn1701=(mn1701+1)

else if (compo < 0 and compo eq -2) 

COMPUTE mn1702=(mn1702+1)

else if (compo < 0 and compo eq -3) 

COMPUTE mn1703=(mn1703+1)

else   

COMPUTE faminc_c=(faminc_c + compo)     .    end if

end if

end repeat print

COMPUTE sumn_cur=mn1701 + mn1702 + mn1703

do if (sumn_cur = 0) 

COMPUTE income_c=faminc_c

else

do if (mn1703 > 0)

COMPUTE income_c=-3

else if (mn1702 > 0)  

COMPUTE income_c=-2

else if (mn1701 > 0)   

COMPUTE income_c=-1   

end if

end if

if (paflaga eq -5) income_c=-5

  /* poverty status and level */

do if (income_c > level_c)   

COMPUTE cps_cur=0

else if (income_c >= 0 and income_c <= level_c)

COMPUTE cps_cur=1

else    

COMPUTE cps_cur=-3  

end if

do repeat mn=mn1701 to mn1703

if (mn > 0) mn=1

end repeat print

if (sumn_cur > 0) sumn_cur=1

if (paflaga eq -5) level_c=-5

if (paflaga eq -5) cps_cur=-5

2002 Variables

* SAS PROGRAM STATEMENTS FOR TOTAL NET FAMILY INCOME 2002;

afdc_cur=-4;

chsp_cur=-4;

chsps_c=-4;

cps_cur=-4;

ed_cur=-4;

edss_cur=-4;

family_c=-4;

faminc_c=-4;

food_cur=-4;

income_c=-4;

level_c=-4;

mil_cur=-4;

mils_cur=-4;

mn1701=-4;

mn1702=-4;

mn1703=-4;

other_c=-4;

ssi_cur=-4;

relreg_c=-4;

relwel_c=-4;

s_cur=-4;

sei_cur=-4;

seis_cur=-4;

sumn_cur=-4;

target_c=-4;

ui_cur=-4;

uis_cur=-4;

vet_cur=-4;

wps_cur=-4;

wpss_cur=-4;

wkcmp_c=-4;

dis_cur=-4;

ss_cur=-4;

/* Several variables pertaining to recipiency from various government income programs were computed from                 */

/* a number of different variables in 2001, due to the change to an event history format for data collection.                   */

/* these variables are as follows:                                                                                                                                                 */

/* WKTOT01U = Total number of weeks R received unemployment compensation in calendar year 2001                   */

/* RCTOT01U = Total amount of unemployment compensation R received in calendar year 2001                               */

/* WKTOT01S = Total number of weeks R's spouse received unemployment compensation in calendar year 2001      */

/* RCTOT01U = Total amount of unemployment compensation R's spouse received in calendar year 2001                 */

/* MOTOT01A = Total number of months R or spouse received AFDC payments in calendar year 2001                     */

/* RCTOT01A = Total amount of AFDC R or spouse received in calendar year 2001                                                      */

/* MOTOT01F = Total number of months R or spouse received government food stamps in calendar year 2001         */

/* RCTOT01F = Total amount of government food stamps R or spouse received in calendar year 2001                        */

/* MOTOT01W = Total number of months R or spouse received other welfare or public assistance payments              */

/*                           in calendar year 2001                                                                                                                                 */

/* RCTOT01W = Total amount of other welfare or public assistance payments R or spouse received in                          */

/*                         calendar year 2001                                                                                                                                        */

if (Q13_3 = -4) then mil_cur=0;

else mil_cur=Q13_3;

if (Q13_5 = -4) then wps_cur=0;

else wps_cur=Q13_5;

if (Q13_9 = -4) then sei_cur=0;

else sei_cur=Q13_9;

data compute1;

set compute;

if (wktot01u = -4 & rctot01u = -4) then ui_cur=0;

else if (wktot01u = -4 & rctot01u = 0) then ui_cur=0;

else if (wktot01u > 0 & rctot01u > 0) then ui_cur=rctot01u;

else if (wktot01u < 0) then ui_cur=wktot01u;

else if (rctot01u < 0) then ui_cur=rctot01u;

else ui_cur=-3;

if (paflaga = 1 | Q13_16 = -4) then mils_cur=0;

else mils_cur=Q13_16;

if (paflaga = 1 | Q13_18 = -4) then wpss_cur=0;

else wpss_cur=Q13_18;

if (paflaga = 1 | Q13_24 = -4) then seis_cur=0;

else seis_cur=Q13_24;

if (paflaga = 1 | (wktot01s = -4 & rctot01s = -4)) then uis_cur=0;

else if (paflaga = 1 | (wktot01s = -4 & rctot01s = 0)) then uis_cur=0;

else if (wktot01s > 0 & rctot01s > 0) then uis_cur=rctot01s;

else if (wktot01s < 0) then uis_cur=wktot01s;

else if (rctot01s < 0) then uis_cur=rctot01s;

else uis_cur=-3;

if (q13_31b = -4) then wkcmp_c=0;

else wkcmp_c=q13_31b;

if (Q13_33i = -4) then chsp_cur=0;

else chsp_cur=Q13_33i;

if (paflaga = 1 | Q13_33m = -4) then chsps_c=0;

else chsps_c=Q13_33m;

if (rctot01a = -4 | rctot01a = 0) then afdc_cur=0;

else if (motot01a = -4 | motot01a = 0) then afdc_cur=0;

else if (rctot01a < 0) then afdc_cur=rctot01a;

else if (motot01a < 0) then afdc_cur=motot01a;

else if (motot01a <= 0) then afdc_cur=-3;

else afdc_cur=rctot01a;

if (rctot01f = -4 | rctot01f = 0) then food_cur=0;

else if (motot01f = -4 | motot01f = 0) then food_cur=0;

else if (rctot01f < 0) then food_cur=rctot01f;

else if (motot01f < 0) then food_cur=motot01f;

else if (motot01f <= 0) then food_cur=-3;

else food_cur=rctot01f;

if (rctot01w = -4 | rctot01w = 0) then ssi_cur=0;

else if (motot01w = -4 | motot01w = 0) then ssi_cur=0;

else if (rctot01w < 0) then ssi_cur=rctot01w;

else if (motot01w < 0) then ssi_cur=motot01w;

else if (motot01w <= 0) then ssi_cur=-3;

else ssi_cur=rctot01w;

if (Q13_66 = -4) then ed_cur=0;

else ed_cur=Q13_66;

if (paflaga = 1 | Q13_68 = -4) then edss_cur=0;

else edss_cur=Q13_68;

if (q13_70_v = -4) then vet_cur=0;

else if (q13_70_v = -2) then vet_cur=q13_70_v;

else if (q13_70_v = -1) then vet_cur=q13_70_v;

else vet_cur=(q13_70_v * 12);

if (q13_70_d = -4) then dis_cur=0;

else if (q13_70_d = -2) then dis_cur=q13_70_d;

else if (q13_70_d = -1) then dis_cur=q13_70_d;

else dis_cur=(q13_70_d * 12);

if (q13_70_s = -4) then ss_cur=0;

else if (q13_70_s = -2) then ss_cur=q13_70_s;

else if (q13_70_s = -1) then ss_cur=q13_70_s;

else ss_cur=(q13_70_s * 12);

if (Q13_75 = -4) then other_c=0;

else other_c=Q13_75;

data compute2;

set compute1;

if (vet_cur > 0 & other_c = vet_cur) then other_c=0;

if (Q13_92 = -4) then relwel_c=0;

else relwel_c=Q13_92;

if (Q13_92c = -4) then relreg_c=0;

else relreg_c=Q13_92c;

family_c=famsz02;

/* TO CREATE FAMILY SIZE (I.E. FAMSZ02) SEARCH THRU THE HOUSEHOLD ENUMERATION

INCREMENT FAMILY SIZE, IF THE RELATIONSHIP TO THE YOUTH IS A RELATIVE.

DO NOT INCREASE FAMILY SIZE, IF THE CODE IS <0 OR (>=33 & <=36) OR =45 OR =46

OR (>=50 & <=54)*/

mn1701=0;

mn1702=0;

mn1703=0;

faminc_c=0;

income_c=-3;

compo1=mil_cur;

compo2=mils_cur;

compo3=wps_cur;

compo4=wpss_cur;

compo5=sei_cur;

compo6=seis_cur;

compo7=ui_cur;

compo8=uis_cur;

compo9=chsp_cur;

compo10=afdc_cur;

compo11=ssi_cur;

compo12=ed_cur;

compo13=edss_cur;

compo14=vet_cur;

compo15=other_c;

compo16=relwel_c;

compo17=relreg_c;

compo18=food_cur;

compo19=chsps_c;

compo20=wkcmp_c;

compo21=dis_cur;

compo22=ss_cur;

if (wktot01u = -4 & rctot01u > 0) then do;

ui_cur=-3;

compo7=-3;

end;

else if (wktot01u < 0 & wktot01u > -4) then do;

ui_cur=-3;

compo7=-3;

end;

if (wktot01s = -4 & rctot01s > 0) then do;

uis_cur=-3;

compo8=-3;

end;

else if (wktot01s < 0 & wktot01s > -4) then do;

uis_cur=-3;

compo8=-3;

end;

if (motot01a = -4 & rctot01a > 0) then do;

afdc_cur=-3;

compo10=-3;

end;

else if (motot01a < 0 & motot01a > -4) then do;

afdc_cur=-3;

compo10=-3;

end;

if (motot01f = -4 & rctot01f > 0) then do;

food_cur=-3;

compo18=-3;

end;

else if (motot01f < 0 & motot01f > -4) then do;

food_cur=-3;

compo18=-3;

end;

if (motot01w = -4 & rctot01w > 0) then do;

ssi_cur=-3;

compo11=-3;

end;

else if (motot01w < 0 & motot01w > -4) then do;

ssi_cur=-3;

compo11=-3;

end;

array compo (j) compo1 compo2 compo3 compo4 compo5 compo6 compo7

compo8 compo9 compo10 compo11 compo12 compo13 compo14

compo15 compo16 compo17 compo18 compo19 compo20

compo21 compo22;

do j=1 to 22;

if (compo > -4) then do;

if (compo < 0 & compo = -1) then mn1701=(mn1701+1);

else if (compo < 0 & compo = -2) then mn1702=(mn1702+1);

else if (compo < 0 & compo = -3) then mn1703=(mn1703+1);

else faminc_c=(faminc_c + compo);

end;

end;

sumn_cur=mn1701 + mn1702 + mn1703;

if (sumn_cur = 0) then income_c=faminc_c;

else do;

if (mn1703 > 0) then income_c=-3;

else if (mn1702 > 0) then income_c=-2;

else if (mn1701 > 0) then income_c=-1;

end;

if (paflaga = -5) then income_c=-5;

proc freq;

tables mn1701 mn1702 mn1703 sumn_cur;

if (income_c > level_c) then cps_cur=0;

else if (income_c >= 0 & income_c <= level_c) then cps_cur=1;

else cps_cur=-3;

array mn (k) mn1701 mn1702 mn1703;

do k=1 to 3;

if (mn > 0) then mn=1;

end;

if (sumn_cur > 0) then sumn_cur=1;

if (paflaga = -5) then level_c=-5;

if (paflaga = -5) then cps_cur=-5;  

  

2004 Variables

* SAS PROGRAM STATEMENTS FOR TOTAL NET FAMILY INCOME 2004;

afdc_cur=-4;

chsp_cur=-4;

chsps_c=-4;

cps_cur=-4;

ed_cur=-4;

edss_cur=-4;

family_c=-4;

faminc_c=-4;

food_cur=-4;

income_c=-4;

level_c=-4;

mil_cur=-4;

mils_cur=-4;

mn1701=-4;

mn1702=-4;

mn1703=-4;

other_c=-4;

ssi_cur=-4;

relreg_c=-4;

relwel_c=-4;

s_cur=-4;

sei_cur=-4;

seis_cur=-4;

sumn_cur=-4;

target_c=-4;

ui_cur=-4;

uis_cur=-4;

vet_cur=-4;

wps_cur=-4;

wpss_cur=-4;

wkcmp_c=-4;

dis_cur=-4;

ss_cur=-4;

* Federal Poverty Guidelines used in 2003 program apply to calendar year;

if (Q13_3 = -4) then mil_cur=0;

else mil_cur=Q13_3;

if (Q13_5 = -4) then wps_cur=0;

else wps_cur=Q13_5;

* new series to incorporate new farm & bus income qs;

fjt_inc=fjt_141;

if (fjt_inc = -4) then farm_cur=0;

else farm_cur=fjt_inc;

bpjt_inc=bp_141;

if (bpjt_inc = -4) then bus_cur=0;

else bus_cur=bpjt_inc;

fbr_inc=q13_132d;

if (fbr_inc = -4) then fbr_cur=0;

else fbr_cur=fbr_inc;

if (Q13_9 = -4) then sei_cur=0;

else sei_cur=Q13_9;

if (farm_cur > 0) then sei_cur=(sei_cur+farm_cur);

if (bus_cur > 0) then sei_cur=(sei_cur+bus_cur);

if (fbr_cur > 0) then sei_cur=(sei_cur+fbr_cur);

data compute1;

set compute;

if (wktot03u = -4 & rctot03u = -4) then ui_cur=0;

else if (wktot03u = -4 & rctot03u = 0) then ui_cur=0;

else if (wktot03u > 0 & rctot03u > 0) then ui_cur=rctot03u;

else if (wktot03u < 0) then ui_cur=wktot03u;

else if (rctot03u < 0) then ui_cur=rctot03u;

else ui_cur=-3;

if (paflaga = 1 | Q13_16 = -4) then mils_cur=0;

else mils_cur=Q13_16;

if (paflaga = 1 | Q13_18 = -4) then wpss_cur=0;

else wpss_cur=Q13_18;

if (paflaga = 1 | Q13_24 = -4) then seis_cur=0;

else seis_cur=Q13_24;

if (paflaga = 1 | (wktot03s = -4 & rctot03s = -4)) then uis_cur=0;

else if (paflaga = 1 | (wktot03s = -4 & rctot03s = 0)) then uis_cur=0;

else if (wktot03s > 0 & rctot03s > 0) then uis_cur=rctot03s;

else if (wktot03s < 0) then uis_cur=wktot03s;

else if (rctot03s < 0) then uis_cur=rctot03s;

else uis_cur=-3;

if (q13_31b = -4) then wkcmp_c=0;

else wkcmp_c=q13_31b;

if (Q13_33i = -4) then chsp_cur=0;

else chsp_cur=Q13_33i;

if (paflaga = 1 | Q13_33m = -4) then chsps_c=0;

else chsps_c=Q13_33m;

if (rctot03a = -4 | rctot03a = 0) then afdc_cur=0;

else if (motot03a = -4 | motot03a = 0) then afdc_cur=0;

else if (rctot03a < 0) then afdc_cur=rctot03a;

else if (motot03a < 0) then afdc_cur=motot03a;

else if (motot03a <= 0) then afdc_cur=-3;

else afdc_cur=rctot03a;

if (rctot03f = -4 | rctot03f = 0) then food_cur=0;

else if (motot03f = -4 | motot03f = 0) then food_cur=0;

else if (rctot03f < 0) then food_cur=rctot03f;

else if (motot03f < 0) then food_cur=motot03f;

else if (motot03f <= 0) then food_cur=-3;

else food_cur=rctot03f;

if (rctot03w = -4 | rctot03w = 0) then ssi_cur=0;

else if (motot03w = -4 | motot03w = 0) then ssi_cur=0;

else if (rctot03w < 0) then ssi_cur=rctot03w;

else if (motot03w < 0) then ssi_cur=motot03w;

else if (motot03w <= 0) then ssi_cur=-3;

else ssi_cur=rctot03w;

if (Q13_66 = -4) then ed_cur=0;

else ed_cur=Q13_66;

if (paflaga = 1 | Q13_68 = -4) then edss_cur=0;

else edss_cur=Q13_68;

if (q13_70_v = -4) then vet_cur=0;

else if (q13_70_v = -2) then vet_cur=q13_70_v;

else if (q13_70_v = -1) then vet_cur=q13_70_v;

else vet_cur=(q13_70_v * 12);

if (q13_70_d = -4) then dis_cur=0;

else if (q13_70_d = -2) then dis_cur=q13_70_d;

else if (q13_70_d = -1) then dis_cur=q13_70_d;

else dis_cur=(q13_70_d * 12);

if (q13_70_s = -4) then ss_cur=0;

else if (q13_70_s = -2) then ss_cur=q13_70_s;

else if (q13_70_s = -1) then ss_cur=q13_70_s;

else ss_cur=(q13_70_s * 12);

if (Q13_75 = -4) then other_c=0;

else other_c=Q13_75;

data compute2;

set compute1;

if (vet_cur > 0 & other_c = vet_cur) then other_c=0;

if (Q13_92 = -4) then relwel_c=0;

else relwel_c=Q13_92;

if (Q13_92c = -4) then relreg_c=0;

else relreg_c=Q13_92c;

family_c=famsz04;

/* TO CREATE FAMILY SIZE (I.E. FAMSZ04) SEARCH THRU THE HOUSEHOLD ENUMERATION

INCREMENT FAMILY SIZE, IF THE RELATIONSHIP TO THE YOUTH IS A RELATIVE.

DO NOT INCREASE FAMILY SIZE, IF THE CODE IS <0 OR (>=33 & <=36) OR =45 OR =46 OR

(>=50 & <=54)*/

mn1701=0;

mn1702=0;

mn1703=0;

faminc_c=0;

income_c=-3;

compo1=mil_cur;

compo2=mils_cur;

compo3=wps_cur;

compo4=wpss_cur;

compo5=sei_cur;

compo6=seis_cur;

compo7=ui_cur;

compo8=uis_cur;

compo9=chsp_cur;

compo10=afdc_cur;

compo11=ssi_cur;

compo12=ed_cur;

compo13=edss_cur;

compo14=vet_cur;

compo15=other_c;

compo16=relwel_c;

compo17=relreg_c;

compo18=food_cur;

compo19=chsps_c;

compo20=wkcmp_c;

compo21=dis_cur;

compo22=ss_cur;

if (wktot03u = -4 & rctot03u > 0) then do;

ui_cur=-3;

compo7=-3;

end;

else if (wktot03u < 0 & wktot03u > -4) then do;

ui_cur=-3;

compo7=-3;

end;

if (wktot03s = -4 & rctot03s > 0) then do;

uis_cur=-3;

compo8=-3;

end;

else if (wktot03s < 0 & wktot03s > -4) then do;

uis_cur=-3;

compo8=-3;

end;

if (motot03a = -4 & rctot03a > 0) then do;

afdc_cur=-3;

compo10=-3;

end;

else if (motot03a < 0 & motot03a > -4) then do;

afdc_cur=-3;

compo10=-3;

end;

if (motot03f = -4 & rctot03f > 0) then do;

food_cur=-3;

compo18=-3;

end;

else if (motot03f < 0 & motot03f > -4) then do;

food_cur=-3;

compo18=-3;

end;

if (motot03w = -4 & rctot03w > 0) then do;

ssi_cur=-3;

compo11=-3;

end;

else if (motot03w < 0 & motot03w > -4) then do;

ssi_cur=-3;

compo11=-3;

end;

array compo (j) compo1 compo2 compo3 compo4 compo5 compo6 compo7

compo8 compo9 compo10 compo11 compo12 compo13 compo14

compo15 compo16 compo17 compo18 compo19 compo20

compo21 compo22;

do j=1 to 22;

if (compo > -4) then do;

if (compo < 0 & compo = -1) then mn1701=(mn1701+1);

else if (compo < 0 & compo = -2) then mn1702=(mn1702+1);

else if (compo < 0 & compo = -3) then mn1703=(mn1703+1);

else faminc_c=(faminc_c + compo);

end;

end;

sumn_cur=mn1701 + mn1702 + mn1703;

if (sumn_cur = 0) then income_c=faminc_c;

else do;

if (mn1703 > 0) then income_c=-3;

else if (mn1702 > 0) then income_c=-2;

else if (mn1701 > 0) then income_c=-1;

end;

if (paflaga = -5) then income_c=-5;

proc freq; tables vet_cur other_c;

proc freq;

tables mn1701 mn1702 mn1703 sumn_cur;

data truncate;

set compute2;

if (income_c >= 250200);

data compute3;

set compute2;

incom_ct=income_c;

if (income_c >= 250200) then incom_ct=408473;

array mn (k) mn1701 mn1702 mn1703;

do k=1 to 3;

if (mn > 0) then mn=1;

end;

if (sumn_cur > 0) then sumn_cur=1;

if (paflaga = -5) then level_c=-5;

if (paflaga = -5) then cps_cur=-5;

2006 Variables

Total Net Family Income and Poverty Status in Calendar Year 2005 Incorporating Estimates

In the 2006 interview, respondents who didn’t know many specific income amounts were asked to estimate those amounts using self-reported ranges and if necessary, unfolding brackets. Respondents who refused to report many specific income amounts were asked unfolding bracket questions as well (see for example T09123.00 - T09131.00). The Total Net Family Income variable for calendar year 2005 (T09878.00) incorporates these estimates. The mid-point of self-reported ranges was used if available. Similarly, the mid-point of unfolding brackets were used where necessary and available. If a respondent reported that an income value was higher than the high bracket, the mean of valid values reported above the high bracket was used. For example, if a respondent reported that an income value was higher than the high bracket, and the high bracket was $50,000, the mean of all valid values reported over $50,000 was assigned.

The Poverty Status variable for calendar year 2005 (T09879.00) is created using the enhanced Total Net Family Income variable described above. Using these estimates where available significantly reduces the magnitude of non-response in both the Total Net Family Income and Poverty Status variables.

The decision rules for using estimates in individual income items are as follows:

If self-reported ranges are given and (example T09126.00, T09128.00):

upper/lower values are in proper order, midpoint is used;

ranges are given backwards, the values are reversed and midpoint is used;

the same value is given for upper/lower self-reported range value, that single value is used;

If unfolding brackets are answered (low bracket < entry value < high bracket) and (example T09129.00-T09131.00):

r reports less than entry value and less than low bracket, then half of low bracket value is used (midpoint between low bracket and 0)

r reports less than entry value but greater than low bracket value, midpoint between low bracket and entry value is used;

r reports greater than entry value but less than high bracket value, midpoint between entry value and high bracket is used;

r reports greater than entry value and greater than high bracket value, the mean of valid responses above the high bracket value is used.

weight06=1;
if curyr=-4 then weight06=0;

* add to paflag for any missed;

paflaga = paflag;
if (rel01 = 33 | rel02 = 33 | rel03 = 33 | rel04 = 33 | rel05 = 33
| rel06 = 33 | rel07 = 33 | rel08 = 33 | rel09 = 33 | rel10 = 33
| rel11 = 33 | rel12 = 33 | rel13 = 33 | rel14 = 33
| rel15 = 33) then paflaga=1;
if (paflaga = .) then paflaga=-5;

spflaga = 0;
if (rel01 = 1 | rel02 = 1 | rel03 = 1 | rel04 = 1 | rel05 = 1
| rel06 = 1 | rel07 = 1 | rel08 = 1 | rel09 = 1 | rel10 = 1
| rel11 = 1 | rel12 = 1 | rel13 = 1 | rel14 = 1
| rel15 = 1) then spflaga=1;

if (spflag = .) then spflag=-5;
if (spflag = -5) then spflaga=-5;

* compute recipiency variables;

rctot05u = ucdol105;
if (paflaga = -5) then rctot05u=-5;

if (ucdol105 = .) then rctot05u=-4;
if (ucdol105 = .) then wktot05u=-4;

wktot05u = 0;
if (dujn0605 > 0) then wktot05u=4.3;
if (dufb0605 > 0) then wktot05u=(wktot05u + 4.3);
if (dumr0605 > 0) then wktot05u=(wktot05u + 4.3);
if (duar0605 > 0) then wktot05u=(wktot05u + 4.3);
if (dumy0605 > 0) then wktot05u=(wktot05u + 4.3);
if (duju0605 > 0) then wktot05u=(wktot05u + 4.3);
if (dujl0605 > 0) then wktot05u=(wktot05u + 4.3);
if (duag0605 > 0) then wktot05u=(wktot05u + 4.3);
if (dusp0605 > 0) then wktot05u=(wktot05u + 4.3);
if (duot0605 > 0) then wktot05u=(wktot05u + 4.3);
if (dunv0605 > 0) then wktot05u=(wktot05u + 4.3);
if (dudc0605 > 0) then wktot05u=(wktot05u + 4.3);
if (wktot05u = 0) then wktot05u=-4;
if (paflaga = -5) then wktot05u=-5;

rctot05s = spdol105;
if (paflaga = -5) then rctot05s=-5;

if (spdol105 = .) then rctot05s=-4;
if (spdol105 = .) then wktot05s=-4;

wktot05s = 0;
if (tsjn0605 > 0) then wktot05s=4.3;
if (tsfb0605 > 0) then wktot05s=(wktot05s + 4.3);
if (tsmr0605 > 0) then wktot05s=(wktot05s + 4.3);
if (tsar0605 > 0) then wktot05s=(wktot05s + 4.3);
if (tsmy0605 > 0) then wktot05s=(wktot05s + 4.3);
if (tsju0605 > 0) then wktot05s=(wktot05s + 4.3);
if (tsjl0605 > 0) then wktot05s=(wktot05s + 4.3);
if (tsag0605 > 0) then wktot05s=(wktot05s + 4.3);
if (tssp0605 > 0) then wktot05s=(wktot05s + 4.3);
if (tsot0605 > 0) then wktot05s=(wktot05s + 4.3);
if (tsnv0605 > 0) then wktot05s=(wktot05s + 4.3);
if (tsdc0605 > 0) then wktot05s=(wktot05s + 4.3);
if (wktot05s = 0) then wktot05s=-4;
if (paflaga = -5) then wktot05s=-5;

rctot05w = ssdol105;
if (paflaga = -5) then rctot05w=-5;

if (ssdol105 = .) then rctot05w=-4;
if (ssdol105 = .) then wktot05w=-4;

motot05w = 0;
if (dsjn0605 > 0) then motot05w=1;
if (dsfb0605 > 0) then motot05w=(motot05w + 1);
if (dsmr0605 > 0) then motot05w=(motot05w + 1);
if (dsar0605 > 0) then motot05w=(motot05w + 1);
if (dsmy0605 > 0) then motot05w=(motot05w + 1);
if (dsju0605 > 0) then motot05w=(motot05w + 1);
if (dsjl0605 > 0) then motot05w=(motot05w + 1);
if (dsag0605 > 0) then motot05w=(motot05w + 1);
if (dssp0605 > 0) then motot05w=(motot05w + 1);
if (dsot0605 > 0) then motot05w=(motot05w + 1);
if (dsnv0605 > 0) then motot05w=(motot05w + 1);
if (dsdc0605 > 0) then motot05w=(motot05w + 1);
if (motot05w = 0) then motot05w=-4;
if (paflaga = -5) then motot05w=-5;

rctot05a = adol105;
if (paflaga = -5) then rctot05a=-5;

if (adol105 = .) then rctot05a=-4;
if (adol105 = .) then wktot05a=-4;

motot05a = 0;
if (dajn0605 > 0) then motot05a=1;
if (dafb0605 > 0) then motot05a=(motot05a + 1);
if (damr0605 > 0) then motot05a=(motot05a + 1);
if (daar0605 > 0) then motot05a=(motot05a + 1);
if (damy0605 > 0) then motot05a=(motot05a + 1);
if (daju0605 > 0) then motot05a=(motot05a + 1);
if (dajl0605 > 0) then motot05a=(motot05a + 1);
if (daag0605 > 0) then motot05a=(motot05a + 1);
if (dasp0605 > 0) then motot05a=(motot05a + 1);
if (daot0605 > 0) then motot05a=(motot05a + 1);
if (danv0605 > 0) then motot05a=(motot05a + 1);
if (dadc0605 > 0) then motot05a=(motot05a + 1);
if (motot05a = 0) then motot05a=-4;
if (paflaga = -5) then motot05a=-5;

rctot05f = fsdol105;
if (paflaga = -5) then rctot05f=-5;

if (fsdol105 = .) then rctot05f=-4;
if (fsdol105 = .) then wktot05f=-4;

motot05f = 0;
if (dfjn0605 > 0) then motot05f=1 ;
if (dffb0605 > 0) then motot05f=(motot05f + 1);
if (dfmr0605 > 0) then motot05f=(motot05f + 1);
if (dfar0605 > 0) then motot05f=(motot05f + 1);
if (dfmy0605 > 0) then motot05f=(motot05f + 1);
if (dfju0605 > 0) then motot05f=(motot05f + 1);
if (dfjl0605 > 0) then motot05f=(motot05f + 1);
if (dfag0605 > 0) then motot05f=(motot05f + 1);
if (dfsp0605 > 0) then motot05f=(motot05f + 1);
if (dfot0605 > 0) then motot05f=(motot05f + 1);
if (dfnv0605 > 0) then motot05f=(motot05f + 1);
if (dfdc0605 > 0) then motot05f=(motot05f + 1);
if (motot05f = 0) then motot05f=-4;
if (paflaga = -5) then motot05f=-5;

* PROGRAM STATEMENTS FOR TOTAL NET FAMILY INCOME 2005;

afdc_cur=-4;
chsp_cur=-4;
chsps_c=-4;
cps_cur=-4;
ed_cur=-4;
edss_cur=-4;
family_c=-4;
faminc_c=-4;
food_cur=-4;
income_c=-4;
level_c=-4;
mil_cur=-4;
mils_cur=-4;
mn1701=-4;
mn1702=-4;
mn1703=-4;
other_c=-4;
ssi_cur=-4;
relreg_c=-4;
relwel_c=-4;
s_cur=-4;
sei_cur=-4;
seis_cur=-4;
sumn_cur=-4;
target_c=-4;
ui_cur=-4;
uis_cur=-4;
vet_cur=-4;
wps_cur=-4;
wpss_cur=-4;
wkcmp_c=-4;
dis_cur=-4;
ss_cur=-4;

* Poverty status and level

s_cur=1;

if (Q13_3 = -4) then mil_cur=0;
else mil_cur=Q13_3;

if (Q13_5 = -4) then wps_cur=0;
else wps_cur=Q13_5;

if (Q13_9 = -4) then sei_cur=0;
else sei_cur=Q13_9;

proc sort; by id;

data compute1;
set compute;
if (wktot05u = -4 & rctot05u = -4) then ui_cur=0;
else if (wktot05u = -4 & rctot05u = 0) then ui_cur=0;
else if (wktot05u > 0 & rctot05u > 0) then ui_cur=rctot05u;
else if (wktot05u < 0) then ui_cur=wktot05u;
else if (rctot05u < 0) then ui_cur=rctot05u;
else ui_cur=-3;

if (paflaga = 1 | Q13_16 = -4) then mils_cur=0;
else mils_cur=Q13_16;

if (paflaga = 1 | Q13_18 = -4) then wpss_cur=0;
else wpss_cur=Q13_18;

if (paflaga = 1 | Q13_24 = -4) then seis_cur=0;
else seis_cur=Q13_24;

if (paflaga = 1 | (wktot05s = -4 & rctot05s = -4)) then uis_cur=0;
else if (paflaga = 1 | (wktot05s = -4 & rctot05s = 0)) then uis_cur=0;
else if (wktot05s > 0 & rctot05s > 0) then uis_cur=rctot05s;
else if (wktot05s < 0) then uis_cur=wktot05s;
else if (rctot05s < 0) then uis_cur=rctot05s;
else uis_cur=-3;

if (q13_31b = -4) then wkcmp_c=0;
else wkcmp_c=q13_31b;

if (Q13_33i = -4) then chsp_cur=0;
else chsp_cur=Q13_33i;

if (paflaga = 1 | Q13_33m = -4) then chsps_c=0;
else chsps_c=Q13_33m;

if (rctot05a = -4 | rctot05a = 0) then afdc_cur=0;
else if (motot05a = -4 | motot05a = 0) then afdc_cur=0;
else if (rctot05a < 0) then afdc_cur=rctot05a;
else if (motot05a < 0) then afdc_cur=motot05a;
else if (motot05a <= 0) then afdc_cur=-3;
else afdc_cur=rctot05a;

if (rctot05f = -4 | rctot05f = 0) then food_cur=0;
else if (motot05f = -4 | motot05f = 0) then food_cur=0;
else if (rctot05f < 0) then food_cur=rctot05f;
else if (motot05f < 0) then food_cur=motot05f;
else if (motot05f <= 0) then food_cur=-3;
else food_cur=rctot05f;

if (rctot05w = -4 | rctot05w = 0) then ssi_cur=0;
else if (motot05w = -4 | motot05w = 0) then ssi_cur=0;
else if (rctot05w < 0) then ssi_cur=rctot05w;
else if (motot05w < 0) then ssi_cur=motot05w;
else if (motot05w <= 0) then ssi_cur=-3;
else ssi_cur=rctot05w;

if (Q13_66 = -4) then ed_cur=0;
else ed_cur=Q13_66;

if (paflaga = 1 | Q13_68 = -4) then edss_cur=0;
else edss_cur=Q13_68;

if (q13_70_v = -4) then vet_cur=0;
else if (q13_70_v = -2) then vet_cur=q13_70_v;
else if (q13_70_v = -1) then vet_cur=q13_70_v;
else vet_cur=(q13_70_v * 12);

if (q13_70_d = -4) then dis_cur=0;
else if (q13_70_d = -2) then dis_cur=q13_70_d;
else if (q13_70_d = -1) then dis_cur=q13_70_d;
else dis_cur=(q13_70_d * 12);

if (q13_70_s = -4) then ss_cur=0;
else if (q13_70_s = -2) then ss_cur=q13_70_s;
else if (q13_70_s = -1) then ss_cur=q13_70_s;
else ss_cur=(q13_70_s * 12);

if (Q13_75 = -4) then other_c=0;
else other_c=Q13_75;

data compute2;
set compute1;

if (vet_cur > 0 & other_c = vet_cur) then other_c=0;

if (Q13_92 = -4) then relwel_c=0;
else relwel_c=Q13_92;

if (Q13_92c = -4) then relreg_c=0;
else relreg_c=Q13_92c;

family_c=famsz06;

/* TO CREATE FAMILY SIZE (I.E. FAMSZ04) SEARCH THRU THE HOUSEHOLD ENUMERATION
INCREMENT FAMILY SIZE, IF THE RELATIONSHIP TO THE YOUTH IS A RELATIVE.
DO NOT INCREASE FAMILY SIZE, IF THE CODE IS <0 OR (>=33 & <=36) OR =45 OR =46 OR
(>=50 & <=54)*/

mn1701=0;
mn1702=0;
mn1703=0;
faminc_c=0;
income_c=-3;
compo1=mil_cur;
compo2=mils_cur;
compo3=wps_cur;
compo4=wpss_cur;
compo5=sei_cur;
compo6=seis_cur;
compo7=ui_cur;
compo8=uis_cur;
compo9=chsp_cur;
compo10=afdc_cur;
compo11=ssi_cur;
compo12=ed_cur;
compo13=edss_cur;
compo14=vet_cur;
compo15=other_c;
compo16=relwel_c;
compo17=relreg_c;
compo18=food_cur;
compo19=chsps_c;
compo20=wkcmp_c;
compo21=dis_cur;
compo22=ss_cur;

if (wktot05u = -4 & rctot05u > 0) then do;
ui_cur=-3;
compo7=-3;
end;
else if (wktot05u < 0 & wktot05u > -4) then do;
ui_cur=-3;
compo7=-3;
end;

if (wktot05s = -4 & rctot05s > 0) then do;
uis_cur=-3;
compo8=-3;
end;
else if (wktot05s < 0 & wktot05s > -4) then do;
uis_cur=-3;
compo8=-3;
end;

if (motot05a = -4 & rctot05a > 0) then do;
afdc_cur=-3;
compo10=-3;
end;
else if (motot05a < 0 & motot05a > -4) then do;
afdc_cur=-3;
compo10=-3;
end;

if (motot05f = -4 & rctot05f > 0) then do;
food_cur=-3;
compo18=-3;
end;
else if (motot05f < 0 & motot05f > -4) then do;
food_cur=-3;
compo18=-3;
end;

if (motot05w = -4 & rctot05w > 0) then do;
ssi_cur=-3;
compo11=-3;
end;
else if (motot05w < 0 & motot05w > -4) then do;
ssi_cur=-3;
compo11=-3;
end;

array compo (j) compo1 compo2 compo3 compo4 compo5 compo6 compo7
compo8 compo9 compo10 compo11 compo12 compo13 compo14
compo15 compo16 compo17 compo18 compo19 compo20
compo21 compo22;

do j=1 to 22;
if (compo > -4) then do;
if (compo < 0 & compo = -1) then mn1701=(mn1701+1);
else if (compo < 0 & compo = -2) then mn1702=(mn1702+1);
else if (compo < 0 & compo = -3) then mn1703=(mn1703+1);
else faminc_c=(faminc_c + compo);
end;
end;

sumn_cur=mn1701 + mn1702 + mn1703;

if (sumn_cur = 0) then income_c=faminc_c;
else do;
if (mn1703 > 0) then income_c=-3;
else if (mn1702 > 0) then income_c=-2;
else if (mn1701 > 0) then income_c=-1;
end;

if (paflaga = -5) then income_c=-5;

data compute3;
set compute2;
incom_ct=income_c;
if (income_c >= 279000) then incom_ct=527631;

if (income_c > level_c) then cps_cur=0;
else if (income_c >= 0 & income_c <= level_c) then cps_cur=1;
else cps_cur=-3;

array mn (k) mn1701 mn1702 mn1703;

do k=1 to 3;
if (mn > 0) then mn=1;
end;

if (sumn_cur > 0) then sumn_cur=1;

if (paflaga = -5) then level_c=-5;
if (paflaga = -5) then cps_cur=-5;

2008 Variables

* PROGRAM STATEMENTS FOR TOTAL NET FAMILY INCOME 2007;
 

afdc_cur=-4;
chsp_cur=-4;
chsps_c=-4;
cps_cur=-4;
ed_cur=-4;
edss_cur=-4;
family_c=-4;
faminc_c=-4;
food_cur=-4;
income_c=-4;
level_c=-4;
mil_cur=-4;
mils_cur=-4;
mn1701=-4;
mn1702=-4;
mn1703=-4;
other_c=-4;
ssi_cur=-4;
relreg_c=-4;
relwel_c=-4;
s_cur=-4;
sei_cur=-4;
seis_cur=-4;
sumn_cur=-4;
target_c=-4;
ui_cur=-4;
uis_cur=-4;
vet_cur=-4;
wps_cur=-4;
wpss_cur=-4;
wkcmp_c=-4;
dis_cur=-4;
ss_cur=-4;

if (Q13_3 = -4) then mil_cur=0;
else mil_cur=Q13_3;

if (Q13_5 = -4) then wps_cur=0;
else wps_cur=Q13_5;

fjt_inc=fjt_141;

if (fjt_inc = -4) then farm_cur=0;

                    else farm_cur=fjt_inc;

bpjt_inc=bp_141;
if (bpjt_inc = -4) then bus_cur=0;

                    else bus_cur=bpjt_inc;

fbr_inc=q13_132d;
if (fbr_inc = -4) then fbr_cur=0;

                    else fbr_cur=fbr_inc;

if (Q13_9 = -4) then sei_cur=0;
                    else sei_cur=Q13_9;

if (farm_cur > 0) then sei_cur=(sei_cur+farm_cur);
if (bus_cur > 0)  then sei_cur=(sei_cur+bus_cur);
if (fbr_cur > 0)  then sei_cur=(sei_cur+fbr_cur);

proc sort; by id;

data compute1;
set compute;

if (wktot07u = -4 & rctot07u = -4) then ui_cur=0;
else if (wktot07u = -4 & rctot07u = 0) then ui_cur=0;
else if (wktot07u > 0 & rctot07u > 0) then ui_cur=rctot07u;
else if (wktot07u < 0) then ui_cur=wktot07u;
else if (rctot07u < 0) then ui_cur=rctot07u;
else ui_cur=-3;

if (paflaga = 1 | Q13_16 = -4) then mils_cur=0;
else mils_cur=Q13_16;

if (paflaga = 1 | Q13_18 = -4) then wpss_cur=0;
else wpss_cur=Q13_18;

if (paflaga = 1 | Q13_24 = -4) then seis_cur=0;
else seis_cur=Q13_24;

if (paflaga = 1 | (wktot07s = -4 & rctot07s = -4)) then uis_cur=0;
else if (paflaga = 1 | (wktot07s = -4 & rctot07s = 0)) then uis_cur=0;
else if (wktot07s > 0 & rctot07s > 0) then uis_cur=rctot07s;
else if (wktot07s < 0) then uis_cur=wktot07s;
else if (rctot07s < 0) then uis_cur=rctot07s;
else uis_cur=-3;

if (q13_31b = -4) then wkcmp_c=0;
else wkcmp_c=q13_31b;

if (Q13_33i = -4) then chsp_cur=0;
else chsp_cur=Q13_33i;

if (paflaga = 1 | Q13_33m = -4) then chsps_c=0;
else chsps_c=Q13_33m;

if (rctot07a = -4 | rctot07a = 0) then afdc_cur=0;
else if (motot07a = -4 | motot07a = 0) then afdc_cur=0;
else if (rctot07a < 0) then afdc_cur=rctot07a;
else if (motot07a < 0) then afdc_cur=motot07a;
else if (motot07a <= 0) then afdc_cur=-3;
else afdc_cur=rctot07a;

if (rctot07f = -4 | rctot07f = 0) then food_cur=0;
else if (motot07f = -4 | motot07f = 0) then food_cur=0;
else if (rctot07f < 0) then food_cur=rctot07f;
else if (motot07f < 0) then food_cur=motot07f;
else if (motot07f <= 0) then food_cur=-3;
else food_cur=rctot07f;

if (rctot07w = -4 | rctot07w = 0) then ssi_cur=0;
else if (motot07w = -4 | motot07w = 0) then ssi_cur=0;
else if (rctot07w < 0) then ssi_cur=rctot07w;
else if (motot07w < 0) then ssi_cur=motot07w;
else if (motot07w <= 0) then ssi_cur=-3;
else ssi_cur=rctot07w;

if (Q13_66 = -4) then ed_cur=0;
else ed_cur=Q13_66;

if (paflaga = 1 | Q13_68 = -4) then edss_cur=0;
else edss_cur=Q13_68;

if (q13_70_v = -4) then vet_cur=0;
else if (q13_70_v = -2) then vet_cur=q13_70_v;
else if (q13_70_v = -1) then vet_cur=q13_70_v;
else vet_cur=(q13_70_v * q13_70a_v);*replaced 12 by q13_70a_v;

if (q13_70_d = -4) then dis_cur=0;
else if (q13_70_d = -2) then dis_cur=q13_70_d;
else if (q13_70_d = -1) then dis_cur=q13_70_d;
else dis_cur=(q13_70_d * q13_70a_d);*replaced 12 by q13_70a_d;

 if (q13_70_s = -4) then ss_cur=0;
else if (q13_70_s = -2) then ss_cur=q13_70_s;
else if (q13_70_s = -1) then ss_cur=q13_70_s;
else ss_cur=(q13_70_s * q13_70a_s);*replaced 12 by q13_70a_s;

 if (Q13_75 = -4) then other_c=0;
else other_c=Q13_75;

data compute2;
set compute1;

 if (vet_cur > 0 & other_c = vet_cur) then other_c=0;

 if (Q13_92 = -4) then relwel_c=0;
else relwel_c=Q13_92;

 if (Q13_92c = -4) then relreg_c=0;
else relreg_c=Q13_92c;

 family_c=famsz08;

 /* TO CREATE FAMILY SIZE (I.E. FAMSZ08) SEARCH THRU THE HOUSEHOLD ENUMERATION INCREMENT FAMILY SIZE, IF THE RELATIONSHIP TO THE YOUTH IS A RELATIVE.  DO NOT INCREASE FAMILY SIZE, IF THE CODE IS <0 OR (>=33 & <=36) OR =45 OR =46 OR (>=50 & <=54)*/

mn1701=0;
mn1702=0;
mn1703=0;
faminc_c=0;
income_c=-3;
compo1=mil_cur;
compo2=mils_cur;
compo3=wps_cur;
compo4=wpss_cur;
compo5=sei_cur;
compo6=seis_cur;
compo7=ui_cur;
compo8=uis_cur;
compo9=chsp_cur;
compo10=afdc_cur;
compo11=ssi_cur;
compo12=ed_cur;
compo13=edss_cur;
compo14=vet_cur;
compo15=other_c;
compo16=relwel_c;
compo17=relreg_c;
compo18=food_cur;
compo19=chsps_c;
compo20=wkcmp_c;
compo21=dis_cur;
compo22=ss_cur;
 

if (wktot07u = -4 & rctot07u > 0) then do;

        ui_cur=-3;

        compo7=-3;

        end;

else if (wktot07u < 0 & wktot07u > -4) then do;

        ui_cur=-3;

        compo7=-3;

        end;

if (wktot07s = -4 & rctot07s > 0) then do;

        uis_cur=-3;

        compo8=-3;

        end;

else if (wktot07s < 0 & wktot07s > -4) then do;

        uis_cur=-3;

        compo8=-3;

        end;

if (motot07a = -4 & rctot07a > 0) then do;

        afdc_cur=-3;

        compo10=-3;

        end;

else if (motot07a < 0 & motot07a > -4) then do;

        afdc_cur=-3;

        compo10=-3;

        end;

 if (motot07f = -4 & rctot07f > 0) then do;

        food_cur=-3;

        compo18=-3;

        end;

else if (motot07f < 0 & motot07f > -4) then do;

        food_cur=-3;

        compo18=-3;

        end;

 if (motot07w = -4 & rctot07w > 0) then do;

        ssi_cur=-3;

        compo11=-3;

        end;

else if (motot07w < 0 & motot07w > -4) then do;

        ssi_cur=-3;

        compo11=-3;

        end;

 array compo (j) compo1  compo2  compo3  compo4  compo5  compo6  compo7

                compo8  compo9  compo10 compo11 compo12 compo13 compo14

                compo15 compo16 compo17 compo18 compo19 compo20

                compo21 compo22;

 do j=1 to 22;

  if (compo > -4) then do;

    if (compo < 0 & compo = -1) then mn1701=(mn1701+1);

    else if (compo < 0 & compo = -2) then mn1702=(mn1702+1);

    else if (compo < 0 & compo = -3) then mn1703=(mn1703+1);

    else faminc_c=(faminc_c + compo);

  end;

end;

 sumn_cur=mn1701 + mn1702 + mn1703;

 if (sumn_cur = 0) then income_c=faminc_c;

else do;

  if (mn1703 > 0) then income_c=-3;

   else if (mn1702 > 0) then income_c=-2;

   else if (mn1701 > 0) then income_c=-1;

end;

if (paflaga = -5) then income_c=-5;

data compute3;

set compute2;

incom_ct=income_c;

if (income_c >= 278000) then incom_ct=454737;

if (income_c > level_c) then cps_cur=0;

else if (income_c >= 0 & income_c <= level_c) then cps_cur=1;

else cps_cur=-3;

array mn (k) mn1701 mn1702 mn1703;

do k=1 to 3;

if (mn > 0) then mn=1;

end;

if (sumn_cur > 0) then sumn_cur=1;

if (paflaga = -5) then level_c=-5;

if (paflaga = -5) then cps_cur=-5;

2010 Variables

* PROGRAM STATEMENTS FOR TOTAL NET FAMILY INCOME 2009;

afdc_cur=-4;
chsp_cur=-4;
chsps_c=-4;
povstatus=-4;
ed_cur=-4;
edss_cur=-4;
family_c=-4;
faminc_c=-4;
food_cur=-4;
tnfi=-4;
povlevel=-4;
mil_cur=-4;
mils_cur=-4;
mn1701=-4;
mn1702=-4;
mn1703=-4;
other_c=-4;
ssi_cur=-4;
relreg_c=-4;
relwel_c=-4;
s_cur=-4;
sei_cur=-4;
seis_cur=-4;
sumn_cur=-4;
target_c=-4;
ui_cur=-4;
uis_cur=-4;
vet_cur=-4;
wps_cur=-4;
wpss_cur=-4;
wkcmp_c=-4;
dis_cur=-4;
ss_cur=-4;

if (Q13_5 = -4) then wps_cur=0;

else wps_cur=Q13_5;

if (Q13_9 = -4) then sei_cur=0;

               else sei_cur=Q13_9;

proc sort; by public_id;

data compute1;

set compute;

if (wktot09u = -4 & rctot09u = -4) then ui_cur=0;

else if (wktot09u = -4 & rctot09u = 0) then ui_cur=0;

else if (wktot09u > 0 & rctot09u > 0) then ui_cur=rctot09u;

else if (wktot09u < 0) then ui_cur=wktot09u;

else if (rctot09u < 0) then ui_cur=rctot09u;

else ui_cur=-3;

if (paflaga = 1 | Q13_16 = -4) then mils_cur=0;

else mils_cur=Q13_16;

if (paflaga = 1 | Q13_18 = -4) then wpss_cur=0;

else wpss_cur=Q13_18;

if (paflaga = 1 | Q13_24 = -4) then seis_cur=0;

else seis_cur=Q13_24;

if (paflaga = 1 | (wktot09s = -4 & rctot09s = -4)) then uis_cur=0;

else if (paflaga = 1 | (wktot09s = -4 & rctot09s = 0)) then uis_cur=0;

else if (wktot09s > 0 & rctot09s > 0) then uis_cur=rctot09s;

else if (wktot09s < 0) then uis_cur=wktot09s;

else if (rctot09s < 0) then uis_cur=rctot09s;

else uis_cur=-3;

if (q13_31b = -4) then wkcmp_c=0;

else wkcmp_c=q13_31b;

if (Q13_33i = -4) then chsp_cur=0;

else chsp_cur=Q13_33i;

if (paflaga = 1 | Q13_33m = -4) then chsps_c=0;

else chsps_c=Q13_33m;

if (rctot09a = -4 | rctot09a = 0) then afdc_cur=0;

else if (motot09a = -4 | motot09a = 0) then afdc_cur=0;

else if (rctot09a < 0) then afdc_cur=rctot09a;

else if (motot09a < 0) then afdc_cur=motot09a;

else if (motot09a <= 0) then afdc_cur=-3;

else afdc_cur=rctot09a;

if (rctot09f = -4 | rctot09f = 0) then food_cur=0;

else if (motot09f = -4 | motot09f = 0) then food_cur=0;

else if (rctot09f < 0) then food_cur=rctot09f;

else if (motot09f < 0) then food_cur=motot09f;

else if (motot09f <= 0) then food_cur=-3;

else food_cur=rctot09f;

if (rctot09w = -4 | rctot09w = 0) then ssi_cur=0;

else if (motot09w = -4 | motot09w = 0) then ssi_cur=0;

else if (rctot09w < 0) then ssi_cur=rctot09w;

else if (motot09w < 0) then ssi_cur=motot09w;

else if (motot09w <= 0) then ssi_cur=-3;

else ssi_cur=rctot09w;

if (Q13_66 = -4) then ed_cur=0;

else ed_cur=Q13_66;

if (paflaga = 1 | Q13_68 = -4) then edss_cur=0;

else edss_cur=Q13_68;

if (q13_70_v = -4) then vet_cur=0;

else if (q13_70_v = -2) then vet_cur=q13_70_v;

else if (q13_70_v = -1) then vet_cur=q13_70_v;

else vet_cur=(q13_70_v * q13_70a_v);*replaced 12 by q13_70a_v;

if (q13_70_d = -4) then dis_cur=0;

else if (q13_70_d = -2) then dis_cur=q13_70_d;

else if (q13_70_d = -1) then dis_cur=q13_70_d;

else dis_cur=(q13_70_d * q13_70a_d);*replaced 12 by q13_70a_d;

if (q13_70_s = -4) then ss_cur=0;

else if (q13_70_s = -2) then ss_cur=q13_70_s;

else if (q13_70_s = -1) then ss_cur=q13_70_s;

else ss_cur=(q13_70_s * q13_70a_s);*replaced 12 by q13_70a_s;

if (Q13_75 = -4) then other_c=0;

else other_c=Q13_75;

data compute2;

set compute1;

if (vet_cur > 0 & other_c = vet_cur) then other_c=0;

if (Q13_92 = -4) then relwel_c=0;

else relwel_c=Q13_92;

if (Q13_92c = -4) then relreg_c=0;

else relreg_c=Q13_92c;

family_c=famsz10;

/* TO CREATE FAMILY SIZE (I.E. FAMSZ04) SEARCH THRU THE HOUSEHOLD ENUMERATION

  INCREMENT FAMILY SIZE, IF THE RELATIONSHIP TO THE YOUTH IS A RELATIVE.

  DO NOT INCREASE FAMILY SIZE, IF THE CODE IS <0 OR (>=33 & <=36) OR =45 OR =46 OR

  (>=50 & <=54)*/

mn1701=0;
mn1702=0;
mn1703=0;
faminc_c=0;
tnfi=-3;
compo1=mil_cur;
compo2=mils_cur;
compo3=wps_cur;
compo4=wpss_cur;
compo5=sei_cur;
compo6=seis_cur;
compo7=ui_cur;
compo8=uis_cur;
compo9=chsp_cur;
compo10=afdc_cur;
compo11=ssi_cur;
compo12=ed_cur;
compo13=edss_cur;
compo14=vet_cur;
compo15=other_c;
compo16=relwel_c;
compo17=relreg_c;
compo18=food_cur;
compo19=chsps_c;
compo20=wkcmp_c;
compo21=dis_cur;
compo22=ss_cur;
 

if (wktot09u = -4 & rctot09u > 0) then do;

        ui_cur=-3;

        compo7=-3;

        end;

else if (wktot09u < 0 & wktot09u > -4) then do;

        ui_cur=-3;

        compo7=-3;

        end;

if (wktot09s = -4 & rctot09s > 0) then do;

        uis_cur=-3;

        compo8=-3;

        end;

else if (wktot09s < 0 & wktot09s > -4) then do;

        uis_cur=-3;

        compo8=-3;

        end;

if (motot09a = -4 & rctot09a > 0) then do;

        afdc_cur=-3;

        compo10=-3;

        end;

else if (motot09a < 0 & motot09a > -4) then do;

        afdc_cur=-3;

        compo10=-3;

        end;

if (motot09f = -4 & rctot09f > 0) then do;

        food_cur=-3;

        compo18=-3;

        end;

else if (motot09f < 0 & motot09f > -4) then do;

        food_cur=-3;

        compo18=-3;

        end;

if (motot09w = -4 & rctot09w > 0) then do;

        ssi_cur=-3;

        compo11=-3;

        end;

else if (motot09w < 0 & motot09w > -4) then do;

        ssi_cur=-3;

        compo11=-3;

        end;

array compo (j) compo1  compo2  compo3  compo4  compo5  compo6  compo7

                compo8  compo9  compo10 compo11 compo12 compo13 compo14

                compo15 compo16 compo17 compo18 compo19 compo20

                compo21 compo22;

do j=1 to 22;

  if (compo > -4) then do;

    if (compo < 0 & compo = -1) then mn1701=(mn1701+1);

    else if (compo < 0 & compo = -2) then mn1702=(mn1702+1);

    else if (compo < 0 & compo = -3) then mn1703=(mn1703+1);

    else faminc_c=(faminc_c + compo);

  end;

end;

sumn_cur=mn1701 + mn1702 + mn1703;

if (sumn_cur = 0) then tnfi=faminc_c;

else do;

  if (mn1703 > 0) then tnfi=-3;

   else if (mn1702 > 0) then tnfi=-2;

   else if (mn1701 > 0) then tnfi=-1;

end;

if (paflaga = -5) then tnfi=-5;

proc freq; tables sei_cur seis_cur;

run;

proc print; var public_id sei_cur seis_cur;

where (0<sei_cur<100 or 0<seis_cur<100);

title 'sei_cur and seis_cur <100';

title;

proc freq;  

tables mn1701 mn1702 mn1703 sumn_cur;

* income trunc;

data compute3;

set compute2;

tnfi_trunc=tnfi;

if (tnfi >= 270200) then tnfi_trunc=440692;

if (tnfi > povlevel) then povstatus=0;

else if (tnfi >= 0 & tnfi <= povlevel) then povstatus=1;

else povstatus=-3;

array mn (k) mn1701 mn1702 mn1703;

do k=1 to 3;

if (mn > 0) then mn=1;

end;

if (sumn_cur > 0) then sumn_cur=1;

if (paflaga = -5) then povlevel=-5;

if (paflaga = -5) then povstatus=-5;

 

2012 Variables

* PROGRAM STATEMENTS FOR TOTAL NET FAMILY INCOME 2011;

afdc_cur=-4;
chsp_cur=-4;
chsps_c=-4;
cps_cur=-4;
ed_cur=-4;
edss_cur=-4;
family_c=-4;
faminc_c=-4;
food_cur=-4;
tnfi=-4;
level_c=-4;
mil_cur=-4;
mils_cur=-4;
mn1701=-4;
mn1702=-4;
mn1703=-4;
other_c=-4;
ssi_cur=-4;
relreg_c=-4;
relwel_c=-4;
s_cur=-4;
sei_cur=-4;
seis_cur=-4;
sumn_cur=-4;
target_c=-4;
ui_cur=-4;
uis_cur=-4;
vet_cur=-4;
wps_cur=-4;
wpss_cur=-4;
wkcmp_c=-4;
dis_cur=-4;
ss_cur=-4;

if (Q13_3 = -4) then mil_cur=0;
else mil_cur=Q13_3;

if (Q13_5 = -4) then wps_cur=0;
else wps_cur=Q13_5;

fjt_inc=fjt_141;

if (fjt_inc = -4) then farm_cur=0;
    else farm_cur=fjt_inc;

bpjt_inc=bp_141;

if (bpjt_inc = -4) then bus_cur=0;
    else bus_cur=bpjt_inc;

fbr_inc=q13_132d;
if (fbr_inc = -4) then fbr_cur=0;
    else fbr_cur=fbr_inc;

if (Q13_9 = -4) then sei_cur=0;
    else sei_cur=Q13_9;

if (farm_cur > 0) then sei_cur=(sei_cur+farm_cur);
if (bus_cur > 0) then sei_cur=(sei_cur+bus_cur);
if (fbr_cur > 0) then sei_cur=(sei_cur+fbr_cur);

data compute1;
set compute;
if (wktot11u = -4 & rctot11u = -4) then ui_cur=0;
else if (wktot11u = -4 & rctot11u = 0) then ui_cur=0;
else if (wktot11u > 0 & rctot11u > 0) then ui_cur=rctot11u;
else if (wktot11u < 0) then ui_cur=wktot11u;
else if (rctot11u < 0) then ui_cur=rctot11u;
else ui_cur=-3;

if (paflaga = 1 | Q13_16 = -4) then mils_cur=0;
else mils_cur=Q13_16;

if (paflaga = 1 | Q13_18 = -4) then wpss_cur=0;
else wpss_cur=Q13_18;

if (paflaga = 1 | Q13_24 = -4) then seis_cur=0;
else seis_cur=Q13_24;

if (paflaga = 1 | (wktot11s = -4 & rctot11s = -4)) then uis_cur=0;
else if (paflaga = 1 | (wktot11s = -4 & rctot11s = 0)) then uis_cur=0;
else if (wktot11s > 0 & rctot11s > 0) then uis_cur=rctot11s;
else if (wktot11s < 0) then uis_cur=wktot11s;
else if (rctot11s < 0) then uis_cur=rctot11s;
else uis_cur=-3;

if (q13_31b = -4) then wkcmp_c=0;
else wkcmp_c=q13_31b;

if (Q13_33i = -4) then chsp_cur=0;
else chsp_cur=Q13_33i;

if (paflaga = 1 | Q13_33m = -4) then chsps_c=0;
else chsps_c=Q13_33m;

if (rctot11a = -4 | rctot11a = 0) then afdc_cur=0;
else if (motot11a = -4 | motot11a = 0) then afdc_cur=0;
else if (rctot11a < 0) then afdc_cur=rctot11a;
else if (motot11a < 0) then afdc_cur=motot11a;
else if (motot11a <= 0) then afdc_cur=-3;
else afdc_cur=rctot11a;

if (rctot11f = -4 | rctot11f = 0) then food_cur=0;
else if (motot11f = -4 | motot11f = 0) then food_cur=0;
else if (rctot11f < 0) then food_cur=rctot11f;
else if (motot11f < 0) then food_cur=motot11f;
else if (motot11f <= 0) then food_cur=-3;
else food_cur=rctot11f;

if (rctot11w = -4 | rctot11w = 0) then ssi_cur=0;
else if (motot11w = -4 | motot11w = 0) then ssi_cur=0;
else if (rctot11w < 0) then ssi_cur=rctot11w;
else if (motot11w < 0) then ssi_cur=motot11w;
else if (motot11w <= 0) then ssi_cur=-3;
else ssi_cur=rctot11w;

if (Q13_66 = -4) then ed_cur=0;
else ed_cur=Q13_66;

if (paflaga = 1 | Q13_68 = -4) then edss_cur=0;
else edss_cur=Q13_68;

if (q13_70_v = -4) then vet_cur=0;
else if (q13_70_v = -2|q13_70a_v=-2) then vet_cur=-2;
else if (q13_70_v = -1|q13_70a_v=-1) then vet_cur=-1;
else vet_cur=(q13_70_v * q13_70a_v);

if (q13_70_d = -4) then dis_cur=0;
else if (q13_70_d = -2|q13_70a_d=-2) then dis_cur=-2;
else if (q13_70_d = -1|q13_70a_d=-1) then dis_cur=-1;
else dis_cur=(q13_70_d * q13_70a_d);

if (q13_70_s = -4) then ss_cur=0;
else if (q13_70_s = -2|q13_70a_s=-2) then ss_cur=-2;
else if (q13_70_s = -1|q13_70a_s=-1) then ss_cur=-1;
else ss_cur=(q13_70_s * q13_70a_s);*replaced 12 by q13_70a_s;

if (Q13_75 = -4) then other_c=0;
else other_c=Q13_75;

data compute2;
set compute1;

if (vet_cur > 0 & other_c = vet_cur) then other_c=0;

if (Q13_92 = -4) then relwel_c=0;
else relwel_c=Q13_92;

if (Q13_92c = -4) then relreg_c=0;
else relreg_c=Q13_92c;

family_c=famsz12;

/* TO CREATE FAMILY SIZE (I.E. FAMSZ12) SEARCH THRU THE HOUSEHOLD ENUMERATION
INCREMENT FAMILY SIZE, IF THE RELATIONSHIP TO THE YOUTH IS A RELATIVE.
DO NOT INCREASE FAMILY SIZE, IF THE CODE IS <0 OR (>=33 & <=36) OR =45 OR =46 OR
(>=50 & <=54)*/

mn1701=0;
mn1702=0;
mn1703=0;
faminc_c=0;
tnfi=-3;
compo1=mil_cur;
compo2=mils_cur;
compo3=wps_cur;
compo4=wpss_cur;
compo5=sei_cur;
compo6=seis_cur;
compo7=ui_cur;
compo8=uis_cur;
compo9=chsp_cur;
compo10=afdc_cur;
compo11=ssi_cur;
compo12=ed_cur;
compo13=edss_cur;
compo14=vet_cur;
compo15=other_c;
compo16=relwel_c;
compo17=relreg_c;
compo18=food_cur;
compo19=chsps_c;
compo20=wkcmp_c;
compo21=dis_cur;
compo22=ss_cur;

if (wktot11u = -4 & rctot11u > 0) then do;
ui_cur=-3;
compo7=-3;
end;
else if (wktot11u < 0 & wktot11u > -4) then do;
ui_cur=-3;
compo7=-3;
end;

if (wktot11s = -4 & rctot11s > 0) then do;
uis_cur=-3;
compo8=-3;
end;
else if (wktot11s < 0 & wktot11s > -4) then do;
uis_cur=-3;
compo8=-3;
end;

if (motot11a = -4 & rctot11a > 0) then do;
afdc_cur=-3;
compo10=-3;
end;
else if (motot11a < 0 & motot11a > -4) then do;
afdc_cur=-3;
compo10=-3;
end;

if (motot11f = -4 & rctot11f > 0) then do;
food_cur=-3;
compo18=-3;
end;
else if (motot11f < 0 & motot11f > -4) then do;
food_cur=-3;
compo18=-3;
end;

if (motot11w = -4 & rctot11w > 0) then do;
ssi_cur=-3;
compo11=-3;
end;

else if (motot11w < 0 & motot11w > -4) then do;
ssi_cur=-3;
compo11=-3;
end;

array compo (j) compo1 compo2 compo3 compo4 compo5 compo6 compo7
compo8 compo9 compo10 compo11 compo12 compo13 compo14
compo15 compo16 compo17 compo18 compo19 compo20
compo21 compo22;

do j=1 to 22;
if (compo > -4) then do;
if (compo < 0 & compo = -1) then mn1701=(mn1701+1);
else if (compo < 0 & compo = -2) then mn1702=(mn1702+1);
else if (compo < 0 & compo = -3) then mn1703=(mn1703+1);
else faminc_c=(faminc_c + compo);
end;
end;

sumn_cur=mn1701 + mn1702 + mn1703;

if (sumn_cur = 0) then tnfi=faminc_c;
else do;
if (mn1703 > 0) then tnfi=-3;
else if (mn1702 > 0) then tnfi=-2;
else if (mn1701 > 0) then tnfi=-1;
end;

if (paflaga = -5) then tnfi=-5;

* income trunc;

data compute3;
set compute2;

tnfi_trunc=tnfi;
if (tnfi >= 290500) then tnfi_trunc=497763;

if (tnfi > level_c) then cps_cur=0;
else if (tnfi >= 0 & tnfi <= level_c) then cps_cur=1;
else cps_cur=-3;

array mn (k) mn1701 mn1702 mn1703;

do k=1 to 3;
    if (mn > 0) then mn=1;
end;

if (sumn_cur > 0) then sumn_cur=1;

if (paflaga = -5) then level_c=-5;
if (paflaga = -5) then cps_cur=-5;

2014 Variables

* PROGRAM STATEMENTS FOR TOTAL NET FAMILY INCOME 2013;

afdc_cur=-4;

chsp_cur=-4;

chsps_c=-4;

cps_cur=-4;

ed_cur=-4;

edss_cur=-4;

family_c=-4;

faminc_c=-4;

food_cur=-4;

tnfi=-4;

level_c=-4;

mil_cur=-4;

mils_cur=-4;

mn1701=-4;

mn1702=-4;

mn1703=-4;

other_c=-4;

ssi_cur=-4;

relreg_c=-4;

relwel_c=-4;

s_cur=-4;

sei_cur=-4;

seis_cur=-4;

sumn_cur=-4;

target_c=-4;

ui_cur=-4;

uis_cur=-4;

vet_cur=-4;

wps_cur=-4;

wpss_cur=-4;

wkcmp_c=-4;

dis_cur=-4;

ss_cur=-4;

if (Q13_3 = -4) then mil_cur=0;

else mil_cur=Q13_3;

if (Q13_5 = -4) then wps_cur=0;

else wps_cur=Q13_5;

/* comment out business/farm income collected with assets for 2014 - put back in 2016;

* series to incorporate new farm & bus income qs; 

fjt_inc=fjt_141;

if (fjt_inc = -4) then farm_cur=0;

       else farm_cur=fjt_inc;

bpjt_inc=bp_141;

if (bpjt_inc = -4) then bus_cur=0;

               else bus_cur=bpjt_inc;

fbr_inc=q13_132d;

if (fbr_inc = -4) then fbr_cur=0;

               else fbr_cur=fbr_inc;

*/

if (Q13_9 = -4) then sei_cur=0;

               else sei_cur=Q13_9;

/*if (farm_cur > 0) then sei_cur=(sei_cur+farm_cur);

if (bus_cur > 0)  then sei_cur=(sei_cur+bus_cur);

if (fbr_cur > 0)  then sei_cur=(sei_cur+fbr_cur);

*/

run;

data compute1;set compute;

if (wktot13u = -4 & rctot13u = -4) then ui_cur=0;/*unemp comp dol*/

else if (wktot13u = -4 & rctot13u = 0) then ui_cur=0;

else if (wktot13u > 0 & rctot13u > 0) then ui_cur=rctot13u;

else if (wktot13u < 0) then ui_cur=wktot13u;

else if (rctot13u < 0) then ui_cur=rctot13u;

else ui_cur=-3;

if (paflaga = 1 | Q13_16 = -4) then mils_cur=0;

else mils_cur=Q13_16;

if (paflaga = 1 | Q13_18 = -4) then wpss_cur=0;

else wpss_cur=Q13_18;

 if (paflaga = 1 | Q13_24 = -4) then seis_cur=0;

else seis_cur=Q13_24;

 if (paflaga = 1 | (wktot13s = -4 & rctot13s = -4)) then uis_cur=0;/*spuc dol*/

else if (paflaga = 1 | (wktot13s = -4 & rctot13s = 0)) then uis_cur=0;

else if (wktot13s > 0 & rctot13s > 0) then uis_cur=rctot13s;

else if (wktot13s < 0) then uis_cur=wktot13s;

else if (rctot13s < 0) then uis_cur=rctot13s;

else uis_cur=-3;

if (q13_31b = -4) then wkcmp_c=0;*spouse worker's compensation;

else wkcmp_c=q13_31b;

if (Q13_33i = -4) then chsp_cur=0;

else chsp_cur=Q13_33i;

if (paflaga = 1 | Q13_33m = -4) then chsps_c=0;

else chsps_c=Q13_33m;

if (rctot13a = -4 | rctot13a = 0) then afdc_cur=0;

else if (motot13a = -4 | motot13a = 0) then afdc_cur=0;

else if (rctot13a < 0) then afdc_cur=rctot13a;

else if (motot13a < 0) then afdc_cur=motot13a;

else if (motot13a <= 0) then afdc_cur=-3;

else afdc_cur=rctot13a;

if (rctot13f = -4 | rctot13f = 0) then food_cur=0;

else if (motot13f = -4 | motot13f = 0) then food_cur=0;

else if (rctot13f < 0) then food_cur=rctot13f;

else if (motot13f < 0) then food_cur=motot13f;

else if (motot13f <= 0) then food_cur=-3;

else food_cur=rctot13f;

if (rctot13w = -4 | rctot13w = 0) then ssi_cur=0;

else if (motot13w = -4 | motot13w = 0) then ssi_cur=0;

else if (rctot13w < 0) then ssi_cur=rctot13w;

else if (motot13w < 0) then ssi_cur=motot13w;

else if (motot13w <= 0) then ssi_cur=-3;

else ssi_cur=rctot13w;

if (Q13_66 = -4) then ed_cur=0;

else ed_cur=Q13_66;

if (paflaga = 1 | Q13_68 = -4) then edss_cur=0;

else edss_cur=Q13_68;

if (q13_70_v = -4) then vet_cur=0;

else if (q13_70_v = -2|q13_70a_v=-2) then vet_cur=-2;

else if (q13_70_v = -1|q13_70a_v=-1) then vet_cur=-1;

else if q13_70_v >=0 & q13_70a_v>=0 then vet_cur=(q13_70_v * q13_70a_v);

if (q13_70_d = -4) then dis_cur=0;

else if (q13_70_d = -2|q13_70a_d=-2) then dis_cur=-2;

else if (q13_70_d = -1|q13_70a_d=-1) then dis_cur=-1;

else if q13_70_d>=0 & q13_70a_d>=0 then dis_cur=(q13_70_d * q13_70a_d);*replaced 12 by q13_70a_d;

if (q13_70_s = -4) then ss_cur=0;

else if (q13_70_s = -2|q13_70a_s=-2) then ss_cur=-2;

else if (q13_70_s = -1|q13_70a_s=-1) then ss_cur=-1;

else if q13_70_s>=0 & q13_70a_s>=0 then ss_cur=(q13_70_s * q13_70a_s);

if (Q13_75 = -4) then other_c=0;

else other_c=Q13_75;

data compute2;set compute1;

if (vet_cur > 0 & other_c = vet_cur) then other_c=0;

if (Q13_92 = -4) then relwel_c=0;

else relwel_c=Q13_92;

if (Q13_92c = -4) then relreg_c=0;

else relreg_c=Q13_92c;

family_c=famsize;

/* TO CREATE FAMILY SIZE (I.E. FAMSZ12) SEARCH THRU THE HOUSEHOLD ENUMERATION

  INCREMENT FAMILY SIZE, IF THE RELATIONSHIP TO THE YOUTH IS A RELATIVE.

  DO NOT INCREASE FAMILY SIZE, IF THE CODE IS <0 OR (>=33 & <=36) OR =45 OR =46 OR

  (>=50 & <=54)*/

mn1701=0;

mn1702=0;

mn1703=0;

faminc_c=0;

tnfi=-3;

compo1=mil_cur;

compo2=mils_cur;

compo3=wps_cur;

compo4=wpss_cur;

compo5=sei_cur;

compo6=seis_cur;

compo7=ui_cur;

compo8=uis_cur;

compo9=chsp_cur;

compo10=afdc_cur;

compo11=ssi_cur;

compo12=ed_cur;

compo13=edss_cur;

compo14=vet_cur;

compo15=other_c;

compo16=relwel_c;

compo17=relreg_c;

compo18=food_cur;

compo19=chsps_c;

compo20=wkcmp_c;

compo21=dis_cur;

compo22=ss_cur;

if (wktot13u = -4 & rctot13u > 0) then do;

        ui_cur=-3;

        compo7=-3;

end;

else if (wktot13u < 0 & wktot13u > -4) then do;

        ui_cur=-3;

        compo7=-3;

end;

if (wktot13s = -4 & rctot13s > 0) then do;

        uis_cur=-3;

        compo8=-3;

end;

else if (wktot13s < 0 & wktot13s > -4) then do;

        uis_cur=-3;

        compo8=-3;

end;

if (motot13a = -4 & rctot13a > 0) then do;

        afdc_cur=-3;

        compo10=-3;

end;

else if (motot13a < 0 & motot13a > -4) then do;

        afdc_cur=-3;

        compo10=-3;

end;

if (motot13f = -4 & rctot13f > 0) then do;

        food_cur=-3;

        compo18=-3;

end;

else if (motot13f < 0 & motot13f > -4) then do;

        food_cur=-3;

        compo18=-3;

end;

if (motot13w = -4 & rctot13w > 0) then do;

        ssi_cur=-3;

        compo11=-3;

end;

else if (motot13w < 0 & motot13w > -4) then do;

        ssi_cur=-3;

        compo11=-3;

end;

array compo (j) compo1  compo2  compo3  compo4  compo5  compo6  compo7

                compo8  compo9  compo10 compo11 compo12 compo13 compo14

                compo15 compo16 compo17 compo18 compo19 compo20

                compo21 compo22;

do j=1 to 22;

  if (compo > -4) then do;

    if (compo < 0 & compo = -1) then mn1701=(mn1701+1);

    else if (compo < 0 & compo = -2) then mn1702=(mn1702+1);

    else if (compo < 0 & compo = -3) then mn1703=(mn1703+1);

    else faminc_c=(faminc_c + compo);

  end;

end;

sumn_cur=mn1701 + mn1702 + mn1703;

if (sumn_cur = 0) then tnfi=faminc_c;

else do;

  if (mn1703 > 0) then tnfi=-3;

   else if (mn1702 > 0) then tnfi=-2;

   else if (mn1701 > 0) then tnfi=-1;

end;

if (paflaga = -5) then tnfi=-5;

*income trunc;

data compute3;set compute2;

tnfi_trunc=tnfi;

if (tnfi >= 310000) then tnfi_trunc=595986;

* poverty status and level;

if year_pcy14=2013 then do;

               if family_c > 0 then level_c=(table13 + (tbl13_inc * (family_c-1)));*interviewed in 2014 using 2013 guideline;

end;

else if year_pcy14=2014 then do;

               if family_c > 0 then level_c=(table14 + (tbl14_inc * (family_c-1)));*interviewed in 2015 using 2014 guideline;

end;

if (tnfi > level_c) then cps_cur=0;

else if (tnfi >= 0 & tnfi <= level_c) then cps_cur=1;

else cps_cur=-3;

array mn (k) mn1701 mn1702 mn1703;

do k=1 to 3;

               if (mn > 0) then mn=1;

end;

if (sumn_cur > 0) then sumn_cur=1;

if (paflaga = -5) then level_c=-5;

if (paflaga = -5) then cps_cur=-5;

 

2016 Variables

*PROGRAM STATEMENTS FOR TOTAL NET FAMILY INCOME 2015 & 2016 (ROUND 27)

 /****  QNAME in the Gator      Variable name in the program
------------------------------------------------------------------------------   
       UNEMPR-TOTAL-2015            rctot15u
       UNEMPSP-TOTAL-2015           rctot15s
       AFDC-TOTAL-2015                rctot15a
       FDSTMPS-TOTAL-2015          rctot15f
       SSI-TOTAL-2015                  rctot15w
       WELFARE-AMT-2015             rctot15t
       UNEMPR-TOTAL-2016           rctot16u
       UNEMPSP-TOTAL-2016          rctot16s
       AFDC-TOTAL-2016               rctot16a
       FDSTMPS-TOTAL-2016          rctot16f
       SSI-TOTAL-2016                 rctot16w
       WELFARE-AMT-2016            rctot16t
       Q13-3                              Q13_3         
       Q13-5                              Q13_5       
       Q13-9                              Q13_9       
       Q13-16                            Q13_16      
       Q13-18                            Q13_18      
       Q13-24                            Q13_24      
       Q13-31B                          Q13_31B     
       Q13-33I                          Q13_33I     
       Q13-33M                         Q13_33M     
       Q13-66                           Q13_66      
       Q13-68                           Q13_68      
       Q13-70_VET                    Q13_70_V    
       Q13-70A_VET                  Q13_70A_V   
       Q13-70_DIS                    Q13_70_D    
       Q13-70A_DIS                  Q13_70A_D   
       Q13-70_SS                     Q13_70_S    
       Q13-70A_SS                   Q13_70A_S   
       Q13-75                          Q13_75      
       Q13-81-NEW                   Q13_81_N    
       Q13-FJT-13.01                FJT_131     
       Q13-FJT-13.02                FJT_132     
       Q13-FJT-14.01                FJT_141     
       Q13-FJT-15.01                FJT_151     
       Q13-FJT-15.02                FJT_152     
       Q13-BPPJT-13.01                BP_131      
       Q13-BPPJT-13.02                BP_132      
       Q13-BPPJT-13.03                BP_133      
       Q13-BPPJT-13.04                BP_134      
       Q13-BPPJT-14.01                BP_141      
       Q13-BPPJT-14.02                BP_142      
       Q13-BPPJT-14.03                BP_143      
       Q13-BPPJT-14.04                BP_144      
       Q13-BPPJT-15.01                BP_151      
       Q13-132D                         Q13_132D    
       FAMSIZE                            FAMSIZE     
       SYMBOL_CURDATE~D            curday      
       SYMBOL_CURDATE~M            curmo       
       SYMBOL_CURDATE~Y            curyr       
       SYMBOL_SPFLAG                  SPFLAG      
       SYMBOL_PAFLAG                  paflag      
       HHI_FINAL_RELCODE.01            rel01       
       HHI_FINAL_RELCODE.02            rel02       
       HHI_FINAL_RELCODE.03            rel03       
       HHI_FINAL_RELCODE.04            rel04       
       HHI_FINAL_RELCODE.05            rel05       
       HHI_FINAL_RELCODE.06            rel06       
       HHI_FINAL_RELCODE.07            rel07       
       HHI_FINAL_RELCODE.08            rel08       
       HHI_FINAL_RELCODE.09            rel09       
       HHI_FINAL_RELCODE.10            rel10       
       HHI_FINAL_RELCODE.11            rel11       
       HHI_FINAL_RELCODE.12            rel12     
*/  

* add to paflag for any missed;
paflaga = paflag;
if (rel01 = 33 | rel02 = 33 | rel03 = 33 | rel04 = 33 | rel05 = 33
    | rel06 = 33 | rel07 = 33 | rel08 = 33 | rel09 = 33 | rel10 = 33
    | rel11 = 33 | rel12 = 33 )
    then paflaga=1;

spflaga = 0;
if (rel01 = 1 | rel02 = 1 | rel03 = 1 | rel04 = 1 | rel05 = 1
    | rel06 = 1 | rel07 = 1 | rel08 = 1 | rel09 = 1 | rel10 = 1
    | rel11 = 1 | rel12 = 1)
    then spflaga=1;
                                                   
*INITIALIZE;
afdc_cur=-4;
chsp_cur=-4;
chsps_c=-4;
cps_cur=-4;
ed_cur=-4;
edss_cur=-4;
family_c=-4;
faminc_c=-4;
food_cur=-4;
income_c=-4;
level_c=-4;
mil_cur=-4;
mils_cur=-4;
mn1701=-4;
mn1702=-4;
mn1703=-4;
other_c=-4;
ssi_cur=-4;
rel_cur=-4;
sei_cur=-4;
seis_cur=-4;
sumn_cur=-4;
ui_cur=-4;
uis_cur=-4;
vet_cur=-4;
wps_cur=-4;
wpss_cur=-4;
wkcmp_c=-4;
dis_cur=-4;
ss_cur=-4;

if (Q13_3 = -4) then mil_cur=0;
else mil_cur=Q13_3;

if (Q13_5 = -4) then wps_cur=0;
else wps_cur=Q13_5;

fjt_inc=fjt_141;  
if (fjt_inc = -4) then farm_cur=0;
    else farm_cur=fjt_inc;

array bp14 (*) bp_141-bp_144;
bus_cur=0;
do i=1 to dim(bp14);
  if bp14(i) in (-1 -2 -3) then bus_cur=-3;
  else if bp14(i) in (0 -4) & bus_cur>=0 then bus_cur=bus_cur;
  else if bp14(i)>0 & bus_cur>=0 then bus_cur=bus_cur + bp14(i);
end;

fbr_inc=q13_132d;
if (fbr_inc = -4) then fbr_cur=0;
    else fbr_cur=fbr_inc;

if (Q13_9 = -4) then sei_cur=0;
    else sei_cur=Q13_9;

  if sei_cur>=0 & farm_cur >0 then sei_cur=(sei_cur+farm_cur);
  else if farm_cur in (-1 -2 -3) then sei_cur=-3;
  if sei_cur>=0 & bus_cur > 0  then sei_cur=(sei_cur+bus_cur);
  else if bus_cur in (-1 -2 -3) then sei_cur=-3;
  if sei_cur>=0 & fbr_cur > 0  then sei_cur=(sei_cur+fbr_cur);
  else if fbr_cur in (-1 -2 -3) then sei_cur=-3;

 if curyr=2016 then do;
  rctotu  =   rctot15u;
  rctots  =   rctot15s;
  rctota  =   rctot15a;
  rctotf  =   rctot15f;
  rctotw  =   rctot15w;
  rctott  =   rctot15t;
 end;
 else if curyr=2017 then do;
  rctotu  =   rctot16u;
  rctots  =   rctot16s;
  rctota  =   rctot16a;
  rctotf  =   rctot16f;
  rctotw  =   rctot16w;
  rctott  =   rctot16t;
 end;
 
if rctotu = -4 then ui_cur=0;
 else ui_cur= rctotu;

if (paflaga = 1 | Q13_16 = -4) then mils_cur=0;  
else mils_cur=Q13_16;

if (paflaga = 1 | Q13_18 = -4) then wpss_cur=0;
else wpss_cur=Q13_18;

if (paflaga = 1 | Q13_24 = -4) then seis_cur=0;
else seis_cur=Q13_24;

if (paflaga = 1 | rctots = -4) then uis_cur=0;
  else uis_cur=rctots;

if (q13_31b = -4) then wkcmp_c=0;  
else wkcmp_c=q13_31b;

if (Q13_33i = -4) then chsp_cur=0;
else chsp_cur=Q13_33i;

if (paflaga = 1 | Q13_33m = -4) then chsps_c=0;
else chsps_c=Q13_33m;

if rctota = -4 then afdc_cur=0;
 else afdc_cur= rctota;

if rctotf = -4 then food_cur=0;
 else food_cur= rctotf;

if rctotw = -4 then ssi_cur=0;
 else ssi_cur= rctotw;

if (Q13_66 = -4) then ed_cur=0;
else ed_cur=Q13_66;

if (paflaga = 1 | Q13_68 = -4) then edss_cur=0;
else edss_cur=Q13_68;

if (q13_70_v = -4) then vet_cur=0;         
else if (q13_70_v = -2|q13_70a_v=-2) then vet_cur=-2;
else if (q13_70_v = -1|q13_70a_v=-1) then vet_cur=-1;
else if q13_70_v >=0 & q13_70a_v>=0 then vet_cur=(q13_70_v * q13_70a_v);

if (q13_70_d = -4) then dis_cur=0;
else if (q13_70_d = -2|q13_70a_d=-2) then dis_cur=-2;
else if (q13_70_d = -1|q13_70a_d=-1) then dis_cur=-1;
else if q13_70_d>=0 & q13_70a_d>=0 then dis_cur=(q13_70_d * q13_70a_d);

if (q13_70_s = -4) then ss_cur=0;
else if (q13_70_s = -2|q13_70a_s=-2) then ss_cur=-2;
else if (q13_70_s = -1|q13_70a_s=-1) then ss_cur=-1;
else if q13_70_s>=0 & q13_70a_s>=0 then ss_cur=(q13_70_s * q13_70a_s);

if (Q13_75 = -4) then other_c=0;
else other_c=Q13_75;

if (Q13_81_N = -4) then rel_cur=0;
else rel_cur=Q13_81_N;
 
family_c=famsize;

mn1701=0;
mn1702=0;
mn1703=0;
faminc_c=0;
income_c=-3;
compo1=mil_cur;
compo2=mils_cur;
compo3=wps_cur;
compo4=wpss_cur;
compo5=sei_cur;
compo6=seis_cur;
compo7=ui_cur;
compo8=uis_cur;
compo9=chsp_cur;
compo10=afdc_cur;
compo11=ssi_cur;
compo12=ed_cur;
compo13=edss_cur;
compo14=vet_cur;
compo15=other_c;
compo16=rel_cur;
compo17=food_cur;
compo18=chsps_c;
compo19=wkcmp_c;
compo20=dis_cur;
compo21=ss_cur;

array compo (j) compo1  compo2  compo3  compo4  compo5  compo6  compo7
                compo8  compo9  compo10 compo11 compo12 compo13 compo14
                compo15 compo16 compo17 compo18 compo19 compo20
                compo21;

do j=1 to 21;
  if (compo > -4) then do;
    if (compo < 0 & compo = -1) then mn1701=(mn1701+1);
    else if (compo < 0 & compo = -2) then mn1702=(mn1702+1);
    else if (compo < 0 & compo = -3) then mn1703=(mn1703+1);
    else faminc_c=(faminc_c + compo);
  end;
end;

sumn_cur=mn1701 + mn1702 + mn1703;

if (sumn_cur = 0) then income_c=faminc_c;
else do;
  if (mn1703 > 0) then income_c=-3;
   else if (mn1702 > 0) then income_c=-2;
   else if (mn1701 > 0) then income_c=-1;
end;

* poverty status and level;
if curyr=2016 then do;
    if family_c > 0 then level_c=(table15 + (tbl15_inc * (family_c-1)));*interviewed in 2016 using 2015 guideline;
end;
else if curyr=2017 then do;
    if family_c > 0 then level_c=(table16 + (tbl16_inc * (family_c-1)));*interviewed in 2017 using 2016 guideline;
end;
if (income_c > level_c) then cps_cur=0;
else if (income_c >= 0 & income_c <= level_c) then cps_cur=1;
else cps_cur=-3;

***** top coding;
data two;set one;
incom_ct=income_c;
if (income_c >= 352000) then incom_ct=922631;  

2018 Variables

*PROGRAM STATEMENTS FOR TOTAL NET FAMILY INCOME 2018 (ROUND 28)

 /****  QNAME in the Gator      Variable name in the program
------------------------------------------------------------------------------   
       UNEMPR-TOTAL-2017            rctot17u
       UNEMPSP-TOTAL-2017           rctot17s
       AFDC-TOTAL-2017               rctot17a
       FDSTMPS-TOTAL-2017          rctot17f
       SSI-TOTAL-2017                  rctot17w
       WELFARE-AMT-2017             rctot17t
       UNEMPR-TOTAL-2018           rctot18u
       UNEMPSP-TOTAL-2018          rctot18s

AFDC-TOTAL-2018               rctot18a
       FDSTMPS-TOTAL-2018          rctot18f
       SSI-TOTAL-2018                 rctot18w
       WELFARE-AMT-2018            rctot18t
       Q13-5                                  Q13_5

       Q13-9                                  q13_9

       RR-PENSIONS-1                          RR_pen1

       RR-PENSIONS-2                          RR_pen2

       RR-ANNUITIES-1                         RR_anu1

       RR-ANNUITIES-2                         RR_anu2

RR-IRA-1                               RR_ira1

       RR-IRA-3                               RR_ira3

       RR-IRA-4                               RR_ira4

       RR-SOCSEC-1                            RR_SS

       Q13-69_SS                              Q69_SS

       Q13-70A_SS                             q70a_ss

       Q13-70_SS                              q70_ss

       Q13-70A_DIS.01                         q70a_dis1

Q13-70A_DIS.02                         q70a_dis2

       Q13-70_DIS.01                          q70_dis1

       Q13-70_DIS.02                          q70_dis2

       Q13-31A                                q13_31a

       Q13-31B                                q13_31b

       Q13-70A_VET                            q70a_vet

       Q13-70_VET                             q70_vet

Q13-18                                 q13_18

       Q13-24                                 q13_24

       RSP-PENSIONS-1                         RS_pen1

       RSP-PENSIONS-2                         RS_pen2

       RSP-ANNUITIES-1                        RS_anu1

       RSP-ANNUITIES-2                        RS_anu2

       RSP-IRA-1                              RS_ira1

       RSP-IRA-3                              RS_ira3

       RSP-IRA-4                              RS_ira4

       RSP-SOCSEC-1                           RS_SS

       Q13-69_SS-SP                           q69_SS_SP

       Q13-70A_SS-SP                          q70a_ss_sp

       Q13-70_SS-SP                           q70_ss_sp

       Q13-70A_DIS-SP.01                      q70a_dis1_sp

       Q13-70A_DIS-SP.02                      q70a_dis2_sp

       Q13-70_DIS-SP.01                       q70_dis1_sp

       Q13-70_DIS-SP.02                       q70_dis2_sp

       Q13-31A-SP                             q13_31a_sp

       Q13-31B-SP                             q13_31b_sp

       Q13-70A-SP_VET                         q70a_vet_sp

       Q13-70_VET-SP                          q70_vet_sp

       Q13-71                                 q13_71

       Q13-73A                                q13_73a

       Q13-74                                 q13_74

       Q13-75                                 q13_75

       Q13-80-NEW                             q13_80

  Q13-81-NEW                             q13_81

       CURDATE~D                              curday

       CURDATE~M                              curmo

       CURDATE~Y                              curyr

       Q13-10                                 q10

       FAMSIZE                            FAMSIZE     

       SYMBOL_SPFLAG                  SPFLAG      
       SYMBOL_PAFLAG                  paflag      
       HHI_FINAL_RELCODE.01            rel01       
       HHI_FINAL_RELCODE.02            rel02       
       HHI_FINAL_RELCODE.03            rel03       
       HHI_FINAL_RELCODE.04            rel04       
       HHI_FINAL_RELCODE.05            rel05       
       HHI_FINAL_RELCODE.06            rel06       
       HHI_FINAL_RELCODE.07            rel07       
       HHI_FINAL_RELCODE.08            rel08       
       HHI_FINAL_RELCODE.09            rel09       
       HHI_FINAL_RELCODE.10            rel10       

       HHI_FINAL_RELCODE.11            rel11       
       HHI_FINAL_RELCODE.12            rel12     
*/

* add to paflag for any missed;

paflaga = paflag;
       HHI_FINAL_RELCODE.11            rel11       
       HHI_FINAL_RELCODE.12            rel12     
*/

* add to paflag for any missed;

paflaga = paflag;

if (rel01 = 33 | rel02 = 33 | rel03 

spflaga = spflag;

if (rel01 = 1 | rel02 = 1 | rel03 = 1 | rel04 = 1 | rel05 = 1

    | rel06 = 1 | rel07 = 1 | rel08 = 1 | rel09 = 1 | rel10 = 1

    | rel11 = 1 )

    then spflaga=1;

***** respondent (and dependent children) income;

* wager--wage;

wager=-3;

if q13_5>=0 then wager=q13_5;

* farmr--income from farm or business;

farmr=-3;

if q13_9=-4 then farmr=0;

else if q13_9>=0 then farmr=q13_9;

* penr--income from retirement pension;

penr=-3;

if RR_pen1 in (-4 0) then penr=0;

else if RR_pen2>=0 then penr=RR_pen2;

* anur--income from retirement annuity;

anur=-3;

if RR_anu1 in (-4 0) then anur=0;

else if RR_anu2>=0 then anur=RR_anu2;

* irar--withdraw from IRA;

irar=-3;

if RR_ira1 in (-4 0) or RR_ira3=0 then irar=0;

else if RR_ira4>=0 then irar=RR_ira4;

* ssr--income from social security;

ssr=-3;

if RR_SS in (-4 0) or q69_ss=0 then ssr=0;

else if q70a_ss>=0 and q70_ss>=0 then ssr=q70a_ss * q70_ss;

* dis1r--veteran disability;

dis1r=-3;

if q70a_dis1=-4 then dis1r=0;

else if q70a_dis1>=0 and q70_dis1>=0 then dis1r=q70a_dis1 * q70_dis1;

* dis2r--other disability;

dis2r=-3;

if q70a_dis2=-4 then dis2r=0;

else if q70a_dis2>=0 and q70_dis2>=0 then dis2r=q70a_dis2 * q70_dis2;

* wcmpr--worker comp;

wcmpr=-3;

if q13_31a in (-4, 0) then wcmpr=0;

else if q13_31b>=0 then wcmpr=q13_31b;     

* vetr--other veteran benefit;

vetr=-3;

if q70a_vet=-4 then vetr=0;

else if q70a_vet>=0 and q70_vet>=0 then vetr=q70a_vet * q70_vet;

* respondent UC;

ucr=-3;

if curyr=2018 then ucr=ucr117;

else if curyr=2019 then ucr=ucr118;

if ucr in (. -4) then ucr=0;

if ucr in (-1 -2) then ucr=-3;

***** Spouse/partner;

* wages--spouse wage;

wages=-3;

if paflaga=1 or q13_18=-4 then wages=0;

else if q13_18>=0 then wages=q13_18;

* farms--spouse income from farm or business;

farms=-3;

if paflaga=1 or q13_24=-4 then farms=0;

else if q13_24>=0 then farms=q13_24;

* pensp--spouse/partner income from retirement pension;

pensp=-3;

if RS_pen1 in (-4 0) then pensp=0;

else if RS_pen2>=0 then pensp=RS_pen2;

* anusp--spouse/partner income from retirement annuity;

anusp=-3;

if RS_anu1 in (-4 0) then anusp=0;

else if RS_anu2>=0 then anusp=RS_anu2;

* irasp--spouse/partner withdraw from IRA;

irasp=-3;

if RS_ira1 in (-4 0) or RS_ira3=0 then irasp=0;

else if RS_ira4>=0 then irasp=RS_ira4;

* sssp--spouse/partner income from social security;

sssp=-3;

if RS_ss in (-4 0) or q69_ss_sp=0 then sssp=0;

else if q70a_ss_sp>=0 and q70_ss_sp>=0 then sssp=q70a_ss_sp * q70_ss_sp;

* dis1sp--spouse/partner veteran disability;

dis1sp=-3;

if q70a_dis1_sp=-4 then dis1sp=0;

else if q70a_dis1_sp>=0 and q70_dis1_sp>=0 then dis1sp=q70a_dis1_sp * q70_dis1_sp;

* dis2sp--spouse/partner other disability;

dis2sp=-3;

if q70a_dis2_sp=-4 then dis2sp=0;

else if q70a_dis2_sp>=0 and q70_dis2_sp>=0 then dis2sp=q70a_dis2_sp * q70_dis2_sp;

* wcmpsp--spouse/partner worker comp;

wcmpsp=-3;

if q13_31a_sp in (-4, 0) then wcmpsp=0;

else if q13_31b_sp>=0 then wcmpsp=q13_31b_sp;

* vetsp--spouse/partner other veteran benefit;

vetsp=-3;

if q70a_vet_sp=-4 then vetsp=0;

else if q70a_vet_sp>=0 and q70_vet_sp>=0 then vetsp=q70a_vet_sp * q70_vet_sp;

* spouse UC;

ucs=-3;

if curyr=2018 then ucs=ucsp117;

else if curyr=2019 then ucs=ucsp118;

if paflaga=1 or ucs in (. -4) then ucs=0;

if ucs in (-1 -2) then ucs=-3;

***** R and spouse/partner;

* afdc, food stamps, ssi and ssdi;

wel=-3;

if curyr=2018 then wel=wel117;

else if curyr=2019 then wel=wel118;

if wel in (-4 .) then wel=0;

*estates/trusts/inheritances;

trst=-3;

if q13_71 in (-4 0) then trst=0;

else if q13_73a>=0 then trst=q13_73a;

*income from other sources;

othrs=-3; *s refers to sources;

if q13_74 in (-4 0) then othrs=0;

else if q13_75>=0 then othrs=q13_75;

*income from other family memeber in the house;

othrp=-3; *p refers to people;

if q13_80 in (-4 0) then othrp=0;

else if q13_81>=0 then othrp=q13_81;

***** total family income;

array comp (*) wager farmr penr anur irar ssr dis1r dis2r wcmpr vetr ucr

         wages farms pensp anusp irasp sssp dis1sp dis2sp wcmpsp vetsp ucs

         wel trst othrs othrp;

faminc=0;

do j=1 to 26;

 if comp(j)=-3 then do; faminc=-3; j=26; end;

 else if faminc>=0 & comp(j)>=0 then faminc=faminc + comp(j);

end;

***** Poverty level;

curyr=2018 then do;

  if famsize > 0 then level=(table17 + (tbl17_inc * (famsize-1)));*interviewed in 2018 using 2017 guideline;

end;

else if curyr=2019 then do;

  if famsize > 0 then level=(table18 + (tbl18_inc * (famsize-1)));*interviewed in 2019 using 2018 guideline;

end;

if (faminc > level) then cps_cur=0;

else if (faminc >= 0 & faminc <= level) then cps_cur=1;

else cps_cur=-3;

if

***** topcode;

faminc_t=faminc;      if faminc>405500 then faminc_t=766958;

2020 Variables

Options pagesize=12686 linesize=100 nocenter nodate nolabel validvarname=any formchar="|----|+|---+=|-/\<>*";;
*respondent UC;
data UCr;
infile UCry dlm=',' lrecl=500;
input norcid UCr87-UCr121;
keep norcid UCr119 UCr120;
*spouse/partner UC;
data UCsp;
infile UCspy dlm=',' lrecl=300;
input norcid UCsp89-UCsp121;
keep norcid UCsp119 UCsp120;
*respondent and spouse/partner afdc,food stamps, ssdi, and ssi;
data wel; *b refer to both SSI and SSDI;
infile wby dlm=',' lrecl=50;
input norcid wel117-wel121;
keep norcid wel119 wel120;

data Q13;
set prg2020.in_inc_2020;
keep 
'Q13-5_2020'n 
'Q13-9_2020'n 
'RR-PENSIONS-1_2020'n 
'RR-PENSIONS-2_2020'n 
'RR-ANNUITIES-1_2020'n 
'RR-ANNUITIES-2_2020'n 
'RR-IRA-1_2020'n 
'RR-IRA-3_2020'n 
'RR-IRA-4_2020'n 
'RR-SOCSEC-1_2020'n 
'Q13-69_SS_2020'n 
'Q13-70A_SS_2020'n 
'Q13-70_SS_2020'n 
'Q13-70A_DIS.01_2020'n 
'Q13-70A_DIS.02_2020'n 
'Q13-70_DIS.01_2020'n 
'Q13-70_DIS.02_2020'n 
'Q13-31A_2020'n 
'Q13-31B_2020'n 
'Q13-70A_VET_2020'n 
'Q13-70_VET_2020'n 
'Q13-18_2020'n 
'Q13-24_2020'n 
'RSP-PENSIONS-1_2020'n 
'RSP-PENSIONS-2_2020'n 
'RSP-ANNUITIES-1_2020'n 
'RSP-ANNUITIES-2_2020'n 
'RSP-IRA-1_2020'n 
'RSP-IRA-3_2020'n 
'RSP-IRA-4_2020'n 
'RSP-SOCSEC-1_2020'n 
'Q13-69_SS-SP_2020'n 
'Q13-70A_SS-SP_2020'n 
'Q13-70_SS-SP_2020'n 
'Q13-70A_DIS-SP.01_2020'n 
'Q13-70A_DIS-SP.02_2020'n 
'Q13-70_DIS-SP.01_2020'n 
'Q13-70_DIS-SP.02_2020'n 
'Q13-31A-SP_2020'n 
'Q13-31B-SP_2020'n 
'Q13-70A-SP_VET_2020'n 
'Q13-70_VET-SP_2020'n 
'Q13-71_2020'n 
'Q13-73A_2020'n 
'Q13-74_2020'n 
'Q13-75_2020'n 
'Q13-80-NEW_2020'n 
'Q13-81-NEW_2020'n 
'CURDATE~D_2020'n 
'CURDATE~M_2020'n 
'CURDATE~Y_2020'n 
norcid 
'Q13-10_2020'n 
;

rename 
'Q13-5_2020'n = Q13_5
'Q13-9_2020'n = q13_9
'RR-PENSIONS-1_2020'n = RR_pen1
'RR-PENSIONS-2_2020'n = RR_pen2
'RR-ANNUITIES-1_2020'n = RR_anu1
'RR-ANNUITIES-2_2020'n = RR_anu2
'RR-IRA-1_2020'n = RR_ira1
'RR-IRA-3_2020'n = RR_ira3
'RR-IRA-4_2020'n = RR_ira4
'RR-SOCSEC-1_2020'n = RR_SS
'Q13-69_SS_2020'n = Q69_SS
'Q13-70A_SS_2020'n = q70a_ss
'Q13-70_SS_2020'n = q70_ss
'Q13-70A_DIS.01_2020'n = q70a_dis1
'Q13-70A_DIS.02_2020'n = q70a_dis2
'Q13-70_DIS.01_2020'n = q70_dis1
'Q13-70_DIS.02_2020'n = q70_dis2
'Q13-31A_2020'n = q13_31a
'Q13-31B_2020'n = q13_31b
'Q13-70A_VET_2020'n = q70a_vet
'Q13-70_VET_2020'n = q70_vet
'Q13-18_2020'n = q13_18
'Q13-24_2020'n = q13_24
'RSP-PENSIONS-1_2020'n = RS_pen1
'RSP-PENSIONS-2_2020'n = RS_pen2
'RSP-ANNUITIES-1_2020'n = RS_anu1
'RSP-ANNUITIES-2_2020'n = RS_anu2
'RSP-IRA-1_2020'n = RS_ira1
'RSP-IRA-3_2020'n = RS_ira3
'RSP-IRA-4_2020'n = RS_ira4
'RSP-SOCSEC-1_2020'n = RS_SS 
'Q13-69_SS-SP_2020'n = q69_SS_SP
'Q13-70A_SS-SP_2020'n = q70a_ss_sp
'Q13-70_SS-SP_2020'n = q70_ss_sp
'Q13-70A_DIS-SP.01_2020'n = q70a_dis1_sp
'Q13-70A_DIS-SP.02_2020'n = q70a_dis2_sp
'Q13-70_DIS-SP.01_2020'n = q70_dis1_sp
'Q13-70_DIS-SP.02_2020'n = q70_dis2_sp
'Q13-31A-SP_2020'n = q13_31a_sp
'Q13-31B-SP_2020'n = q13_31b_sp
'Q13-70A-SP_VET_2020'n = q70a_vet_sp
'Q13-70_VET-SP_2020'n = q70_vet_sp
'Q13-71_2020'n = q13_71
'Q13-73A_2020'n = q13_73a
'Q13-74_2020'n = q13_74
'Q13-75_2020'n = q13_75
'Q13-80-NEW_2020'n = q13_80
'Q13-81-NEW_2020'n = q13_81
'CURDATE~D_2020'n = curday 
'CURDATE~M_2020'n = curmo 
'CURDATE~Y_2020'n = curyr 
'Q13-10_2020'n = q10
;

data one; 
merge inc2020.in_fam2020 Q13 UCr UCsp Wel;
by norcid;
if FAMSIZE ~= -5;

paflaga = paflag;
if (rel01 = 33 | rel02 = 33 | rel03 = 33 | rel04 = 33 | rel05 = 33
| rel06 = 33 | rel07 = 33 | rel08 = 33 | rel09 = 33 | rel10 = 33
| rel11 = 33 )
then paflaga=1;

spflaga = spflag; 
if (rel01 = 1 | rel02 = 1 | rel03 = 1 | rel04 = 1 | rel05 = 1
| rel06 = 1 | rel07 = 1 | rel08 = 1 | rel09 = 1 | rel10 = 1
| rel11 = 1 )
then spflaga=1;

***** respondent (and dependent children) income;
* wager--wage;
wager=-4;
if q13_5=-4 then wager=0;
else wager=q13_5;

* farmr--income from farm or business;
farmr=-4;
if q13_9=-4 then farmr=0;
else farmr=q13_9;

* penr--income from retirement pension; 
penr=-4;
if RR_pen2 in (-4 0) then penr=0;
else penr=RR_pen2;

* anur--income from retirement annuity; 
anur=-4;
if RR_anu2 in (-4 0) then anur=0;
else anur=RR_anu2;

* irar--withdraw from IRA;
irar=-4;
if RR_ira4 in (-4 0) then irar=0;
else irar=RR_ira4;

* ssr--income from social security;
ssr=-4;
if q70_ss=-4 then ssr=0;
else if q70a_ss in (-1 -2 -3) or q70_ss in (-1 -2 -3) then ssr=-3;
else if q70a_ss>=0 and q70_ss>=0 then ssr=q70a_ss * q70_ss;

* dis1r--veteran disability;
dis1r=-4;
if q70_dis1=-4 then dis1r=0;
else if q70a_dis1 in (-1 -2 -3) or q70_dis1 in (-1 -2 -3) then dis1r=-3;
else if q70a_dis1>=0 and q70_dis1>=0 then dis1r=q70a_dis1 * q70_dis1;

* dis2r--other disability;
dis2r=-4;
if q70_dis2=-4 then dis2r=0;
else if q70a_dis2 in (-1 -2 -3) or q70_dis2 in (-1 -2 -3) then dis2r=-3;
else if q70a_dis2>=0 and q70_dis2>=0 then dis2r=q70a_dis2 * q70_dis2;

* wcmpr--worker comp;
wcmpr=-4;
if q13_31b in (-4, 0) then wcmpr=0;
else wcmpr=q13_31b;

* vetr--other veteran benefit;
vetr=-4;
if q70_vet=-4 then vetr=0;
else if q70a_vet in (-1 -2 -3) or q70_vet in (-1 -2 -3) then vetr=-3;
else if q70a_vet>=0 and q70_vet>=0 then vetr=q70a_vet * q70_vet;

* respondent UC;
ucr=-3;
if curyr=2020 then ucr=ucr119;
else if curyr=2021 then ucr=ucr120;
if ucr in (. -4) then ucr=0;
if ucr in (-1 -2) then ucr=-3;

***** Spouse/partner;
* wages--spouse wage;
wages=-4;
if paflaga=1 or q13_18=-4 then wages=0;
else wages=q13_18;

* farms--spouse income from farm or business;
farms=-4;
if paflaga=1 or q13_24=-4 then farms=0;
else farms=q13_24;

* pensp--spouse/partner income from retirement pension; 
pensp=-4;
if RS_pen2 in (-4 0) then pensp=0;
else pensp=RS_pen2;

* anusp--spouse/partner income from retirement annuity; 
anusp=-4;
if RS_anu2 in (-4 0) then anusp=0;
else anusp=RS_anu2;

* irasp--spouse/partner withdraw from IRA;
irasp=-4;
if RS_ira4 in (-4 0) then irasp=0;
else irasp=RS_ira4;

* sssp--spouse/partner income from social security;
sssp=-4;
if q70_ss_sp=-4 then sssp=0;
else if q70a_ss_sp in (-1 -2 -3) or q70_ss_sp in (-1 -2 -3) then sssp=-3;
else if q70a_ss_sp>=0 and q70_ss_sp>=0 then sssp=q70a_ss_sp * q70_ss_sp;

* dis1sp--spouse/partner veteran disability;
dis1sp=-4;
if q70_dis1_sp=-4 then dis1sp=0;
else if q70a_dis1_sp in (-1 -2 -3) or q70_dis1_sp in (-1 -2 -3) then dis1sp=-3;
else if q70a_dis1_sp>=0 and q70_dis1_sp>=0 then dis1sp=q70a_dis1_sp * q70_dis1_sp;

* dis2sp--spouse/partner other disability;
dis2sp=-4;
if q70_dis2_sp=-4 then dis2sp=0;
else if q70a_dis2_sp in (-1 -2 -3) or q70_dis2_sp in (-1 -2 -3) then dis2sp=-3;
else if q70a_dis2_sp>=0 and q70_dis2_sp>=0 then dis2sp=q70a_dis2_sp * q70_dis2_sp;

* wcmpsp--spouse/partner worker comp;
wcmpsp=-4;
if q13_31b_sp in (-4, 0) then wcmpsp=0;
else wcmpsp=q13_31b_sp;

* vetsp--spouse/partner other veteran benefit;
vetsp=-4;
if q70_vet_sp=-4 then vetsp=0;
else if q70a_vet_sp in (-1 -2 -3) or q70_vet_sp in (-1 -2 -3) then vetsp=-3;
else if q70a_vet_sp>=0 and q70_vet_sp>=0 then vetsp=q70a_vet_sp * q70_vet_sp;

* spouse UC;
ucs=-3;
if curyr=2020 then ucs=ucsp119;
else if curyr=2021 then ucs=ucsp120;
if paflaga=1 or ucs in (. -4) then ucs=0;
else if ucs in (-1 -2) then ucs=-3;

***** R and spouse/partner;
* afdc, food stamps, ssi and ssdi;
wel=-3;
if curyr=2020 then wel=wel119;
else if curyr=2021 then wel=wel120;
if wel in (-4 .) then wel=0;

*estates/trusts/inheritances;
trst=-4;
if q13_73a in (-4 0) then trst=0;
else trst=q13_73a;

*income from other sources;
othrs=-4; *s refers to sources;
if q13_75 in (-4 0) then othrs=0;
else othrs=q13_75;

*income from other family memeber in the house;
othrp=-4; *p refers to people;
if q13_81 in (-4 0) then othrp=0;
else othrp=q13_81;

***** total family income;
array comp (*) wager farmr penr anur irar ssr dis1r dis2r wcmpr vetr ucr
wages farms pensp anusp irasp sssp dis1sp dis2sp wcmpsp vetsp ucs
wel othrs othrp; *removed trst; 
faminc=0;
do j=1 to dim(comp);
if comp(j) in (-1 -2 -3) then do; faminc=-3; j=dim(comp); end;
else if faminc>=0 & comp(j)>=0 then faminc=faminc + comp(j);
end;

***** Poverty level;
* Federal Poverty Guidelines;
* https://aspe.hhs.gov/2019-poverty-guidelines;
* https://aspe.hhs.gov/2020-poverty-guidelines;
table19 = 12490;*for 1 person in family for 48 states and DC for 2019;
tbl19_inc=4420;*for each additional person for 48 states and DC for 2019;
table20=12760;*for 1 person in family for 48 states and DC for 2020;
tbl20_inc=4480;*for each additional person for 48 states and DC for 2020;

if curyr=2020 then do;
if famsize > 0 then level= table19 + (tbl19_inc * (famsize-1));*interviewed in 2020 using 2019 guideline;
end;
else if curyr=2021 then do;
if famsize > 0 then level= table20 + (tbl20_inc * (famsize-1));*interviewed in 2021 using 2020 guideline;
end;
if (faminc > level) then cps_cur=0;
else if (faminc >= 0 & faminc <= level) then cps_cur=1;
else cps_cur=-3;

***** topcode;
faminc_t=faminc;
if faminc>365000 then faminc_t=803437;

Introduction

The Family Poverty Status variable is calculated using a combination of reported family income, the number of family members in the respondent's household, and the national Poverty Income Guidelines, which are updated yearly by the U.S. Department of Health and Human Services. The Poverty Income Guidelines are based on family size; the poverty guidelines set a base amount for smallest family size of one person and increases by a standard amount for each additional family member living in the household.

An NLSY79 respondent is determined to be in poverty if total net family income for the last calendar year is below the Poverty Income Guidelines given their family size.

Poverty Income Guideline Tables

The national Poverty Income Guidelines used in creating the family poverty status variable are shown below.

Questions about the use of the poverty guidelines in one of the outlying jurisdictions (Puerto Rico, the U.S. Virgin Islands, American Samoa, Guam, the Marshall Islands, the Federated States of Micronesia, the Commonwealth of the North Marianas, and Palau) by a Federal program serving any of those jurisdictions should be referred to the Federal office responsible for the individual program involved.

Table 1. Poverty Income Guidelines by NLSY79 Survey Year
Survey Year Poverty Income Guidelines Year First Person Each Additional Person Four-person Family
1979 1978 $3,140 $1,020 $6,200
1980 1979 $3,400 $1,100 $6,700
1981 1980 $3,790 $1,220 $7,450
1982 1981 $4,310 $1,380 $8,450
1983 1982 $4,680 $1,540 $9,300
1984 1983 $4,860 $1,680 $9,900
1985 1984 $4,980 $1,740 $10,200
1986 1985 $5,250 $1,800 $10,650
1987 1986 $5,360 $1,880 $11,000
1988 1987 $5,500 $1,900 $11,200
1989 1988 $5,770 $1,960 $11,650
1990 1989 $5,980 $2,040 $12,100
1991 1990 $6,280 $2,140 $12,700
1992 1991 $6,620 $2,260 $13,400
1993 1992 $6,810 $2,380 $13,950
1994 1993 $6,970 $2,460 $14,350
1996 1995 $7,470 $2,560 $15,150
1998 1997 $7,890 $2,720 $16,050
2000 1999 $8,240 $2,820 $16,700
2002 2001 $8,590 $3,020 $17,650
2004 2003 $8,980 $3,140 $18,400
2006 2005 $9,570 $3,260 $19,350
2008 2007 $10,210 $3,480 $20,650
2010 2009 $10,830 $3,740 $22,050
2012 2011 $10,890 $3,820 $22,350
2014 2013 $11,670 $4,060 $23,850
2016 2015 (2016 interview date) $11,770 $4,160 $24,250
2016 2016 (2017 interview date) $11,880 $4,140 $24,300
2018 2017 (2018 interview date) $12,060 $4,180 $24,600
2018 2018 (2019 interview date) $12,140 $4,320 $25,100
2020 2019 (2020 interview date) $12,490 $4,420 $25,750
2020 2020 (2021 interview date) $12,760 $4,480 $26,200

Users interested in information on the variables created using the old poverty guideline standards should download the Family Poverty Status and Family Poverty Level Historical Variables (PDF).

NLSY79 Appendix 1: Employment Status Recode Variables (1979-1998 and 2006)

Employment Status Recode (ESR) is a standard measure of the respondent's main labor force activity during the survey week (Sunday through Saturday preceding the interview date). What follows is a PL/I adaptation of a Fortran program used by the Census Bureau to create ESR for 1979-1993, for 1994 through 1998, an SPSS adaptation of the decision rules provided by the Census Bureau to create MLR using the new CAPI-generated CPS data, and for 2006, a SAS adaptation of these rules. Note that ESR was not created in 2000-2004 or 2008-present because the CPS section on activity in the week before the survey was not included in those rounds.

General Code: Variable Creation 1979-1983

 DCL 1 ESR_VARIABLES(5),
       5 ABSENT,
       5 ANYWK,
       5 DO4WKS,
       5 DOING,
       5 EMPLOY,
       5 EMPTYP,
       5 ESR,
       5 ESRC,
       5 HRSWK,
       5 INDTYP,
       5 LOOK,
       5 MILITARY,
       5 NEWJOB,
       5 OCCTYP,
       5 WEEKS,
       5 WEIGHT,
       5 WHYNOT,
       5 WHYOFF;

1979 VARIABLES

DOING(1)=R(434.);
          IF R(434.)<1 ! R(434.)>7 THEN DOING(1)=NA;
          ANYWK(1)=R(435.);
          IF R(435.)<0 ! R(435.)>1 THEN ANYWK(1)=NA;
          HRSWK(1)=R(436.);
          IF R(436.)<1 ! R(436.)>96 THEN HRSWK(1)=NA;
          IF R(444.)>0 THEN HRSWK(1)=R(444.);
          IF R(450.)>0 THEN HRSWK(1)=R(450.);
          HRANGE(1)=R(437.);
          IF R(437.)<1 ! R(437.)>3 THEN HRANGE(1)=NA;
          HRS35(1)=R(438.);
          IF R(438.)<0 ! R(438.)>1 THEN HRS35(1)=NA;
          REAS35(1)=R(439.);
          IF R(439.)<1 ! R(439.)>19 THEN REAS35(1)=NA;
          IF R(440.)>0 THEN REAS35(1)=R(440.);
          IF R(445.)=1 THEN HRANGE(1)=R(445.);
          IF R(446.)>0 THEN REAS35(1)=R(446.);
          OFFWORK(1)=R(441.);
          IF R(441.)<0 ! R(441.)>1 THEN OFFWORK(1)=NA;
          OTIME(1)=R(447.);
          IF R(447.)<0 ! R(447.)>1 THEN OTIME(1)=NA;
          ABSENT(1)=R(452.);
          IF R(452.)<0 ! R(452.)>1 THEN ABSENT(1)=NA;
          WHYOFF(1)=R(453.);
          IF R(453.)<1 R(453.)>9 THEN WHYOFF(1)=NA;
          SALARY(1)=R(459.);
          IF R(459.)<0 ! R(459.)>3 THEN SALARY(1)=NA;
          WORK35(1)=R(460.);
          IF R(460.)<0 ! R(460.)>1 THEN WORK35(1)=NA;
          LOOK(1)=R(511.);
          IF R(511.)<0 ! R(511.)>1 THEN LOOK(1)=NA;
          DO4WKS(1)=R(512.);
          WHYLK(1)=R(517.);
          IF R(517.)<1 ! R(517.)>11 THEN WHYLK(1)=NA;
          WEEKS(1)=R(457.);
          IF R(457.)<1 ! R(457.)>96 THEN WEEKS(1)=NA;
          IF R(519.)>0 THEN WEEKS(1)=R(519.);
          IF R(523.)>0 THEN WEEKS(1)=R(523.);
          WKTIME(1)=R(458.);
          IF R(458.)<1 ! R(458.)>2 THEN WKTIME(1)=NA;
          IF R(520.)>0 THEN WKTIME(1)=R(520.);
          IF R(524.)>0 THEN WKTIME(1)=R(524.);
          WHYNOT(1)=R(522.);
          IF R(522.)<1 ! R(522.)>5 THEN WHYNOT(1)=NA;
          IF R(521.)=0 THEN WHYNOT(1)=R(521.);
          IF R(525.)=0 THEN WHYNOT(1)=R(525.);
          IF R(526.)>0 THEN WHYNOT(1)=R(526.);
          INDTYP(1)=R(463.);
          IF R(463.)<0 ! R(463.)>998 THEN INDTYP(1)=NA;
          EMPTYP(1)=R(468.);
          IF R(468.)<0 ! R(468.)>4 THEN EMPTYP(1)=NA;
          OCCTYP(1)=R(464.);
          IF R(464.)<0 ! R(464.)>994 THEN OCCTYP(1)=NA;
          IF R(512.)>0 ! R(513.)>0 ! R(514.)>0 ! 
             R(515.)>0 ! R(516.)>0 THEN DO;
          IF R(512.)>1 ! R(513.)>1 ! R(514.)>1 ! 
             R(515.)>1 ! R(516.)>1 THEN DO;
          DO I=512. TO 516.;
             IF R(I)=1 THEN R(I)=-3;
             END;
             IF DO4WKS(1)<2 THEN DO4WKS(1)=10;
             END;
             IF (R(512.)=1 ! R(513.)=1 ! R(514.)=1 ! R(515.)=1 ! R(516.)=1) &
                DO4WKS(1)^=1 THEN DO4WKS(1)=1;
          END;
          ELSE DO4WKS(1)=NA;
          IF INDTYP(1)^=NA ! EMPTYP(1)^=NA ! OCCTYP(1)^=NA THEN EMPLOY(1)=1;
          ELSE EMPLOY(1)=0;
          IF R(433.)=1 THEN MILITARY(1)=1;
          ELSE MILITARY(1)=NA;
          WEIGHT(1)=R(2161.);

1980 VARIABLES

DOING(2)=R(2604.);
          IF R(2604.)<1 ! R(2604.)>7 THEN DOING(2)=NA;
          ANYWK(2)=R(2605.);
          IF R(2605.)<0 ! R(2605.)>1 THEN ANYWK(2)=NA;
          HRSWK(2)=R(2606.);
          IF R(2606.)<1 ! R(2606.)>96 THEN HRSWK(2)=NA;
          IF R(2614.)>0 THEN HRSWK(2)=R(2614.);
          IF R(2620.)>0 THEN HRSWK(2)=R(2640.);
          HRANGE(2)=R(2607.);
          IF R(2607.)<1 ! R(2607.)>3 THEN HRANGE(2)=NA;
          HRS35(2)=R(2608.);
          IF R(2608.)<0 ! R(2608.)>1 THEN HRS35(2)=NA;
          REAS35(2)=R(2609.);
          IF R(2609.)<1 ! R(2609.)>19 THEN REAS35(2)=NA;
          IF R(2610.)>0 THEN REAS(2)=R(2610.);
          IF R(2615.)=1 THEN HRANGE(2)=R(2615.);
          IF R(2616.)>0 THEN REAS35(2)=R(2616.);
          OFFWRK(2)=R(2611.);
          IF R(2611.)<0 ! R(2611.)>1 THEN OFFWRK(2)=NA;
          OTIME(2)=R(2617.);
          IF R(2617.)<0 ! R(2617.)>1 THEN OTIME(2)=NA;
          ABSENT(2)=R(2622.);
          IF R(2622.)<0 ! R(2622.)>1 THEN ABSENT(2)=NA;
          WHYOFF(2)=R(2623.);
          IF R(2623.)<1 ! R(2623.)>9 THEN WHYOFF(2)=NA;
          SALARY(2)=R(2629.);
          IF R(2629.)<0 ! R(2629.)>3 THEN SALARY(2)=NA;
          WORK35(2)=R(2630.);
          IF R(2630.)<0 ! R(2630.)>1 THEN WORK35(2)=NA;
          LOOK(2)=R(2681.);
          IF R(2681.)<0 ! R(2681.)>1 THEN LOOK(2)=NA;
          DO4WKS(2)=NA;
          IF R(2682.)=1 THEN DO4WKS(2)=1;
          ELSE IF R(2683.)>0 THEN DO4WKS(2)=2;
          ELSE IF R(2684.)>0 THEN DO4WKS(2)=3;
          ELSE IF R(2685.)>0 THEN DO4WKS(2)=4;
          ELSE IF R(2686.)>0 THEN DO4WKS(2)=5;
          ELSE IF R(2687.)>0 THEN DO4WKS(2)=6;
          ELSE IF R(2688.)>0 THEN DO4WKS(2)=7;
          ELSE IF R(2689.)>0 THEN DO4WKS(2)=8;
          ELSE IF R(2690.)>0 THEN DO4WKS(2)=9;
          WHYLK(2)=R(2691.);
          IF R(2691.)<1 ! R(2691.)>11 THEN WHYLK(2)=NA;
          WEEKS(2)=R(2627.);
          IF R(2627.)<1 ! R(2627.)>96 THEN WEEKS(2)=NA;
          IF R(2693.)>0 THEN WEEKS(2)=R(2693.);
          IF R(2697.)>0 THEN WEEKS(2)=R(2697.);
          WKTIME(2)=R(2628.);
          IF R(2628.)<1 ! R(2628.)>2 THEN WKTIME(2)=NA;
          IF R(2694.)>0 THEN WKTIME(2)=R(2694.);
          IF R(2698.)>0 THEN WKTIME(2)=R(2698.);
          WHYNOT(2)=R(2696.);
          IF R(2696.)<1 ! R(2696.)>5 THEN WHYNOT(2)=NA;
          IF R(2695.)=0 THEN WHYNOT(2)=R(2695.);
          IF R(2699.)=0 THEN WHYNOT(2)=R(2699.);
          IF R(2700.)>0 THEN WHYNOT(2)=R(2700.);
          INDTYP(2)=R(2633.);
          IF R(2633.)<0 ! R(2633.)>998 THEN INDTYP(2)=NA;
          EMPTYP(2)=R(2635.);
          IF R(2635.)<0 ! R(2635.)>4 THEN EMPTYP(2)=NA;
          OCCTYP(2)=R(2634.);
          IF R(2634.)<0 ! R(2634.)>994 THEN OCCTYP(2)=NA;
          IF R(2682.)>0 ! R(2683.)>0 ! R(2684.)>0 ! R(2685.)>0 ! R(2686.)>0 !
             R(2687.)>0 ! R(2688.)>0 ! R(2689.)>0 ! R(2690.)>0 THEN DO;
             IF R(2682.)>1 ! R(2683.)>1 ! R(2684.)>1 ! 
                R(2685.)>1 ! R(2686.)>1 !
                R(2687.)>1 ! R(2688.)>1 ! R(2689.)>1 ! R(2690.)>1 THEN DO;
                IF R(2682.)=1 THEN R(2682.)=-3;
                IF DO4WKS(2)<2 THEN DO4WKS(2)=10;
             END;
             IF R(2682.)=1 & DO4WKS(2)^=1 THEN DO4WKS(2)=1;
          END;
          ELSE DO4WKS(2)=NA;
          IF INDTYP(2)^=NA ! EMPTYP(2)^=NA ! OCCTYP(2)^=NA THEN EMPLOY(2)=1;
          ELSE EMPLOY(2)=0;
          IF R(2624.)<1 ! R(2624.)>2 THEN NEWJOB(2)=NA;
          ELSE NEWJOB(2)=R(2624.);
          WEIGHT(2)=R(4052.);
          IF R(2603.)=1 THEN MILITARY(2)=1;
          ELSE MILITARY(2)=NA;

1981 VARIABLES

 IF R(4434.)<1 THEN DOING(3)=NA;
          ELSE DOING(3)=R(4434.);
          IF R(4435.)<0 THEN ANYWK(3)=NA;
          ELSE ANYWK(3)=R(4435.);
          IF R(4436.)<1 THEN HRSWK(3)=NA;
          ELSE HRSWK(3)=R(4436.);
          IF R(4444.)>0 THEN HRSWK(3)=R(4444.);
          IF R(4450.)>0 THEN HRSWK(3)=R(4450.);
          IF R(4452.)<0 THEN ABSENT(3)=NA;
          ELSE ABSENT(3)=R(4452.);
          IF R(4453.)<1 THEN WHYOFF(3)=NA;
          ELSE WHYOFF(3)=R(4453.);
          IF R(4495.)<0 THEN LOOK(3)=NA;
          ELSE LOOK(3)=R(4495.);
          DO4WKS(3)=NA;
          IF R(4496.)=1 THEN DO4WKS(3)=1;
          IF R(4497.)>0 ! R(4498.)>0 ! R(4499.)>0 ! R(4500.)>0 ! R(4501.)>0 !
             R(4502.)>0 ! R(4503.)>0 ! R(4504.)>0 THEN DO4WKS(3)=2;
          IF R(4457.)<1 THEN WEEKS(3)=NA;
          ELSE WEEKS(3)=R(4457.);
          IF R(4507.)>0 THEN WEEKS(3)=R(4507.);
          IF R(4511.)>0 THEN WEEKS(3)=R(4511.);
          IF R(4510.)<1 THEN WHYNOT(3)=NA;
          ELSE WHYNOT(3)=R(4510.);
          IF R(4509.)=0 ! R(4513.)=0 THEN WHYNOT(3)=0;
          IF R(4514.)>0 THEN WHYNOT(3)=R(4514.);
          IF R(4463.)<0 ! R(4463.)>998 THEN INDTYP(3)=NA;
          ELSE INDTYP(3)=R(4463.);
          IF R(4464.)<0 ! R(4464.)>994 THEN OCCTYP(3)=NA;
          ELSE OCCTYP(3)=R(4464.);
          IF R(4466.)<0 THEN EMPTYP(3)=NA;
          ELSE EMPTY(3)=R(4466.);
          IF R(4454.)<1 ! R(4454.)>2 THEN NEWJOB(3)=NA;
          ELSE NEWJOB(3)=R(4454.);
          IF INDTYP(3)^=NA ! OCCTYP(3)^=NA ! EMPTYP(3)^=NA THEN EMPLOY(3)=1;
          ELSE EMPLOY(3)=0;
          WEIGHT(3)=R(6146.);
          IF R(4433.)=1 THEN MILITARY(3)=1;
          ELSE MILITARY(3)=NA;

 

1982 VARIABLES

IF R(6935.)<1 THEN DOING(4)=NA;
          ELSE DOING(4)=R(6935.);
          IF R(6936.)<0 THEN ANYWK(4)=NA;
          ELSE ANYWK(4)=R(6936.);
          IF R(6937.)<1 THEN HRSWK(4)=NA;
          ELSE HRSWK(4)=R(6937.);
          IF R(6945.)>0 THEN HRSWK(4)=R(6945.);
          IF R(6951.)>0 THEN HRSWK(4)=R(6951.);
          IF R(6953.)<0 THEN ABSENT(4)=NA;
          ELSE ABSENT(4)=R(6953.);
          IF R(6954.)<1 THEN WHYOFF(4)=NA;
          ELSE WHYOFF(4)=R(6954.);
          IF R(6963.)<0 THEN LOOK(4)=NA;
          ELSE LOOK(4)=R(6963.);
          DO4WKS(4)=NA;
          IF R(6964.)=1 THEN DO4WKS(4)=1;
          IF R(6965.)>0 ! R(6966.)>0 ! R(6967.)>0 ! R(6968.)>0 ! R(6969.)>0 !
             R(6970.)>0 ! R(6971.)>0 ! R(6972.)>0 THEN DO4WKS(4)=2;
          IF R(6958.)<1 THEN WEEKS(4)=NA;
          ELSE WEEKS(4)=R(6958.);
          IF R(6975.)>0 THEN WEEKS(4)=R(6975.);
          IF R(6979.)>0 THEN WEEKS(4)=R(6979.);
          IF R(6978.)<1 THEN WHYNOT(4)=NA;
          ELSE WHYNOT(4)=R(6978.);
          IF R(6977.)=0 ! R(6981.)=0 THEN WHYNOT(4)=0;
          IF R(6982.)>0 THEN WHYNOT(4)=R(6982.);
          IF R(7020.)<0 ! R(7020.)>998 THEN INDTYP(4)=NA;
          ELSE INDTYP(4)=R(7020.);
          IF R(7021.)<0 ! R(7021.)>994 THEN OCCTYP(4)=NA;
          ELSE OCCTYP(4)=R(7021.);
          IF R(7023.)<0 THEN EMPTYP(4)=NA;
          ELSE EMPTYP(4)=R(7023.);
          IF R(6955.)<1 ! R(6955.)>2 THEN NEWJOB(4)=NA;
          ELSE NEWJOB(4)=R(6955.);
          IF (INDTYP(4)^=NA ! OCCTYP(4)^=NA ! EMPTYP(4)^=NA) & R(6983.)^=1 &
             R(7009.)^=1 THEN EMPLOY(4)=1;
          ELSE EMPLOY(4)=0;
          WEIGHT(4)=R(8967.);
          IF R(6934.)=1 THEN MILITARY(4)=1;
          ELSE MILITARY(4)=NA;

1983 VARIABLES

 IF R(9365.)<1 THEN DOING(5)=NA;
          ELSE DOING(5)=R(9365.);
          IF R(9366.)<0 THEN ANYWK(5)=NA;
          ELSE ANYWK(5)=R(9366.);
          IF R(9367.)<1 THEN HRSWK(5)=NA;
          ELSE HRSWK(5)=R(9367.);
          IF R(9375.)>0 THEN HRSWK(5)=R(9375.);
          IF R(9381.)>0 THEN HRSWK(5)=R(9381.);
          IF R(9383.)<0 THEN ABSENT(5)=NA;
          ELSE ABSENT(5)=R(9383.);
          IF R(9384.)<1 THEN WHYOFF(5)=NA;
          ELSE WHYOFF(5)=R(9384.);
          IF R(9393.)<0 THEN LOOK(5)=NA;
          ELSE LOOK(5)=R(9393.);
          DO4WKS(5)=NA;
          IF R(9394.)=1 THEN DO4WKS(5)=1;
          IF R(9395.)>0 ! R(9396.)>0 ! R(9397.)>0 ! R(9398.)>0 ! R(9399.)>0 !
             R(9400.)>0 ! R(9401.)>0 ! R(9402.)>0 THEN DO4WKS(5)=2;
          IF R(9388.)<1 THEN WEEKS(5)=NA;
          ELSE WEEKS(5)=R(9388.);
          IF R(9405.)>0 THEN WEEKS(5)=R(9405.);
          IF R(9408.)>0 THEN WEEKS(5)=R(9408.);
          IF R(9407.)=0 ! R(9410.)=0 THEN WHYNOT(5)=0;
          IF R(9411.)>0 THEN WHYNOT(5)=R(9411.);
          IF R(9449.)<0 ! R(9449.)>998 THEN INDTYP(5)=NA;
          ELSE INDTYP(5)=R(9449.);
          IF R(9450.)<0 ! R(9450.)>994 THEN OCCTYP(5)=NA;
          ELSE OCCTYP(5)=R(9450.);
          IF R(9454.)<0 THEN EMPTYP(5)=NA;
          ELSE EMPTYP(5)=R(9454.);
          IF R(9385.)<1 ! R(9385.)>2 THEN NEWJOB(5)=NA;
          ELSE NEWJOB(5)=R(9385.);
          IF (INDTYP(5)^=NA ! OCCTYP(5)^=NA ! EMPTYP(5)^=NA) & R(9412.)^=1 &
             R(9439.)^=1 THEN EMPLOY(5)=1;
          ELSE EMPLOY(5)=0;
          WEIGHT(5)=R(11444.);
          IF R(9364.)=1 THEN MILITARY(5)=1;
          ELSE MILITARY(5)=NA;
          DO I=1 TO 5;
             IF MILITARY(I)=1 THEN DO;
                ESR(I)=8;
                GO TO FIN;
             END;
             IF I=1 & R(1.)=6435 THEN DO;
                ESR(1)=-3;
                GO TO FIN;
             END;
             IF WEIGHT(I)=0 THEN DO;
                ESR(I)=-5;
                GO TO FIN;
             END;
             ESR(I)=7;
             IF DOING(I)^=1 THEN GO TO P6;
             IF HRSWK(I)=NA THEN GO TO P4;
             IF HRSWK(I)>=15 ! EMPTYP(I)^=4 THEN ESR(I)=1;
             GO TO P20000;
             P4: IF EMPLOY(I)=1 THEN ESR(I)=1;
             GO TO P20000;
             P6: ESR(I)=1;
             IF ANYWK(I)^=1 THEN GO TO P11;
             IF HRSWK(I)=NA THEN GO TO P9;
             IF HRSWK(I)<15 & EMPTYP(I)=4 THEN GO TO P61;
             GO TO P62;
             P9: IF EMPLOY(I)=0 THEN GO TO P61;
             GO TO P62;
             P11: IF HRSWK(I)=NA THEN GO TO P15;
             IF EMPLOY(I)=0 THEN GO TO P61;
             IF HRSWK(I)<15 & EMPTYP(I)=4 THEN GO TO P61;
             GO TO P62;
             P15: ESR(I)=7;
             IF DOING(I)=2 THEN GO TO ESR237;
             IF DOING(I)=3 THEN GO TO P21;
             GO TO P37;
             P21: IF ABSENT(I)^=1 THEN GO TO P27;
             GO TO ESR237;
             P27: IF WHYOFF(I)=NA THEN GO TO P32;
             IF WHYOFF(I)=6 ! WHYOFF(I)=7 THEN GO TO P29;
             IF EMPLOY(I)^=0 & EMPTYP(I)^=4 THEN ESR(I)=2;
             GO TO P20000;
             P29: IF WHYNOT(I)<3 THEN ESR(I)=3;
             GO TO P20000;
             P32: IF DO4WKS(I)=1 THEN GO TO P20000;
             IF WHYNOT(I)>2 THEN GO TO P20000;
             IF WEEKS(I)=NA THEN GO TO P33;
             ESR(I)=3;
             GO TO P20000;
             P33: IF DO4WKS(I)>1 ! WHYNOT(I)^=NA THEN ESR(I)=3;
             GO TO P20000;
             P37: ESR(I)=2;
             IF ABSENT(I)^=1 THEN GO TO P43;
             IF WHYOFF(I)=NA THEN GO TO P41;
             IF WHYOFF(I)=6 ! WHYOFF(I)=7 THEN GO TO P39;
             IF EMPTYP(I)=4 THEN GO TO P61;
             GO TO P62;
             P39: IF WHYNOT(I)>2 THEN GO TO P61;
             ESR(I)=3;
             GO TO P62;
             P41: IF EMPLOY(I)=0 ! EMPTYP(I)=4 THEN GO TO P61;
             GO TO P62;
             P43: IF WHYOFF(I)=NA THEN GO TO P48;
             IF WHYOFF(I)=6 ! WHYOFF(I)=7 THEN GO TO P45;
             IF EMPLOY(I)=0 ! EMPTYP(I)=4 THEN GO TO P61;
             GO TO P62;
             P45: IF WEEKS(I)=NA & WHYNOT(I)=NA THEN GO TO P61;
             IF WHYNOT(I)>2 THEN GO TO P61;
             ESR(I)=3;
             GO TO P62;
             P48: ESR(I)=3;
             IF LOOK(I)^=1 THEN GO TO P53;
             IF DO4WKS(I)=1 THEN GO TO P61;
             IF WHYNOT(I)>2 THEN GO TO P61;
             IF DO4WKS(I)^=NA  ! WEEKS(I)^=NA THEN GO TO P62;
             IF WHYNOT(I)=NA THEN GO TO P61;
             GO TO P62;
             P53: IF DO4WKS(I)=1 THEN GO TO P61;
             IF WHYNOT(I)>2 THEN GO TO P61;
             IF DO4WKS(I)=NA THEN GO TO P56;
             IF WEEKS(I)^=NA ! WHYNOT(I)^=NA THEN GO TO P62;
             GO TO P61;
             P56: IF WEEKS(I)=NA ! WHYNOT(I)=NA THEN GO TO P61;
             GO TO P62;
             P61: IF DOING(I)<4 ! DOING(I)>6 THEN GO TO P610;
             ESR(I)=DOING(I);
             GO TO P20000;
             P610: ESR(I)=7;
             GO TO P20000;
             P62: IF DOING(I)=6 THEN DOING(I)=7;
             P20000: GO TO FIN;
             ESR237: IF WHYOFF(I)=NA THEN GO TO P5019;
             IF WHYOFF(I)=6 ! WHYOFF(I)=7 THEN GO TO P5017;
             IF EMPTYP(I)^=-4 THEN ESR(I)=2;
             GO TO FIN;
             P5017: IF WHYNOT(I)>2 THEN GO TO FIN;
             ESR(I)=3;
             GO TO FIN;
             P5019: IF EMPLOY(I)=1 & EMPTYP(I)^=4 THEN ESR(I)=2;
             FIN:;

COLLAPSED EMPLOYMENT STATUS RECODE 1979-1983

IF ESR(I)=-5 THEN ESRC(I)=-5;
  ELSE IF ESR(I)=1 | ESR(I)=2 THEN ESRC(I)=1;
  ELSE IF ESR(I)=3 THEN ESRC(I)=2;
  ELSE IF ESR(I)>=4 & ESR(I)<=7 THEN ESRC(I)=3;
  ELSE IF ESR(I)=8 THEN ESRC(I)=4;
  ELSE ESRC(I)=ESR(I);
 END;
 
          R(2149.)=ESR(1);
          R(4063.)=ESR(2);
          R(6188.)=ESR(3);
          R(8985.)=ESR(4);
          R(11447.)=ESR(5);
          R(2149.01)=ESRC(1);
          R(4063.01)=ESRC(2);
          R(6188.01)=ESRC(3);
          R(8985.01)=ESRC(4);
          R(11447.01)=ESRC(5);

General Code: Variable Creation 1984-1993

            5 ABSENT,
         5 ANYWK,
         5 DO4WKS,
         5 DOING,
         5 EMPLOY,
         5 EMPTYP,
         5 ESR,
         5 ESRC,
         5 HRSWK,
         5 INDTYP,
         5 LOOK,
         5 MILITARY,
         5 NEWJOB,
         5 OCCTYP,
         5 WEEKS,
         5 WEIGHT,
         5 WHYNOT,
         5 WHYOFF;

1984 VARIABLES

ESR84=-4;
          IF R(12468.)<1 THEN DOING(6)=NA;
          ELSE DOING(6)=R(12468.);
          IF R(12469.)<0 THEN ANYWK(6)=NA;
          ELSE ANYWK(6)=R(12469.);
          IF R(12470.)<1 THEN HRSWK(6)=NA;
          ELSE HRSWK(6)=R(12470.);
          IF R(12478.)>0 THEN HRSWK(6)=R(12478.);
          IF R(12484.)>0 THEN HRSWK(6)=R(12484.);
          IF R(12486.)<0 THEN ABSENT(6)=NA;
          ELSE ABSENT(6)=R(12486.);
          IF R(12487.)<1 THEN WHYOFF(6)=NA;
          ELSE WHYOFF(6)=R(12487.);
          IF R(12496.)<0 THEN LOOK(6)=NA;
          ELSE LOOK(6)=R(12496.);
          DO4WKS(6)=NA;
          IF R(12497.)=1 THEN DO4WKS(6)=1;
          IF R(12498.)>0 ! R(12499.)>0 ! R(12500.)>0 ! R(12501.)>0 !
              R(12502.)>0 ! R(12503.)>0 ! R(12504.)>0 ! R(12505.)>0
             THEN DO4WKS(6)=2;
          IF R(12491.)<1 THEN WEEKS(6)=NA;
          ELSE WEEKS(6)=R(12491.);
          IF R(12508.)>0 THEN WEEKS(6)=R(12508.);
          IF R(12512.)>0 THEN WEEKS(6)=R(12512.);
          IF R(12510.)=0 ! R(12514.)=0 THEN WHYNOT(6)=0;
          IF R(12515.)>0 THEN WHYNOT(6)=R(12515.);
          IF R(12553.)<0 ! R(12553.)>998 THEN INDTYP(6)=NA;
          ELSE INDTYP(6)=R(12553.);
          IF R(12554.)<0 ! R(12554.)>994 THEN OCCTYP(6)=NA;
          ELSE OCCTYP(6)=R(12554.);
          IF R(12558.)<0 THEN EMPTYP(6)=NA;
          ELSE EMPTYP(6)=R(12558.);
          IF R(12488.)<1 ! R(12488.)>2 THEN NEWJOB(6)=NA;
          ELSE NEWJOB(6)=R(12488.);
          IF (INDTYP(6)^=NA ! OCCTYP(6)^=NA ! EMPTYP(6)^=NA) & R(12516.)^=1 &
             R(12543.)^=1 THEN EMPLOY(6)=1;
          ELSE EMPLOY(6)=0;
          WEIGHT(6)=R(15196.);
          IF R(12467.)=1 THEN MILITARY(6)=1;
          ELSE MILITARY(6)=NA;

1985 VARIABLES

          IF R(16420.)<1 THEN DOING(7)=NA;
          ELSE DOING(7)=R(16420.);
          IF R(16421.)<0 THEN ANYWK(7)=NA;
          ELSE ANYWK(7)=R(16421.);
          IF R(16422.)<1 THEN HRSWK(7)=NA;
          ELSE HRSWK(7)=R(16422.);
          IF R(16430.)>0 THEN HRSWK(7)=R(16430.);
          IF R(16436.)>0 THEN HRSWK(7)=R(16436.);
          IF R(16438.)<0 THEN ABSENT(7)=NA;
          ELSE ABSENT(7)=R(16438.);
          IF R(16439.)<1 THEN WHYOFF(7)=NA;
          ELSE WHYOFF(7)=R(16439.);
          IF R(16448.)<0 THEN LOOK(7)=NA;
          ELSE LOOK(7)=R(16448.);
          DO4WKS(7)=NA;
          IF R(16449.)=1 THEN DO4WKS(7)=1;
          IF R(16450.)>0 ! R(16451.)>0 ! R(16452.)>0 ! R(16453.)>0 !
             R(16454.)>0 ! R(16455.)>0 ! R(16456.)>0 ! R(16457.)>0
             THEN DO4WKS(7)=2;
          IF R(16443.)<1 THEN WEEKS(7)=NA;
          ELSE WEEKS(7)=R(16443.);
          IF R(16460.)>0 THEN WEEKS(7)=R(16460.);
          IF R(16464.)>0 THEN WEEKS(7)=R(16464.);
          IF R(16462.)=0 ! R(16466.)=0 THEN WHYNOT(7)=0;
          IF R(16467.)>0 THEN WHYNOT(7)=R(16467.);
          IF R(16501.)<0 ! R(16501.)>998 THEN INDTYP(7)=NA;
          ELSE INDTYP(7)=R(16501.);
          IF R(16502.)<0 ! R(16502.)>994 THEN OCCTYP(7)=NA;
          ELSE OCCTYP(7)=R(16502.);
          IF R(16506.)<0 THEN EMPTYP(7)=NA;
          ELSE EMPTYP(7)=R(16506.);
          IF R(16440.)<1 ! R(16440.)>2 THEN NEWJOB(7)=NA;
          ELSE NEWJOB(7)=R(16440.);
          IF (INDTYP(7)^=NA ! OCCTYP(7)^=NA ! EMPTYP(7)^=NA) & R(16468.)^=1 &
             R(16493.)^=1 THEN EMPLOY(7)=1;
          ELSE EMPLOY(7)=0;
          WEIGHT(7)=R(18902.);
          IF R(16419.)=1 THEN MILITARY(7)=1;
          ELSE MILITARY(7)=NA;

1986 VARIABLES

          IF R(19146.)<1 THEN DOING(8)=NA;
          ELSE DOING(8)=R(19146.);
          IF R(19147.)<0 THEN ANYWK(8)=NA;
          ELSE ANYWK(8)=R(19147.);
          IF R(19148.)<1 THEN HRSWK(8)=NA;
          ELSE HRSWK(8)=R(19148.);
          IF R(19156.)>0 THEN HRSWK(8)=R(19156.);
          IF R(19162.)>0 THEN HRSWK(8)=R(19162.);
          IF R(19164.)<0 THEN ABSENT(8)=NA;
          ELSE ABSENT(8)=R(19164.);
          IF R(19165.)<1 THEN WHYOFF(8)=NA;
          ELSE WHYOFF(8)=R(19165.);
          IF R(19174.)<0 THEN LOOK(8)=NA;
          ELSE LOOK(8)=R(19174.);
          DO4WKS(8)=NA;
          IF R(19175.)=1 THEN DO4WKS(8)=1;
          IF R(19176.)>0 ! R(19177.)>0 ! R(19178.)>0 ! R(19179.)>0 !
             R(19180.)>0 ! R(19181.)>0 ! R(19182.)>0 ! R(19183.)>0
             THEN DO4WKS(8)=2;
          IF R(19169.)<1 THEN WEEKS(8)=NA;
          ELSE WEEKS(8)=R(19169.);
          IF R(19186.)>0 THEN WEEKS(8)=R(19186.);
          IF R(19190.)>0 THEN WEEKS(8)=R(19190.);
          IF R(19188.)=0 ! R(19192.)=0 THEN WHYNOT(8)=0;
          IF R(19193.)>0 THEN WHYNOT(8)=R(19193.);
          IF R(19227.)<0 ! R(19227.)>998 THEN INDTYP(8)=NA;
          ELSE INDTYP(8)=R(19227.);
          IF R(19228.)<0 ! R(19228.)>994 THEN OCCTYP(8)=NA;
          ELSE OCCTYP(8)=R(19228.);
          IF R(19232.)<0 THEN EMPTYP(8)=NA;
          ELSE EMPTYP(8)=R(19232.);
          IF R(19166.)<1 ! R(19166.)>2 THEN NEWJOB(8)=NA;
          ELSE NEWJOB(8)=R(19166.);
          IF (INDTYP(8)^=NA ! OCCTYP(8)^=NA ! EMPTYP(8)^=NA) & R(19194.)^=1 &
             R(19219.)^=1 THEN EMPLOY(8)=1;
          ELSE EMPLOY(8)=0;
          WEIGHT(8)=R(22573.);
          MILCUR=R(19115.);
          IF R(19141.)>=0 THEN MILCUR=R(19141.);
          IF MILCUR=1 THEN MILITARY(8)=1;
          ELSE MILTARY(8)=NA;

1987 VARIABLES

          IF R(23107.)<1 THEN DOING(9)=NA;
          ELSE DOING(9)=R(23107.);
          IF R(23108.)<0 THEN ANYWK(9)=NA;
          ELSE ANYWK(9)=R(23108.);
          IF R(23109.)<1 THEN HRSWK(9)=NA;
          ELSE HRSWK(9)=R(23109.);
          IF R(23117.)>0 THEN HRSWK(9)=R(23117.);
          IF R(23123.)>0 THEN HRSWK(9)=R(23123.);
          IF R(23125.)<0 THEN ABSENT(9)=NA;
          ELSE ABSENT(9)=R(23125.);
          IF R(23126.)<1 THEN WHYOFF(9)=NA;
          ELSE WHYOFF(9)=R(23126.);
          IF R(23135.)<0 THEN LOOK(9)=NA;
          ELSE LOOK(9)=R(23135.);
          DO4WKS(9)=NA;
          IF R(23136.)=1 THEN DO4WKS(9)=1;
          IF R(23137.)>0 ! R(23138.)>0 ! R(23139.)>0 ! R(23140.)>0 !
             R(23141.)>0 ! R(23142.)>0 ! R(23143.)>0 ! R(23144.)>0
             THEN DO4WKS(9)=2;
          IF R(23130.)<1 THEN WEEKS(9)=NA;
          ELSE WEEKS(9)=R(23130.);
          IF R(23147.)>0 THEN WEEKS(9)=R(23147.);
          IF R(23151.)>0 THEN WEEKS(9)=R(23151.);
          IF R(23149.)=0 ! R(23153.)=0 THEN WHYNOT(9)=0;
          ELSE IF R(23154.)>0 THEN WHYNOT(9) =R(23154.);
          ELSE IF R(23150.)>0 THEN WHYNOT(9)=R(23150.);
          ELSE WHYNOT(9)=NA;
          IF R(23175.)<0 ! R(23175.)>998 THEN INDTYP(9)=NA;
          ELSE INDTYP(9)=R(23175.);
          IF R(23176.)<0 ! R(23176.)>994 THEN OCCTYP(9)=NA;
          ELSE OCCTYP(9)=R(23176.);
          IF R(23180.)<0 THEN EMPTYP(9)=NA;
          ELSE EMPTYP(9)=R(23180.);
          IF R(23127.)<1 ! R(23127.)>2 THEN NEWJOB(9)=NA;
          ELSE NEWJOB(9)=R(23127.);
          IF (INDTYP(9)^=NA ! OCCTYP(9)^=NA ! EMPTYP(9)^=NA) & R(23155.)^=1 &
             R(23174.)^=1 THEN EMPLOY(9)=1;
          ELSE EMPLOY(9)=0;
                        WEIGHT(9)=R(24445.);
          MILCUR=R(23075.);
          IF R(23102.)>=0 THEN MILCUR=R(23102.);
          IF MILCUR=1 THEN MILITARY(9)=1;
          ELSE MILITARY(9)=NA;

1988 VARIABLES

          IF R(25186.)<1 THEN DOING(10)=NA;
          ELSE DOING(10)=R(25186.);
          IF R(25187.)<0 THEN ANYWK(10)=NA;
          ELSE ANYWK(10)=R(25187.);
          IF R(25188.)<1 THEN HRSWK(10)=NA;
          ELSE HRSWK(10)=R(25188.);
          IF R(25196.)>0 THEN HRSWK(10)=R(25196.);
          IF R(25202.)>0 THEN HRSWK(10)=R(25202.);
          IF R(25204.)<0 THEN ABSENT(10)=NA;
          ELSE ABSENT(10)=R(25204.);
          IF R(25205.)<1 THEN WHYOFF(10)=NA;
          ELSE WHYOFF(10)=R(25205.);
          IF R(25214.)<0 THEN LOOK(10)=NA;
          ELSE LOOK(10)=R(25214.);
          DO4WKS(10)=NA;
          IF R(25215.)=1 THEN DO4WKS(10)=1;
          IF R(25216.)>0 ! R(25217.)>0 ! R(25218.)>0 ! R(25219.)>0 !
             R(25220.)>0 ! R(25221.)>0 ! R(25222.)A>0 ! R(25223.)>0
             THEN DO4WKS(10)=2;
          IF R(25209.)<1 THEN WEEKS(10)=NA;
          ELSE WEEKS(10)=R(25209.);
          IF R(25226.)>0 THEN WEEKS(10)=R(25226.);
          IF R(25230.)>0 THEN WEEKS(10)=R(25230.);
          IF R(25228.)=0 ! R(25232.)=0 THEN WHYNOT(10)=0;
          ELSE IF R(25233.)>0 THEN WHYNOT(10)=R(25233.);
          ELSE IF R(25229.)>0 THEN WHYNOT(10)=R(25229.);
          ELSE WHYNOT(10)=NA;
          IF R(25253.)<0 ! R(25253.)>998 THEN INDTYP(10)=NA;
          ELSE INDTYP(10)=R(25253.);
          IF R(25254.)<0 ! R(25254.)>994 THEN OCCTYP(10)=NA;
          ELSE OCCTYP(10)=R(25254.);
          IF R(25258.)<0 THEN EMPTYP(10)=NA;
          ELSE EMPTYP(10)=R(25258.);
          IF R(25206.)<1 ! R(25206.)>2 THEN NEWJOB(10)=NA;
          ELSE NEWJOB(10)=R(25206.);
          IF (INDTYP(10)^=NA ! OCCTYP(10)^=NA ! EMPTYP(10)^=NA) & R(25234.)^=1
             & R(25252.)^=1 THEN EMPLOY(10)=1;
          ELSE EMPLOY(10)=0;
          WEIGHT(10)=R(28700.);
          MILCUR=R(25154.);
          IF R(25181.)>=0 THEN MILCUR=R(25181.);
          IF MILCUR=1 THEN MILITARY(10)=1;
          ELSE MILITARY(10)=NA;

1989 VARIABLES

          IF R(29175.)<1 THEN DOING(11)=NA;
          ELSE DOING(11)=R(29175.);
          IF R(29176.)<0 THEN ANYWK(11)=NA;
          ELSE ANYWK(11)=R(29176.);
          IF R(29177.)<1 THEN HRSWK(11)=NA;
          ELSE HRSWK(11)=R(29177.);
          IF R(29185.)>0 THEN HRSWK(11)=R(29185.);
          IF R(29191.)>0 THEN HRSWK(11)=R(29191.);
          IF R(29193.)<0 THEN ABSENT(11)=NA;
          ELSE ABSENT(11)=R(29193.);
          IF R(29194.)<1 THEN WHYOFF(11)=NA;
          ELSE WHYOFF(11)=R(29194.);
          IF R(29203.)<0 THEN LOOK(11)=NA;
          ELSE LOOK(11)=R(29203.);
          DO4WKS(11)=NA;
          IF R(29204.)=1 THEN DO4WKS(11)=1;
          IF R(29205.)>0 ! R(29206.)>0 ! R(29207.)>0 ! R(29208.)>0 ! R(29209.)>0 !
             R(29210.)>0 ! R(29211.)>0 ! R(29212.)>0 THEN DO4WKS(11)=2;
          IF R(29198.)<1 THEN WEEKS(11)=NA;
          ELSE WEEKS(11)=R(29198.);
          IF R(29215.)>0 THEN WEEKS(11)=R(29215.);
          IF R(29219.)>0 THEN WEEKS(11)=R(29219.);
          IF R(29217.)=0 ! R(29221.)=0 THEN WHYNOT(11)=0;
          ELSE IF R(29222.)>0 THEN WHYNOT(11) =R(29222.);
          ELSE IF R(29218.)>0 THEN WHYNOT(11)=R(29218.);
          ELSE WHYNOT(11)=NA;
          IF R(29243.)<0 ! R(29243.)>998 THEN INDTYP(11)=NA;
          ELSE INDTYP(11)=R(29243.);
          IF R(29244.)<0 ! R(29244.)>994 THEN OCCTYP(11)=NA;
          ELSE OCCTYP(11)=R(29244.);
          IF R(29248.)<0 THEN EMPTYP(11)=NA;
          ELSE EMPTYP(11)=R(29248.);
          IF R(29195.)<1 ! R(29195.)>2 THEN NEWJOB(11)=NA;
          ELSE NEWJOB(11)=R(29195.);
          IF (INDTYP(11)^=NA ! OCCTYP(11)^=NA ! EMPTYP(11)^=NA) & R(29223.)^=1 &
             R(29242.)^=1 THEN EMPLOY(11)=1;
          ELSE EMPLOY(11)=0;
          WEIGHT(11)=R(30738.);
          MILCUR=R(29143.);
          IF R(29170.)>=0 THEN MILCUR=R(29170.);
          IF MILCUR=1 THEN MILITARY(11)=1;
          ELSE MILITARY(11)=NA;

1990 VARIABLES

          WEIGHT(12)=R(34002.);
          IF R(31197.)<1 THEN DOING(12)=NA;
          ELSE DOING(12)=R(31197.);
          IF R(31198.)<0 THEN ANYWK(12)=NA;
          ELSE ANYWK(12)=R(31198.);
          IF R(31199.)<1 THEN HRSWK(12)=NA;
          ELSE HRSWK(12)=R(31199.);
          IF R(31207.)>0 THEN HRSWK(12)=R(31207.);
          IF R(31213.)>0 THEN HRSWK(12)=R(31213.);
          IF R(31220.)<0 THEN ABSENT(12)=NA;
          ELSE ABSENT(12)=R(31220.);
          IF R(31221.)<1 THEN WHYOFF(12)=NA;
          ELSE WHYOFF(12)=R(31221.);
          IF R(31230.)<0 THEN LOOK(12)=NA;
          ELSE LOOK(12)=R(31230.);
          DO4WKS(12)=NA;
          IF R(31231.)=1 THEN DO4WKS(12)=1;
          IF R(31232.)>0 ! R(31233.)>0 ! R(31234.)>0 ! R(31235.)>0 ! R(31236.)>0 !
             R(31237.)>0 ! R(31238.)>0 ! R(31239.)>0 THEN DO4WKS(12)=2;
          IF R(31225.)<1 THEN WEEKS(12)=NA;
          ELSE WEEKS(12)=R(31225.);
          IF R(31242.)>0 THEN WEEKS(12)=R(31242.);
          IF R(31246.)>0 THEN WEEKS(12)=R(31246.);
          IF R(31244.)=0 ! R(31248.)=0 THEN WHYNOT(12)=0;
          ELSE IF R(31249.)>0 THEN WHYNOT(12) =R(31249.);
          ELSE IF R(31245.)>0 THEN WHYNOT(12)=R(31245.);
          ELSE WHYNOT(12)=NA;
          IF R(31270.)<0 ! R(31270.)>998 THEN INDTYP(12)=NA;
          ELSE INDTYP(12)=R(31270.);
          IF R(31271.)<0 ! R(31271.)>994 THEN OCCTYP(12)=NA;
          ELSE OCCTYP(12)=R(31271.);
          IF R(31275.)<0 THEN EMPTYP(12)=NA;
          ELSE EMPTYP(12)=R(31275.);
          IF R(31222.)<1 ! R(31222.)>2 THEN NEWJOB(12)=NA;
          ELSE NEWJOB(12)=R(31222.);
          IF (INDTYP(12)^=NA ! OCCTYP(12)^=NA ! EMPTYP(12)^=NA) & R(31250.)^=1 &
             R(31271.)^=1 THEN EMPLOY(12)=1;
          ELSE EMPLOY(12)=0;
          MILCUR=R(31165.);
          IF R(31192.)>=0 THEN MILCUR=R(31192.);
          IF MILCUR=1 THEN MILITARY(12)=1;
          ELSE MILITARY(12)=NA;

1991 VARIABLES

          WEIGHT(13)=R(36558.);
          IF R(35154.)<1 THEN DOING(13)=NA;
          ELSE DOING(13)=R(35154.);
          IF R(35155.)<0 THEN ANYWK(13)=NA;
          ELSE ANYWK(13)=R(35155.);
          IF R(35156.)<1 THEN HRSWK(13)=NA;
          ELSE HRSWK(13)=R(35156.);
          IF R(35164.)>0 THEN HRSWK(13)=R(35164.);
          IF R(35170.)>0 THEN HRSWK(13)=R(35170.);
          IF R(35177.)<0 THEN ABSENT(13)=NA;
          ELSE ABSENT(13)=R(35177.);
          IF R(35178.)<1 THEN WHYOFF(13)=NA;
          ELSE WHYOFF(13)=R(35178.);
          IF R(35187.)<0 THEN LOOK(13)=NA;
          ELSE LOOK(13)=R(35187.);
          DO4WKS(13)=NA;
          IF R(35188.)=1 THEN DO4WKS(13)=1;
          IF R(35189.)>0 ! R(35190.)>0 ! R(35191.)>0 ! R(35192.)>0 ! R(35193.)>0 !
             R(35194.)>0 ! R(35195.)>0 ! R(35196.)>0 THEN DO4WKS(13)=2;
          IF R(35182.)<1 THEN WEEKS(13)=NA;
          ELSE WEEKS(13)=R(35182.);
          IF R(35199.)>0 THEN WEEKS(13)=R(35199.);
          IF R(35203.)>0 THEN WEEKS(13)=R(35203.);
          IF R(35201.)=0 ! R(35205.)=0 THEN WHYNOT(13)=0;
          ELSE IF R(35206.)>0 THEN WHYNOT(13) =R(35206.);
          ELSE IF R(35202.)>0 THEN WHYNOT(13)=R(35202.);
          ELSE WHYNOT(13)=NA;
          IF R(35227.)<0 ! R(35227.)>998 THEN INDTYP(13)=NA;
          ELSE INDTYP(13)=R(35227.);
          IF R(35228.)<0 ! R(35228.)>994 THEN OCCTYP(13)=NA;
          ELSE OCCTYP(13)=R(35228.);
          IF R(35232.)<0 THEN EMPTYP(13)=NA;
          ELSE EMPTYP(13)=R(35232.);
          IF R(35179.)<1 ! R(35179.)>2 THEN NEWJOB(13)=NA;
          ELSE NEWJOB(13)=R(35179.);
          IF (INDTYP(13)^=NA ! OCCTYP(13)^=NA ! EMPTYP(13)^=NA) & R(35207.)^=1 &
             R(35228.)^=1 THEN EMPLOY(13)=1;
          ELSE EMPLOY(13)=0;
          MILCUR=R(35119.);
          IF R(35149.)>=0 THEN MILCUR=R(35149.);
          IF MILCUR=1 THEN MILITARY(13)=1;
          ELSE MILITARY(13)=NA;

1992 VARIABLES

          WEIGHT(14)=R(40063.);
          IF R(37203.)<1 THEN DOING(14)=NA;
          ELSE DOING(14)=R(37203.);
          IF R(37204.)<0 THEN ANYWK(14)=NA;
          ELSE ANYWK(14)=R(37204.);
          IF R(37205.)<1 THEN HRSWK(14)=NA;
          ELSE HRSWK(14)=R(37205.);
          IF R(37213.)>0 THEN HRSWK(14)=R(37213.);
          IF R(37219.)>0 THEN HRSWK(14)=R(37219.);
          IF R(37226.)<0 THEN ABSENT(14)=NA;
          ELSE ABSENT(14)=R(37226.);
          IF R(37227.)<1 THEN WHYOFF(14)=NA;
          ELSE WHYOFF(14)=R(37227.);
          IF R(37236.)<0 THEN LOOK(14)=NA;
          ELSE LOOK(14)=R(37236.);
          DO4WKS(14)=NA;
          IF R(37237.)=1 THEN DO4WKS(14)=1;
          IF R(37238.)>0 ! R(37239.)>0 ! R(37240.)>0 ! R(37241.)>0 ! R(37242.)>0 !
             R(37243.)>0 ! R(37244.)>0 ! R(37245.)>0 THEN DO4WKS(14)=2;
          IF R(37231.)<1 THEN WEEKS(14)=NA;
          ELSE WEEKS(14)=R(37231.);
          IF R(37248.)>0 THEN WEEKS(14)=R(37248.);
          IF R(37252.)>0 THEN WEEKS(14)=R(37252.);
          IF R(37250.)=0 ! R(37254.)=0 THEN WHYNOT(14)=0;
          ELSE IF R(37255.)>0 THEN WHYNOT(14) =R(37255.);
          ELSE IF R(37251.)>0 THEN WHYNOT(14)=R(37251.);
          ELSE WHYNOT(14)=NA;
          IF R(37277.)<0 ! R(37277.)>998 THEN INDTYP(14)=NA;
          ELSE INDTYP(14)=R(37277.);
          IF R(37278.)<0 ! R(37278.)>994 THEN OCCTYP(14)=NA;
          ELSE OCCTYP(14)=R(37278.);
          IF R(37282.)<0 THEN EMPTYP(14)=NA;
          ELSE EMPTYP(14)=R(37282.);
          IF R(37228.)<1 ! R(37228.)>2 THEN NEWJOB(14)=NA;
          ELSE NEWJOB(14)=R(37228.);
          IF (INDTYP(14)^=NA ! OCCTYP(14)^=NA ! EMPTYP(14)^=NA) & R(37256.)^=1 &
             R(37278.)^=1 THEN EMPLOY(14)=1;
          ELSE EMPLOY(14)=0;
          MILCUR=R(37168.);
          IF R(37198.)>=0 THEN MILCUR=R(37198.);
          IF MILCUR=1 THEN MILITARY(14)=1;
          ELSE MILITARY(14)=NA;

1993 VARIABLES

    /* IF KEY0002 = -4 THEN */
          WEIGHT(15)=1; /* ELSE WEIGHT(15)=0; */
          ABSENT(15)=-4;
          ANYWK(15)=-4;
          DO4WKS(15)=-4;
          DOING(15)=-4;
          EMPLOY(15)=-4;
          EMPTYP(15)=-4;
          ESR(15)=-4;
          ESRC(15)=-4;
          HRSWK(15)=-4;
          INDTYP(15)=-4;
          LOOK(15)=-4;
          MILITARY(15)=-4;
          NEWJOB(15)=-4;
          OCCTYP(15)=-4;
          WEEKS(15)=-4;
          WHYNOT(15)=-4;
          WHYOFF(15)=-4;
          IF R(41718.)<1 THEN DOING(15)=NA;
          ELSE DOING(15)=R(41718.);
          IF R(41719.)<0 THEN ANYWK(15)=NA;
          ELSE ANYWK(15)=R(41719.);
          IF R(41720.)<1 THEN HRSWK(15)=NA;
          ELSE HRSWK(15)=R(41720.);
          IF R(41727.)>0 THEN HRSWK(15)=R(41727.);
          IF R(41732.)>0 THEN HRSWK(15)=R(41732.);
          IF R(41741.)<0 THEN ABSENT(15)=NA;
          ELSE ABSENT(15)=R(41741.);
          IF R(41742.)<1 THEN WHYOFF(15)=NA;
          ELSE WHYOFF(15)=R(41742.);
          IF R(41751.)<0 THEN LOOK(15)=NA;
          ELSE LOOK(15)=R(41751.);
          DO4WKS(15)=NA;
          IF R(41752.)=1 THEN DO4WKS(15)=1;
          IF R(41763.)>0 THEN DO4WKS(15)=2;
          IF R(41746.)<1 THEN WEEKS(15)=NA;
          ELSE WEEKS(15)=R(41746.);
          IF R(41766.)>0 THEN WEEKS(15)=R(41766.);
          IF R(41770.)>0 THEN WEEKS(15)=R(41770.);
          IF R(41768.)=0 ! R(41772.)=0 THEN WHYNOT(15)=0;
          ELSE IF R(41773.)>0 THEN WHYNOT(15) =R(41773.);
          ELSE IF R(41769.)>0 THEN WHYNOT(15)=R(41769.);
          ELSE WHYNOT(15)=NA;
          IF R(41820.)<0 ! R(41820.)>998 THEN INDTYP(15)=NA;
          ELSE INDTYP(15)=R(41820.);
          IF R(41821.)<0 ! R(41821.)>994 THEN OCCTYP(15)=NA;
          ELSE OCCTYP(15)=R(41821.);
          IF R(41823.)<0 THEN EMPTYP(15)=NA;
          ELSE EMPTYP(15)=R(41823.);
          IF R(41743.)<1 ! R(41743.)>2 THEN NEWJOB(15)=NA;
          ELSE NEWJOB(15)=R(41743.);
          IF (INDTYP(15)^=NA ! OCCTYP(15)^=NA ! EMPTYP(15)^=NA) & R(41774.)^=1 &
             R(41821.)^=1 THEN EMPLOY(15)=1;
          ELSE EMPLOY(15)=0;
          MILCUR=R(41449.);
          IF R(41448.)>=0 THEN MILCUR=R(41448.);
          IF R(41460.)>=0 THEN MILCUR=R(41460.);
          IF MILCUR=1 THEN MILITARY(15)=1;
          ELSE MILITARY(15)=NA;
          DO I=1 TO 15;
             IF MILITARY(I)=1 THEN DO;
                ESR(I)=8;
                GO TO FIN;
             END;
             IF WEIGHT(I)=0 THEN DO;
                ESR(I)=-5;
                GO TO FIN;
             END;
             ESR(I)=7;
             IF DOING(I)^=1 THEN GO TO P6;
             IF HRSWK(I)=NA THEN GO TO P4;
             IF HRSWK(I)>=15 ! EMPTYP(I)^=4 THEN ESR(I)=1;
             GO TO P20000;
             P4: IF EMPLOY(I)=1 THEN ESR(I)=1;
             GO TO P20000;
             P6: ESR(I)=1;
             IF ANYWK(I)^=1 THEN GO TO P11;
             IF HRSWK(I)=NA THEN GO TO P9;
             IF HRSWK(I)<15 & EMPTYP(I)=4 THEN GO TO P61;
             GO TO P62;
             P9: IF EMPLOY(I)=0 THEN GO TO P61;
             GO TO P62;
             P11: IF HRSWK(I)=NA THEN GO TO P15;
             IF EMPLOY(I)=0 THEN GO TO P61;
             IF HRSWK(I)<15 & EMPTYP(I)=4 THEN GO TO P61;
             GO TO P62;
             P15: ESR(I)=7;
             IF DOING(I)=2 THEN GO TO ESR237;
             IF DOING(I)=3 THEN GO TO P21;
             GO TO P37;
             P21: IF ABSENT(I)^=1 THEN GO TO P27;
             GO TO ESR237;
             P27: IF WHYOFF(I)=NA THEN GO TO P32;
             IF WHYOFF(I)=6 ! WHYOFF(I)=7 THEN GO TO P29;
             IF EMPLOY(I)^=0 & EMPTYP(I)^=4 THEN ESR(I)=2;
             GO TO P20000;
             P29: IF WHYNOT(I)<3 THEN ESR(I)=3;
             GO TO P20000;
             P32: IF DO4WKS(I)=1 THEN GO TO P20000;
             IF WHYNOT(I)>2 THEN GO TO P20000;
             IF WEEKS(I)=NA THEN GO TO P33;
             ESR(I)=3;
             GO TO P20000;
             P33: IF DO4WKS(I)>1 ! WHYNOT(I)^=NA THEN ESR(I)=3;
             GO TO P20000;
             P37: ESR(I)=2;
             IF ABSENT(I)^=1 THEN GO TO P43;
             IF WHYOFF(I)=NA THEN GO TO P41;
             IF WHYOFF(I)=6 ! WHYOFF(I)=7 THEN GO TO P39;
             IF EMPTYP(I)=4 THEN GO TO P61;
             GO TO P62;
             P39: IF WHYNOT(I)>2 THEN GO TO P61;
             ESR(I)=3;
             GO TO P62;
             P41: IF EMPLOY(I)=0 ! EMPTYP(I)=4 THEN GO TO P61;
             GO TO P62;
             P43: IF WHYOFF(I)=NA THEN GO TO P48;
             IF WHYOFF(I)=6 ! WHYOFF(I)=7 THEN GO TO P45;
             IF EMPLOY(I)=0 ! EMPTYP(I)=4 THEN GO TO P61;
             GO TO P62;
             P45: IF WEEKS(I)=NA & WHYNOT(I)=NA THEN GO TO P61;
             IF WHYNOT(I)>2 THEN GO TO P61;
             ESR(I)=3;
             GO TO P62;
             P48: ESR(I)=3;
             IF LOOK(I)^=1 THEN GO TO P53;
             IF DO4WKS(I)=1 THEN GO TO P61;
             IF WHYNOT(I)>2 THEN GO TO P61;
             IF DO4WKS(I)^=NA  ! WEEKS(I)^=NA THEN GO TO P62;
             IF WHYNOT(I)=NA THEN GO TO P61;
             GO TO P62;
             P53: IF DO4WKS(I)=1 THEN GO TO P61;
             IF WHYNOT(I)>2 THEN GO TO P61;
             IF DO4WKS(I)=NA THEN GO TO P56;
             IF WEEKS(I)^=NA ! WHYNOT(I)^=NA THEN GO TO P62;
             GO TO P61;
             P56: IF WEEKS(I)=NA ! WHYNOT(I)=NA THEN GO TO P61;
             GO TO P62;
             P61: IF DOING(I)<4 ! DOING(I)>6 THEN GO TO P610;
             ESR(I)=DOING(I);
             GO TO P20000;
             P610: ESR(I)=7;
             GO TO P20000;
             P62: IF DOING(I)=6 THEN DOING(I)=7;
             P20000: GO TO FIN;
             ESR237: IF WHYOFF(I)=NA THEN GO TO P5019;
             IF WHYOFF(I)=6 ! WHYOFF(I)=7 THEN GO TO P5017;
             IF EMPTYP(I)^=-4 THEN ESR(I)=2;
             GO TO FIN;
             P5017: IF WHYNOT(I)>2 THEN GO TO FIN;
             ESR(I)=3;
             GO TO FIN;
             P5019: IF EMPLOY(I)=1 & EMPTYP(I)^=4 THEN ESR(I)=2;
             FIN:;

COLLAPSED EMPLOYMENT STATUS RECODE 1984-1993

             IF ESR(I)=-5 THEN ESRC(I)=-5;
             ELSE IF ESR(I)=1 | ESR(I)=2 THEN ESRC(I)=1;
             ELSE IF ESR(I)=3 THEN ESRC(I)=2;
             ELSE IF ESR(I)>=4 & ESR(I)<=7 THEN ESRC(I)=3;
             ELSE IF ESR(I)=8 THEN ESRC(I)=4;
             ELSE ESRC(I)=ESR(I);
          END;

CHANGES BETWEEN 1993 AND 1994

NOTE: Users should be aware that the CPS section, on which the creation of Employment Status Recode (ESR) is based, was significantly revised in 1994-96. Hence the 1994-96 ESR variables are created using a different formula than variables in previous years (1979-1993). The formula for the 1994 ESR variable was modeled after that used to compute the MLS (Monthly Labor Status) from the actual Current Population Survey (CPS). The programs for both 1994 and 1996 are included below in their entirety. Those variables identified by reference numbers (R#####.) are those which are included on the 1979-1996 Youth CD-ROM. These are in general, questions answered by or containing valid data for, at least one respondent. The questions identified by question name (Q5????), are those not included on the CD-ROM. These are in general, questions containing no valid data for any respondents. They remain in the formula to have it represented completely. However, the lack of valid data in those variables means that they would have virtually no effect in the formula or on the final value of ESR.

1994 VARIABLES

/* The programming for the new 1994 ESR variables is done in SPSS */
 
/* the following lines create the var AGE */
COMPUTE AGE=37
 
/* the following lines construct the var HRACT1 */
DO IF (Q5B2_40A EQ -4)
COMPUTE HRACT1=-4
ELSE IF (Q5B2_41A EQ -1 OR Q5B2_41B EQ -1 OR Q5B2_41C EQ -1 OR Q5B2_41D EQ -1 OR 
                    Q5B2_41A EQ -2 OR Q5B2_41B EQ -2 OR Q5B2_41C EQ -2 OR Q5B2_41D EQ -2)
COMPUTE HRACT1=-2
ELSE IF (Q5B2_41A EQ 995 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ 995 OR Q5B2_41D EQ 995)
COMPUTE HRACT1=995
ELSE IF (Q5B2_40B EQ 1 AND Q5B2_41A NE -4)
COMPUTE HRACT1=Q5B2_41A
ELSE IF (Q5B2_40C EQ 1 AND Q5B2_41B NE -4)
COMPUTE HRACT1=Q5B2_41B
ELSE IF (Q5B2_40D EQ 1 AND Q5B2_41C NE -4)
COMPUTE HRACT1=Q5B2_41C
ELSE IF (Q5B2_40E EQ 1 OR Q5B2_40E EQ 0)
COMPUTE HRACT1=Q5B2_41D
ELSE IF (Q5B_40A EQ -4)
COMPUTE HRACT1=-4
ELSE IF (Q5B_41A EQ -1 OR Q5B_41B EQ -1 OR Q5B_41C EQ -1 OR Q5B_41D EQ -1 OR Q5B_41A EQ -2 OR 
                    Q5B_41B EQ -2 OR Q5B_41C EQ -2 OR Q5B_41D EQ -2)
COMPUTE HRACT1=-2
ELSE IF (Q5B_41A EQ 995 OR Q5B_41B EQ 995 OR Q5B_41C EQ 995 OR Q5B_41D EQ 995)
COMPUTE HRACT1=995
ELSE IF (R(45594.) EQ 1 AND Q5B_41A NE -4)
COMPUTE HRACT1=Q5B_41A
ELSE IF (R(45595.) EQ 1 AND Q5B_41B NE -4)
COMPUTE HRACT1=Q5B_41B
ELSE IF (R(45596.) EQ 1 AND Q5B_41C NE -4)
COMPUTE HRACT1=Q5B_41C
ELSE IF (Q5B_40E EQ 1 OR Q5B_40E EQ 0)
COMPUTE HRACT1=Q5B_41D
ELSE IF (R(45443.) EQ -4)
COMPUTE HRACT1=-4
ELSE IF (R(45448.) EQ -1 OR R(45449.) EQ -1 OR R(45450.) EQ -1 OR R(45451.) EQ -1 OR R(45448.) EQ -2 OR 
                    R(45449.) EQ -2 OR R(45450.) EQ -2 OR R(45451.) EQ -2)
COMPUTE HRACT1=-2
ELSE IF (R(45448.) EQ 995 OR R(45449.) EQ 995 OR R(45450.) EQ 995 OR               R(45451.) EQ 995)
COMPUTE HRACT1=995
ELSE IF (R(45444.) EQ 1 AND R(45448.) NE -4)
COMPUTE HRACT1=R(45448.)
ELSE IF (R(45445.) EQ 1 AND R(45449.) NE -4)
COMPUTE HRACT1=R(45449.)
ELSE IF (R(45446.) EQ 1 AND R(45450.) NE -4)
COMPUTE HRACT1=R(45450.)
ELSE IF (R(45447.) EQ 1 OR R(45447.) EQ 0)
COMPUTE HRACT1=R(45451.)
ELSE
COMPUTE HRACT1=-3
END IF
 
/* the following lines construct the var HRACT2 */
DO IF (Q5B2_42 EQ -4 OR Q5B2_42 EQ 0)
COMPUTE HRACT2=-4
ELSE IF (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1OR Q5B2_43A EQ -2 OR Q5B2_43B EQ -2)
COMPUTE HRACT2=-2
ELSE IF (Q5B2_43A EQ 995 OR Q5B2_43B EQ 995)
COMPUTE HRACT2=995
ELSE IF (Q5B2_43 EQ 1)
COMPUTE HRACT2=Q5B2_43A
ELSE IF (Q5B2_42 EQ 1 AND Q5B2_43 EQ 0)
COMPUTE HRACT2=Q5B2_43B
ELSE IF (Q5B_42 EQ -4 OR Q5B_42 EQ 0)
COMPUTE HRACT2=-4
ELSE IF (Q5B_43A EQ -1 OR Q5B_43B EQ -1 OR Q5B_43A EQ -2 OR Q5B_43B EQ -2)
COMPUTE HRACT2=-2
ELSE IF (Q5B_43A EQ 995 OR Q5B_43B EQ 995)
COMPUTE HRACT2=995
ELSE IF (Q5B_43 EQ 1)
COMPUTE HRACT2=Q5B_43A
ELSE IF (Q5B_42 EQ 1 AND Q5B_43 EQ 0)
COMPUTE HRACT2=Q5B_43B
ELSE IF (R(45452.) EQ -4 OR R(45452.) EQ 0)
COMPUTE HRACT2=-4
ELSE IF (R(45454.) EQ -1 OR R(45455.) EQ -1 OR R(45454.) EQ -2 OR R(45455.) EQ -2)
COMPUTE HRACT2=-2
ELSE IF (R(45454.) EQ 995 OR R(45455.) EQ 995)
COMPUTE HRACT2=995
ELSE IF (R(45453.) EQ 1)
COMPUTE HRACT2=R(45454.)
ELSE IF (R(45452.) EQ 1 AND R(45453.) EQ 0)
COMPUTE HRACT2=R(45455.)
ELSE 
COMPUTE HRACT2=-3
END IF
 
/* the following lines create the var HRACTT */
DO IF (Q5B2_40A EQ -4)
COMPUTE HRACTT=-4
ELSE IF ((Q5B2_41A EQ -1 OR Q5B2_41B EQ -1 OR Q5B2_41C EQ -1 OR Q5B2_41D EQ -1 OR 
                    Q5B2_41A EQ -2 OR Q5B2_41B EQ -2 OR Q5B2_41C EQ -2 OR Q5B2_41D EQ -2) AND 
                    (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1 OR Q5B2_43A EQ -2 OR Q5B2_43B EQ -2))
COMPUTE HRACTT=-2
ELSE IF ((Q5B2_41A EQ 995 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ 995 OR Q5B2_41D EQ 995) AND 
                    (Q5B2_43A EQ 995 OR Q5B2_43B EQ 995))
COMPUTE HRACTT=995
ELSE IF ((Q5B2_41A EQ -1 OR Q5B2_41B EQ -1 OR Q5B2_41C EQ -1 OR Q5B2_41D EQ -1 OR 
                    Q5B2_41A EQ -2 OR Q5B2_41B EQ -2 OR Q5B2_41C EQ -2 OR Q5B2_41D EQ -2) AND 
                    (Q5B2_43A EQ 995 OR Q5B2_43B EQ 995))
COMPUTE HRACTT=995
ELSE IF ((Q5B2_41A EQ 995 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ 995 OR Q5B2_41D EQ 995 OR 
                    Q5B2_41A EQ 995 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ 995 OR Q5B2_41D EQ 995) AND 
                    (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1 OR Q5B2_43A EQ -2 OR Q5B2_43B EQ -2))
COMPUTE HRACTT=995
ELSE IF ((Q5B2_41A NE -4 AND Q5B2_41A NE -1 AND Q5B2_41A NE -2 AND Q5B2_41A NE 995) AND 
                    (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1 OR Q5B2_43A EQ -2 OR Q5B2_43B EQ -2 OR 
                    Q5B2_43A EQ 995 OR Q5B2_43B EQ 995))
COMPUTE HRACTT=Q5B2_41A
ELSE IF ((Q5B2_41B NE -4 AND Q5B2_41B NE -1 AND Q5B2_41B NE -2 AND Q5B2_41B NE 995) AND 
                    (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1 OR Q5B2_43A EQ -2 OR Q5B2_43B EQ -2 OR 
                    Q5B2_43A EQ 995 OR Q5B2_43B EQ 995))
COMPUTE HRACTT=Q5B2_41B
ELSE IF ((Q5B2_41C NE -4 AND Q5B2_41C NE -1 AND Q5B2_41C NE -2 AND Q5B2_41C NE 995) AND 
                    (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1 OR Q5B2_43A EQ -2 OR Q5B2_43B EQ -2 OR 
                    Q5B2_43A EQ 995 OR Q5B2_43B EQ 995))
COMPUTE HRACTT=Q5B2_41C
ELSE IF ((Q5B2_41D NE -4 AND Q5B2_41D NE -1 AND Q5B2_41D NE -2 AND Q5B2_41D NE 995) AND 
                    (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1 OR Q5B2_43A EQ -2 OR Q5B2_43B EQ -2 OR 
                    Q5B2_43A EQ 995 OR Q5B2_43B EQ 995))
COMPUTE HRACTT=Q5B2_41D
ELSE IF ((Q5B2_43A NE -4 AND Q5B2_43A NE -1 AND Q5B2_43A NE -2 AND Q5B2_43A NE 995) AND 
                    (Q5B2_41A EQ -1 OR Q5B2_41A EQ -2 OR Q5B2_41A EQ 995 OR Q5B2_41B EQ -1 OR 
                    Q5B2_41B EQ -2 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ -1 OR Q5B2_41C EQ -2 OR 
                    Q5B2_41C EQ 995 OR Q5B2_41D EQ -1 OR Q5B2_41D EQ -2 OR Q5B2_41D EQ 995))
COMPUTE HRACTT=Q5B2_43A
ELSE IF ((Q5B2_43B NE -4 AND Q5B2_43B NE -1 AND Q5B2_43B NE -2 AND Q5B2_43B NE 995) AND 
                    (Q5B2_41A EQ -1 OR Q5B2_41A EQ -2 OR Q5B2_41A EQ 995 OR Q5B2_41B EQ -1 OR 
                    Q5B2_41B EQ -2 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ -1 OR Q5B2_41C EQ -2 OR 
                    Q5B2_41C EQ 995 OR Q5B2_41D EQ -1 OR Q5B2_41D EQ -2 OR Q5B2_41D EQ 995))
COMPUTE HRACTT=Q5B2_43B
ELSE IF ((Q5B2_41A NE -4 AND Q5B2_41A NE -1 AND Q5B2_41A NE -2 AND Q5B2_41A NE 995) AND 
                    (Q5B2_43A NE -1 AND Q5B2_43A NE -2 AND Q5B2_43A NE 995 AND Q5B2_43A NE -4)) 
COMPUTE HRACTT=Q5B2_41A+Q5B2_43A
ELSE IF ((Q5B2_41A NE -4 AND Q5B2_41A NE -1 AND Q5B2_41A NE -2 AND Q5B2_41A NE 995) AND 
                    (Q5B2_43B NE -1 AND Q5B2_43B NE -2 AND Q5B2_43B NE 995 AND Q5B2_43B NE -4)) 
COMPUTE HRACTT=Q5B2_41A+Q5B2_43B
ELSE IF ((Q5B2_41B NE -4 AND Q5B2_41B NE -1 AND Q5B2_41B NE -2 AND Q5B2_41B NE 995) AND 
                    (Q5B2_43A NE -1 AND Q5B2_43A NE -2 AND Q5B2_43A NE 995 AND Q5B2_43A NE -4)) 
COMPUTE HRACTT=Q5B2_41B+Q5B2_43A
ELSE IF ((Q5B2_41B NE -4 AND Q5B2_41B NE -1 AND Q5B2_41B NE -2 AND Q5B2_41B NE 995) AND 
                    (Q5B2_43B NE -1 AND Q5B2_43B NE -2 AND Q5B2_43B NE 995 AND Q5B2_43B NE -4)) 
COMPUTE HRACTT=Q5B2_41B+Q5B2_43B
ELSE IF ((Q5B2_41C NE -4 AND Q5B2_41C NE -1 AND Q5B2_41C NE -2 AND Q5B2_41C NE 995) AND 
                    (Q5B2_43A NE -1 AND Q5B2_43A NE -2 AND Q5B2_43A NE 995 AND Q5B2_43A NE -4)) 
COMPUTE HRACTT=Q5B2_41C+Q5B2_43A
ELSE IF ((Q5B2_41C NE -4 AND Q5B2_41C NE -1 AND Q5B2_41C NE -2 AND Q5B2_41C NE 995) AND 
                    (Q5B2_43B NE -1 AND Q5B2_43B NE -2 AND Q5B2_43B NE 995 AND Q5B2_43B NE -4)) 
COMPUTE HRACTT=Q5B2_41C+Q5B2_43B
ELSE IF ((Q5B2_41D NE -4 AND Q5B2_41D NE -1 AND Q5B2_41D NE -2 AND Q5B2_41D NE 995) AND 
                    (Q5B2_43A NE -1 AND Q5B2_43A NE -2 AND Q5B2_43A NE 995 AND Q5B2_43A NE -4)) 
COMPUTE HRACTT=Q5B2_41D+Q5B2_43A
ELSE IF ((Q5B2_41D NE -4 AND Q5B2_41D NE -1 AND Q5B2_41D NE -2 AND Q5B2_41D NE 995) AND 
                    (Q5B2_43B NE -1 AND Q5B2_43B NE -2 AND Q5B2_43B NE 995 AND Q5B2_43B NE -4)) 
COMPUTE HRACTT=Q5B2_41D+Q5B2_43B
ELSE IF ((Q5B2_41A NE -4 AND Q5B2_41A NE -1 AND Q5B2_41A NE -2 AND Q5B2_41A NE 995) AND 
                    Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=Q5B2_41A
ELSE IF ((Q5B2_41B NE -4 AND Q5B2_41B NE -1 AND Q5B2_41B NE -2 AND Q5B2_41B NE 995) AND 
                    Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=Q5B2_41B
ELSE IF ((Q5B2_41C NE -4 AND Q5B2_41C NE -1 AND Q5B2_41C NE -2 AND Q5B2_41C NE 995) AND 
                    Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=Q5B2_41C
ELSE IF ((Q5B2_41D NE -4 AND Q5B2_41D NE -1 AND Q5B2_41D NE -2 AND Q5B2_41D NE 995) AND 
                    Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=Q5B2_41D
ELSE IF ((Q5B2_41A EQ -1 OR Q5B2_41A EQ -2 OR Q5B2_41B EQ -1 OR Q5B2_41B EQ -2 OR 
                    Q5B2_41C EQ -1 OR Q5B2_41C EQ -2 OR Q5B2_41D EQ -1 OR Q5B2_41D EQ -2) AND 
                    Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=-2
ELSE IF ((Q5B2_41A EQ 995 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ 995 OR Q5B2_41D EQ 995) AND 
                    Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=995
ELSE IF (Q5B_40A EQ -4)
COMPUTE HRACTT=-4
ELSE IF ((Q5B_41A EQ -1 OR Q5B_41B EQ -1 OR Q5B_41C EQ -1 OR Q5B_41D EQ -1 OR Q5B_41A EQ -2 OR 
                    Q5B_41B EQ -2 OR Q5B_41C EQ -2 OR Q5B_41D EQ -2) AND (Q5B_43A EQ -1 OR 
                    Q5B_43B EQ -1 OR Q5B_43A EQ -2 OR Q5B_43B EQ -2))
COMPUTE HRACTT=-2
ELSE IF ((Q5B_41A EQ 995 OR Q5B_41B EQ 995 OR Q5B_41C EQ 995 OR Q5B_41D EQ 995) AND 
                    (Q5B_43A EQ 995 OR Q5B_43B EQ 995))
COMPUTE HRACTT=995
ELSE IF ((Q5B_41A EQ -1 OR Q5B_41B EQ -1 OR Q5B_41C EQ -1 OR Q5B_41D EQ -1 OR Q5B_41A EQ -2 OR 
                    Q5B_41B EQ -2 OR Q5B_41C EQ -2 OR Q5B_41D EQ -2) AND (Q5B_43A EQ 995 OR 
                    Q5B_43B EQ 995))
COMPUTE HRACTT=995
ELSE IF ((Q5B_41A EQ 995 OR Q5B_41B EQ 995 OR Q5B_41C EQ 995 OR Q5B_41D EQ 995 OR 
                    Q5B_41A EQ 995 OR Q5B_41B EQ 995 OR Q5B_41C EQ 995 OR Q5B_41D EQ 995) AND 
                    (Q5B_43A EQ -1 OR Q5B_43B EQ -1 OR Q5B_43A EQ -2 OR Q5B_43B EQ -2))
COMPUTE HRACTT=995
ELSE IF ((Q5B_41A NE -4 AND Q5B_41A NE -1 AND Q5B_41A NE -2 AND Q5B_41A NE 995) AND 
                    (Q5B_43A EQ -1 OR Q5B_43B EQ -1 OR Q5B_43A EQ -2 OR Q5B_43B EQ -2 OR Q5B_43A EQ 995 OR 
                    Q5B_43B EQ 995))
COMPUTE HRACTT=Q5B_41A
ELSE IF ((Q5B_41B NE -4 AND Q5B_41B NE -1 AND Q5B_41B NE -2 AND Q5B_41B NE 995) AND 
                    (Q5B_43A EQ -1 OR Q5B_43B EQ -1 OR Q5B_43A EQ -2 OR Q5B_43B EQ -2 OR Q5B_43A EQ 995 OR 
                    Q5B_43B EQ 995))
COMPUTE HRACTT=Q5B_41B
ELSE IF ((Q5B_41C NE -4 AND Q5B_41C NE -1 AND Q5B_41C NE -2 AND Q5B_41C NE 995) AND 
                    (Q5B_43A EQ -1 OR Q5B_43B EQ -1 OR Q5B_43A EQ -2 OR Q5B_43B EQ -2 OR Q5B_43A EQ 995 OR
                    Q5B_43B EQ 995))
COMPUTE HRACTT=Q5B_41C
ELSE IF ((Q5B_41D NE -4 AND Q5B_41D NE -1 AND Q5B_41D NE -2 AND Q5B_41D NE 995) AND 
                    (Q5B_43A EQ -1 OR Q5B_43B EQ -1 OR Q5B_43A EQ -2 OR Q5B_43B EQ -2 OR Q5B_43A EQ 995 OR 
                    Q5B_43B EQ 995))
COMPUTE HRACTT=Q5B_41D
ELSE IF ((Q5B_43A NE -4 AND Q5B_43A NE -1 AND Q5B_43A NE -2 AND Q5B_43A NE 995) AND 
                    (Q5B_41A EQ -1 OR Q5B_41A EQ -2 OR Q5B_41A EQ 995 OR Q5B_41B EQ -1 OR Q5B_41B EQ -2 OR 
                    Q5B_41B EQ 995 OR Q5B_41C EQ -1 OR Q5B_41C EQ -2 OR Q5B_41C EQ 995 OR 
                    Q5B_41D EQ -1 OR Q5B_41D EQ -2 OR Q5B_41D EQ 995))
COMPUTE HRACTT=Q5B_43A
ELSE IF ((Q5B_43B NE -4 AND Q5B_43B NE -1 AND Q5B_43B NE -2 AND Q5B_43B NE 995) AND 
                    (Q5B_41A EQ -1 OR Q5B_41A EQ -2 OR Q5B_41A EQ 995 OR Q5B_41B EQ -1 OR Q5B_41B EQ -2 OR 
                    Q5B_41B EQ 995 OR Q5B_41C EQ -1 OR Q5B_41C EQ -2 OR Q5B_41C EQ 995 OR 
                    Q5B_41D EQ -1 OR Q5B_41D EQ -2 OR Q5B_41D EQ 995))
COMPUTE HRACTT=Q5B_43B
ELSE IF ((Q5B_41A NE -4 AND Q5B_41A NE -1 AND Q5B_41A NE -2 AND Q5B_41A NE 995) AND 
                    (Q5B_43A NE -1 AND Q5B_43A NE -2 AND Q5B_43A NE 995 AND Q5B_43A NE -4)) 
COMPUTE HRACTT=Q5B_41A+Q5B_43A
ELSE IF ((Q5B_41A NE -4 AND Q5B_41A NE -1 AND Q5B_41A NE -2 AND Q5B_41A NE 995) AND 
                    (Q5B_43B NE -1 AND Q5B_43B NE -2 AND Q5B_43B NE 995 AND Q5B_43B NE -4)) 
COMPUTE HRACTT=Q5B_41A+Q5B_43B
ELSE IF ((Q5B_41B NE -4 AND Q5B_41B NE -1 AND Q5B_41B NE -2 AND Q5B_41B NE 995) AND 
                    (Q5B_43A NE -1 AND Q5B_43A NE -2 AND Q5B_43A NE 995 AND Q5B_43A NE -4)) 
COMPUTE HRACTT=Q5B_41B+Q5B_43A
ELSE IF ((Q5B_41B NE -4 AND Q5B_41B NE -1 AND Q5B_41B NE -2 AND Q5B_41B NE 995) AND 
                    (Q5B_43B NE -1 AND Q5B_43B NE -2 AND Q5B_43B NE 995 AND Q5B_43B NE -4)) 
COMPUTE HRACTT=Q5B_41B+Q5B_43B
ELSE IF ((Q5B_41C NE -4 AND Q5B_41C NE -1 AND Q5B_41C NE -2 AND Q5B_41C NE 995) AND 
                    (Q5B_43A NE -1 AND Q5B_43A NE -2 AND Q5B_43A NE 995 AND Q5B_43A NE -4)) 
COMPUTE HRACTT=Q5B_41C+Q5B_43A
ELSE IF ((Q5B_41C NE -4 AND Q5B_41C NE -1 AND Q5B_41C NE -2 AND Q5B_41C NE 995) AND 
                    (Q5B_43B NE -1 AND Q5B_43B NE -2 AND Q5B_43B NE 995 AND Q5B_43B NE -4)) 
COMPUTE HRACTT=Q5B_41C+Q5B_43B
ELSE IF ((Q5B_41D NE -4 AND Q5B_41D NE -1 AND Q5B_41D NE -2 AND Q5B_41D NE 995) AND 
                    (Q5B_43A NE -1 AND Q5B_43A NE -2 AND Q5B_43A NE 995 AND Q5B_43A NE -4)) 
COMPUTE HRACTT=Q5B_41D+Q5B_43A
ELSE IF ((Q5B_41D NE -4 AND Q5B_41D NE -1 AND Q5B_41D NE -2 AND Q5B_41D NE 995) AND 
                    (Q5B_43B NE -1 AND Q5B_43B NE -2 AND Q5B_43B NE 995 AND Q5B_43B NE -4)) 
COMPUTE HRACTT=Q5B_41D+Q5B_43B
ELSE IF ((Q5B_41A NE -4 AND Q5B_41A NE -1 AND Q5B_41A NE -2 AND Q5B_41A NE 995) AND 
                    Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=Q5B_41A
ELSE IF ((Q5B_41B NE -4 AND Q5B_41B NE -1 AND Q5B_41B NE -2 AND Q5B_41B NE 995) AND 
                    Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=Q5B_41B
ELSE IF ((Q5B_41C NE -4 AND Q5B_41C NE -1 AND Q5B_41C NE -2 AND Q5B_41C NE 995) AND 
                    Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=Q5B_41C
ELSE IF ((Q5B_41D NE -4 AND Q5B_41D NE -1 AND Q5B_41D NE -2 AND Q5B_41D NE 995) AND 
                    Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=Q5B_41D
ELSE IF ((Q5B_41A EQ -1 OR Q5B_41A EQ -2 OR Q5B_41B EQ -1 OR Q5B_41B EQ -2 OR Q5B_41C EQ -1 OR
                    Q5B_41C EQ -2 OR Q5B_41D EQ -1 OR Q5B_41D EQ -2) AND Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=-2
ELSE IF ((Q5B_41A EQ 995 OR Q5B_41B EQ 995 OR Q5B_41C EQ 995 OR Q5B_41D EQ 995) AND 
                    Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=995
ELSE IF (R(45443.) EQ -4)
COMPUTE HRACTT=-4
ELSE IF ((R(45448.) EQ -1 OR R(45449.) EQ -1 OR R(45450.) EQ -1 OR R(45451.) EQ -1 OR R(45448.) EQ -2 OR 
                    R(45449.) EQ -2 OR R(45450.) EQ -2 OR R(45451.) EQ -2) AND (R(45454.) EQ -1 OR 
                    R(45455.) EQ -1 OR R(45454.) EQ -2 OR R(45455.) EQ -2))
COMPUTE HRACTT=-2
ELSE IF ((R(45448.) EQ 995 OR R(45449.) EQ 995 OR R(45450.) EQ 995 OR R(45451.) EQ 995) AND 
                    (R(45454.) EQ 995 OR R(45455.) EQ 995))
COMPUTE HRACTT=995
ELSE IF ((R(45448.) EQ -1 OR R(45449.) EQ -1 OR R(45450.) EQ -1 OR R(45451.) EQ -1 OR R(45448.) EQ -2 OR 
                    R(45449.) EQ -2 OR R(45450.) EQ -2 OR R(45451.) EQ -2) AND (R(45454.) EQ 995 OR 
                    R(45455.) EQ 995))
COMPUTE HRACTT=995
ELSE IF ((R(45448.) EQ 995 OR R(45449.) EQ 995 OR R(45450.) EQ 995 OR R(45451.) EQ 995 OR 
                    R(45448.) EQ 995 OR R(45449.) EQ 995 OR R(45450.) EQ 995 OR R(45451.) EQ 995) AND 
                    (R(45454.) EQ -1 OR R(45455.) EQ -1 OR R(45454.) EQ -2 OR R(45455.) EQ -2))
COMPUTE HRACTT=995
ELSE IF ((R(45448.) NE -4 AND R(45448.) NE -1 AND R(45448.) NE -2 AND R(45448.) NE 995) AND 
                    (R(45454.) EQ -1 OR R(45455.) EQ -1 OR R(45454.) EQ -2 OR R(45455.) EQ -2 OR 
                    R(45454.) EQ 995 OR R(45455.) EQ 995))
COMPUTE HRACTT=R(45448.)
ELSE IF ((R(45449.) NE -4 AND R(45449.) NE -1 AND R(45449.) NE -2 AND R(45449.) NE 995) AND 
                    (R(45454.) EQ -1 OR R(45455.) EQ -1 OR R(45454.) EQ -2 OR R(45455.) EQ -2 OR 
                    R(45454.) EQ 995 OR R(45455.) EQ 995))
COMPUTE HRACTT=R(45449.)
ELSE IF ((R(45450.) NE -4 AND R(45450.) NE -1 AND R(45450.) NE -2 AND R(45450.) NE 995) AND 
                    (R(45454.) EQ -1 OR R(45455.) EQ -1 OR R(45454.) EQ -2 OR R(45455.) EQ -2 OR 
                    R(45454.) EQ 995 OR R(45455.) EQ 995))
COMPUTE HRACTT=R(45450.)
ELSE IF ((R(45451.) NE -4 AND R(45451.) NE -1 AND R(45451.) NE -2 AND R(45451.) NE 995) AND 
                    (R(45454.) EQ -1 OR R(45455.) EQ -1 OR R(45454.) EQ -2 OR R(45455.) EQ -2 OR 
                    R(45454.) EQ 995 OR R(45455.) EQ 995))
COMPUTE HRACTT=R(45451.)
ELSE IF ((R(45454.) NE -4 AND R(45454.) NE -1 AND R(45454.) NE -2 AND R(45454.) NE 995) AND 
                    (R(45448.) EQ -1 OR R(45448.) EQ -2 OR R(45448.) EQ 995 OR R(45449.) EQ -1 OR 
                    R(45449.) EQ -2 OR R(45449.) EQ 995 OR R(45450.) EQ -1 OR R(45450.) EQ -2 OR 
                    R(45450.) EQ 995 OR R(45451.) EQ -1 OR R(45451.) EQ -2 OR R(45451.) EQ 995))
COMPUTE HRACTT=R(45454.)
ELSE IF ((R(45455.) NE -4 AND R(45455.) NE -1 AND R(45455.) NE -2 AND R(45455.) NE 995) AND 
                    R(45448.) EQ -1 OR R(45448.) EQ -2 OR R(45448.) EQ 995 OR R(45449.) EQ -1 OR R(45449.) EQ -2 OR 
                    R(45449.) EQ 995 OR R(45450.) EQ -1 OR R(45450.) EQ -2 OR R(45450.) EQ 995 OR 
                    R(45451.) EQ -1 OR R(45451.) EQ -2 OR R(45451.) EQ 995))
COMPUTE HRACTT=R(45455.)
ELSE IF ((R(45448.) NE -4 AND R(45448.) NE -1 AND R(45448.) NE -2 AND R(45448.) NE 995) AND 
                    (R(45454.) NE -1 AND R(45454.) NE -2 AND R(45454.) NE 995 AND R(45454.) NE -4)) 
COMPUTE HRACTT=R(45448.)+R(45454.)
ELSE IF ((R(45448.) NE -4 AND R(45448.) NE -1 AND R(45448.) NE -2 AND R(45448.) NE 995) AND 
                    (R(45455.) NE -1 AND R(45455.) NE -2 AND R(45455.) NE 995 AND R(45455.) NE -4)) 
COMPUTE HRACTT=R(45448.)+R(45455.)
ELSE IF ((R(45449.) NE -4 AND R(45449.) NE -1 AND R(45449.) NE -2 AND R(45449.) NE 995) AND 
                    (R(45454.) NE -1 AND R(45454.) NE -2 AND R(45454.) NE 995 AND R(45454.) NE -4)) 
COMPUTE HRACTT=R(45449.)+R(45454.)
ELSE IF ((R(45449.) NE -4 AND R(45449.) NE -1 AND R(45449.) NE -2 AND R(45449.) NE 995) AND 
                    (R(45455.) NE -1 AND R(45455.) NE -2 AND R(45455.) NE 995 AND R(45455.) NE -4)) 
COMPUTE HRACTT=R(45449.)+R(45455.)
ELSE IF ((R(45450.) NE -4 AND R(45450.) NE -1 AND R(45450.) NE -2 AND R(45450.) NE 995) AND 
                    (R(45454.) NE -1 AND R(45454.) NE -2 AND R(45454.) NE 995 AND R(45454.) NE -4)) 
COMPUTE HRACTT=R(45450.)+R(45454.)
ELSE IF ((R(45450.) NE -4 AND R(45450.) NE -1 AND R(45450.) NE -2 AND R(45450.) NE 995) AND 
                    (R(45455.) NE -1 AND R(45455.) NE -2 AND R(45455.) NE 995 AND R(45455.) NE -4)) 
COMPUTE HRACTT=R(45450.)+R(45455.)
ELSE IF ((R(45451.) NE -4 AND R(45451.) NE -1 AND R(45451.) NE -2 AND R(45451.) NE 995) AND 
                    (R(45454.) NE -1 AND R(45454.) NE -2 AND R(45454.) NE 995 AND R(45454.) NE -4)) 
COMPUTE HRACTT=R(45451.)+R(45454.)
ELSE IF ((R(45451.) NE -4 AND R(45451.) NE -1 AND R(45451.) NE -2 AND R(45451.) NE 995) AND 
                    (R(45455.) NE -1 AND R(45455.) NE -2 AND R(45455.) NE 995 AND R(45455.) NE -4)) 
COMPUTE HRACTT=R(45451.)+R(45455.)
ELSE IF ((R(45448.) NE -4 AND R(45448.) NE -1 AND R(45448.) NE -2 AND R(45448.) NE 995) AND 
                    R(45454.) EQ -4 AND R(45455.) EQ -4)
COMPUTE HRACTT=R(45448.)
ELSE IF ((R(45449.) NE -4 AND R(45449.) NE -1 AND R(45449.) NE -2 AND R(45449.) NE 995) AND 
                    R(45454.) EQ -4 AND R(45455.) EQ -4)
COMPUTE HRACTT=R(45449.)
ELSE IF ((R(45450.) NE -4 AND R(45450.) NE -1 AND R(45450.) NE -2 AND R(45450.) NE 995) AND 
                    R(45454.) EQ -4 AND R(45455.) EQ -4)
COMPUTE HRACTT=R(45450.)
ELSE IF ((R(45451.) NE -4 AND R(45451.) NE -1 AND R(45451.) NE -2 AND R(45451.) NE 995) AND 
                    R(45454.) EQ -4 AND R(45455.) EQ -4)
COMPUTE HRACTT=R(45451.)
ELSE IF ((R(45448.) EQ -1 OR R(45448.) EQ -2 OR R(45449.) EQ -1 OR R(45449.) EQ -2 OR R(45450.) EQ -1 OR
                     R(45450.) EQ -2 OR R(45451.) EQ -1 OR R(45451.) EQ -2) AND R(45454.) EQ -4 AND R(45455.) EQ -4)
COMPUTE HRACTT=-2
ELSE IF ((R(45448.) EQ 995 OR R(45449.) EQ 995 OR R(45450.) EQ 995 OR R(45451.) EQ 995) AND 
                    R(45454.) EQ -4 AND R(45455.) EQ -4)
COMPUTE HRACTT=995
ELSE 
COMPUTE HRACTT=-3
END IF
 
/* the following lines creates the var BUS2 */
DO IF (R(45368.) EQ -4)
COMPUTE BUS2=-4
ELSE IF (R(45368.) EQ -1)
COMPUTE BUS2=-1
ELSE IF (R(45368.) EQ -2)
COMPUTE BUS2=-2
ELSE IF (R(45369.) EQ -1 OR R(45370.) EQ -1)
COMPUTE BUS2=-1
ELSE IF (R(45369.) EQ -2 OR R(45370.) EQ -2)
COMPUTE BUS2=-2
ELSE IF (R(45369.) EQ 1 OR R(45370.) EQ 1)
COMPUTE BUS2=1
ELSE IF (R(45370.) EQ 0)
COMPUTE BUS2=2  /* this should normally be 0 */
ELSE 
COMPUTE BUS2=-3
END IF
 
/* the following lines create the var HRUSL1 */
DO IF (R(45665.) EQ -4)
COMPUTE HRUSL1=-4
ELSE IF (R(45666.) EQ -1 OR R(45667.) EQ -1 OR R(45666.) EQ -2 OR R(45667.) EQ -2)
COMPUTE HRUSL1=-2
ELSE IF (R(45666.) EQ 995 OR R(45667.) EQ 995)
COMPUTE HRUSL1=995
ELSE IF (R(45666.) EQ 1)
COMPUTE HRUSL1=Q5B2_26B
ELSE IF (R(45667.) EQ 1)
COMPUTE HRUSL1=Q5B2_26D
ELSE IF (R(45582.) EQ -4)
COMPUTE HRUSL1=-4
ELSE IF (Q5B_26A EQ -1 OR R(45583.) EQ -1 OR Q5B_26A EQ -2 OR R(45583.) EQ -2)
COMPUTE HRUSL1=-2
ELSE IF (Q5B_26A EQ 995 OR R(45583.) EQ 995)
COMPUTE HRUSL1=995
ELSE IF (Q5B_26A EQ 1)
COMPUTE HRUSL1=Q5B_26B
ELSE IF (R(45583.) EQ 1)
COMPUTE HRUSL1=R(45584.)
ELSE IF (R(45399.) EQ -4)
COMPUTE HRUSL1=-4
ELSE IF (R(45400.) EQ -1 OR R(45402.) EQ -1 OR R(45400.) EQ -2 OR R(45402.) EQ -2)
COMPUTE HRUSL1=-2
ELSE IF (R(45400.) EQ 995 OR R(45402.) EQ 995)
COMPUTE HRUSL1=995
ELSE IF (R(45400.) EQ 1)
COMPUTE HRUSL1=R(45401.)
ELSE IF (R(45402.) EQ 1)
COMPUTE HRUSL1=R(45403.)
ELSE 
COMPUTE HRUSL1=-3
END IF
 
/* the following lines create the var HRUSL2 */
DO IF (Q5B2_28A EQ -4)
COMPUTE HRUSL2=-4
ELSE IF (Q5B2_28B EQ -1 OR Q5B2_28D EQ -1 OR Q5B2_28B EQ -2 OR Q5B2_28D EQ -2)
COMPUTE HRUSL2=-2
ELSE IF (Q5B2_28B EQ 995 OR Q5B2_28D EQ 995)
COMPUTE HRUSL2=995
ELSE IF (Q5B2_28B EQ 1)
COMPUTE HRUSL2=Q5B2_28C
ELSE IF (Q5B2_28D EQ 1)
COMPUTE HRUSL2=Q5B2_28E
ELSE IF (Q5B_28A EQ -4)
COMPUTE HRUSL2=-4
ELSE IF (Q5B_28B EQ -1 OR Q5B_28D EQ -1 OR Q5B_28B EQ -2 OR Q5B_28D EQ -2)
COMPUTE HRUSL2=-2
ELSE IF (Q5B_28B EQ 995 OR Q5B_28D EQ 995)
COMPUTE HRUSL2=995
ELSE IF (Q5B_28B EQ 1)
COMPUTE HRUSL2=Q5B_28C
ELSE IF (Q5B_28D EQ 1)
COMPUTE HRUSL2=Q5B_28E
ELSE IF (R(45405.) EQ -4)
COMPUTE HRUSL2=-4
ELSE IF (R(45406.) EQ -1 OR R(45408.) EQ -1 OR R(45406.) EQ -2 OR R(45408.) EQ -2)
COMPUTE HRUSL2=-2
ELSE IF (R(45406.) EQ 995 OR R(45408.) EQ 995)
COMPUTE HRUSL2=995
ELSE IF (R(45406.) EQ 1)
COMPUTE HRUSL2=Q5_28C
ELSE IF (R(45408.) EQ 1)
COMPUTE HRUSL2=Q5_28E
ELSE 
COMPUTE HRUSL2=-3
END IF 
 
/* the following lines create the var HRUSLT */
DO IF (R(45665.) EQ -4)
COMPUTE HRUSLT=-4
ELSE IF ((R(45666.) EQ -1 OR R(45667.) EQ -1 OR R(45666.) EQ -2 OR R(45667.) EQ -2) AND 
                    (Q5B2_28B EQ -1 OR Q5B2_28D EQ -1 OR Q5B2_28B EQ -2 OR Q5B2_28D EQ -2))
COMPUTE HRUSLT=-2
ELSE IF ((R(45666.) EQ 995 OR R(45667.) EQ 995) AND (Q5B2_28B EQ 995 OR Q5B2_28D EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((R(45666.) EQ -1 OR R(45667.) EQ -1 OR R(45666.) EQ -2 OR R(45667.) EQ -2) AND 
                    (Q5B2_28B EQ 995 OR Q5B2_28D EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((R(45666.) EQ 995 OR R(45667.) EQ 995) AND (Q5B2_28B EQ -1 OR Q5B2_28D EQ -1 OR 
                    Q5B2_28B EQ -2 OR Q5B2_28D EQ -2))
COMPUTE HRUSLT=995
ELSE IF ((R(45666.) EQ 995 OR R(45667.) EQ 995) AND Q5B2_27 NE 1)
COMPUTE HRUSLT=995
ELSE IF ((R(45666.) EQ -1 OR R(45667.) EQ -1 OR R(45666.) EQ -2 OR R(45667.) EQ -2) AND Q5B2_27 NE 1)
COMPUTE HRUSLT=-2
ELSE IF (R(45666.) EQ 1 AND (Q5B2_28B EQ -1 OR Q5B2_28B EQ -2 OR Q5B2_28B EQ 995 OR 
                    Q5B2_28D EQ -1 OR Q5B2_28D EQ -2 OR Q5B2_28D EQ 995))
COMPUTE HRUSLT=Q5B2_26B
ELSE IF (R(45667.) EQ 1 AND (Q5B2_28B EQ -1 OR Q5B2_28B EQ -2 OR Q5B2_28B EQ 995 OR 
                    Q5B2_28D EQ -1 OR Q5B2_28D EQ -2 OR Q5B2_28D EQ 995))
COMPUTE HRUSLT=Q5B2_26D
ELSE IF (Q5B2_28B EQ 1 AND (R(45666.) EQ -1 OR R(45666.) EQ -2 OR R(45666.) EQ 995 OR 
                    R(45667.) EQ -1 OR R(45667.) EQ -2 OR R(45667.) EQ 995))
COMPUTE HRUSLT=Q5B2_28C
ELSE IF (Q5B2_28D EQ 1 AND (R(45666.) EQ -1 OR R(45666.) EQ -2 OR R(45666.) EQ 995 OR 
                    R(45667.) EQ -1 OR R(45667.) EQ -2 OR R(45667.) EQ 995))
COMPUTE HRUSLT=Q5B2_28E
ELSE IF (R(45666.) EQ 1 AND Q5B2_27 NE 1)
COMPUTE HRUSLT=Q5B2_26B
ELSE IF (R(45667.) EQ 1 AND Q5B2_27 NE 1)
COMPUTE HRUSLT=Q5B2_26D
ELSE IF (R(45666.) EQ 1 AND Q5B2_28B EQ 1)
COMPUTE HRUSLT=Q5B2_26B+Q5B2_28C
ELSE IF (R(45666.) EQ 1 AND Q5B2_28D EQ 1)
COMPUTE HRUSLT=Q5B2_26B+Q5B2_28E
ELSE IF (R(45667.) EQ 1 AND Q5B2_28B EQ 1)
COMPUTE HRUSLT=Q5B2_26D+Q5B2_28C
ELSE IF (R(45667.) EQ 1 AND Q5B2_28D EQ 1)
COMPUTE HRUSLT=R(45667.)+Q5B2_28E
ELSE IF (R(45582.) EQ -4)
COMPUTE HRUSLT=-4
ELSE IF ((Q5B_26A EQ -1 OR R(45583.) EQ -1 OR Q5B_26A EQ -2 OR R(45583.) EQ -2) AND 
                    (Q5B_28B EQ -1 OR Q5B_28D EQ -1 OR Q5B_28B EQ -2 OR Q5B_28D EQ -2))
COMPUTE HRUSLT=-2
ELSE IF ((Q5B_26A EQ 995 OR R(45583.) EQ 995) AND (Q5B_28B EQ 995 OR Q5B_28D EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((Q5B_26A EQ -1 OR R(45583.) EQ -1 OR Q5B_26A EQ -2 OR R(45583.) EQ -2) AND 
                    (Q5B_28B EQ 995 OR Q5B_28D EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((Q5B_26A EQ 995 OR R(45583.) EQ 995) AND (Q5B_28B EQ -1 OR Q5B_28D EQ -1 OR 
                    Q5B_28B EQ -2 OR Q5B_28D EQ -2))
COMPUTE HRUSLT=995
ELSE IF ((Q5B_26A EQ 995 OR R(45583.) EQ 995) AND R(45585.) NE 1)
COMPUTE HRUSLT=995
ELSE IF ((Q5B_26A EQ -1 OR R(45583.) EQ -1 OR Q5B_26A EQ -2 OR R(45583.) EQ -2) AND R(45585.) NE 1)
COMPUTE HRUSLT=-2
ELSE IF (Q5B_26A EQ 1 AND (Q5B_28B EQ -1 OR Q5B_28B EQ -2 OR Q5B_28B EQ 995 OR 
                    Q5B_28D EQ -1 OR Q5B_28D EQ -2 OR Q5B_28D EQ 995))
COMPUTE HRUSLT=Q5B_26B
ELSE IF (R(45583.) EQ 1 AND (Q5B_28B EQ -1 OR Q5B_28B EQ -2 OR Q5B_28B EQ 995 OR 
                    Q5B_28D EQ -1 OR Q5B_28D EQ -2 OR Q5B_28D EQ 995))
COMPUTE HRUSLT=R(45584.)
ELSE IF (Q5B_28B EQ 1 AND (Q5B_26A EQ -1 OR Q5B_26A EQ -2 OR Q5B_26A EQ 995 OR 
                    R(45583.) EQ -1 OR R(45583.) EQ -2 OR R(45583.) EQ 995))
COMPUTE HRUSLT=Q5B_28C
ELSE IF (Q5B_28D EQ 1 AND (Q5B_26A EQ -1 OR Q5B_26A EQ -2 OR Q5B_26A EQ 995 OR 
                    R(45583.) EQ -1 OR R(45583.) EQ -2 OR R(45583.) EQ 995))
COMPUTE HRUSLT=Q5B_28E
ELSE IF (Q5B_26A EQ 1 AND R(45585.) NE 1)
COMPUTE HRUSLT=Q5B_26B
ELSE IF (R(45583.) EQ 1 AND R(45585.) NE 1)
COMPUTE HRUSLT=R(45584.)
ELSE IF (Q5B_26A EQ 1 AND Q5B_28B EQ 1)
COMPUTE HRUSLT=Q5B_26B+Q5B_28C
ELSE IF (Q5B_26A EQ 1 AND Q5B_28D EQ 1)
COMPUTE HRUSLT=Q5B_26B+Q5B_28E
ELSE IF (R(45583.) EQ 1 AND Q5B_28B EQ 1)
COMPUTE HRUSLT=R(45584.)+Q5B_28C
ELSE IF (R(45583.) EQ 1 AND Q5B_28D EQ 1)
COMPUTE HRUSLT=R(45583.)+Q5B_28E
ELSE IF (R(45399.) EQ -4)
COMPUTE HRUSLT=-4
ELSE IF ((R(45400.) EQ -1 OR R(45402.) EQ -1 OR R(45400.) EQ -2 OR R(45402.) EQ -2) AND 
                    (R(45406.) EQ -1 OR R(45408.) EQ -1 OR R(45406.) EQ -2 OR R(45408.) EQ -2))
COMPUTE HRUSLT=-2
ELSE IF ((R(45400.) EQ 995 OR R(45402.) EQ 995) AND (R(45406.) EQ 995 OR R(45408.) EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((R(45400.) EQ -1 OR R(45402.) EQ -1 OR R(45400.) EQ -2 OR R(45402.) EQ -2) AND 
                    (R(45406.) EQ 995 OR R(45408.) EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((R(45400.) EQ 995 OR R(45402.) EQ 995) AND (R(45406.) EQ -1 OR R(45408.) EQ -1 OR 
                    R(45406.) EQ -2 OR R(45408.) EQ -2))
COMPUTE HRUSLT=995
ELSE IF ((R(45400.) EQ 995 OR R(45402.) EQ 995) AND R(45404.) NE 1)
COMPUTE HRUSLT=995
ELSE IF ((R(45400.) EQ -1 OR R(45402.) EQ -1 OR R(45400.) EQ -2 OR R(45402.) EQ -2) AND R(45404.) NE 1)
COMPUTE HRUSLT=-2
ELSE IF (R(45400.) EQ 1 AND (R(45406.) EQ -1 OR R(45406.) EQ -2 OR R(45406.) EQ 995 OR 
                    R(45408.) EQ -1 OR R(45408.) EQ -2 OR R(45408.) EQ 995))
COMPUTE HRUSLT=R(45401.)
ELSE IF (R(45402.) EQ 1 AND (R(45406.) EQ -1 OR R(45406.) EQ -2 OR R(45406.) EQ 995 OR 
                    R(45408.) EQ -1 OR R(45408.) EQ -2 OR R(45408.) EQ 995))
COMPUTE HRUSLT=R(45403.)
ELSE IF (R(45406.) EQ 1 AND (R(45400.) EQ -1 OR R(45400.) EQ -2 OR R(45400.) EQ 995 OR 
                    R(45402.) EQ -1 OR R(45402.) EQ -2 OR R(45402.) EQ 995))
COMPUTE HRUSLT=R(45407.)
ELSE IF (R(45408.) EQ 1 AND (R(45400.) EQ -1 OR R(45400.) EQ -2 OR R(45400.) EQ 995 OR 
                    R(45402.) EQ -1 OR R(45402.) EQ -2 OR R(45402.) EQ 995))
COMPUTE HRUSLT=R(45409.)
ELSE IF (R(45400.) EQ 1 AND R(45404.) NE 1)
COMPUTE HRUSLT=R(45401.)
ELSE IF (R(45402.) EQ 1 AND R(45404.) NE 1)
COMPUTE HRUSLT=R(45403.)
ELSE IF (R(45400.) EQ 1 AND R(45406.) EQ 1)
COMPUTE HRUSLT=R(45401.)+R(45407.)
ELSE IF (R(45400.) EQ 1 AND R(45408.) EQ 1)
COMPUTE HRUSLT=R(45401.)+R(45409.)
ELSE IF (R(45402.) EQ 1 AND R(45406.) EQ 1)
COMPUTE HRUSLT=R(45403.)+R(45407.)
ELSE IF (R(45402.) EQ 1 AND R(45408.) EQ 1)
COMPUTE HRUSLT=R(45402.)+R(45409.)
ELSE 
COMPUTE HRUSLT=-3
END IF
 
/* the following lines create the var HRFTPT */
DO IF (Q5B2_30C EQ -4)
COMPUTE HRFTPT=-4
ELSE IF (Q5B2_30F EQ -1 OR Q5B2_30G EQ -1 OR Q5B2_30H EQ -1 OR Q5B2_30I EQ -1)
COMPUTE HRFTPT=-1
ELSE IF (Q5B2_30F EQ -2 OR Q5B2_30G EQ -2 OR Q5B2_30H EQ -2 OR Q5B2_30I EQ -2)
COMPUTE HRFTPT=-2
ELSE IF (Q5B2_30F NE -4)
COMPUTE HRFTPT=Q5B2_30F
ELSE IF (Q5B2_30G NE -4)
COMPUTE HRFTPT=Q5B2_30G
ELSE IF (Q5B2_30H NE -4)
COMPUTE HRFTPT=Q5B2_30H
ELSE IF (Q5B2_30I NE -4)
COMPUTE HRFTPT=Q5B2_30I
ELSE IF (Q5B_30C EQ -4)
COMPUTE HRFTPT=-4
ELSE IF (Q5B_30F EQ -1 OR Q5B_30G EQ -1 OR Q5B_30H EQ -1 OR Q5B_30I EQ -1)
COMPUTE HRFTPT=-1
ELSE IF (Q5B_30F EQ -2 OR Q5B_30G EQ -2 OR Q5B_30H EQ -2 OR Q5B_30I EQ -2)
COMPUTE HRFTPT=-2
ELSE IF (Q5B_30F NE -4)
COMPUTE HRFTPT=Q5B_30F
ELSE IF (Q5B_30G NE -4)
COMPUTE HRFTPT=Q5B_30G
ELSE IF (Q5B_30H NE -4)
COMPUTE HRFTPT=Q5B_30H
ELSE IF (Q5B_30I NE -4)
COMPUTE HRFTPT=Q5B_30I
ELSE IF (R(45420.) EQ -4)
COMPUTE HRFTPT=-4
ELSE IF (Q5_30F EQ -1 OR R(45423.) EQ -1 OR R(45424.) EQ -1 OR R(45425.) EQ -1)
COMPUTE HRFTPT=-1
ELSE IF (Q5_30F EQ -2 OR R(45423.) EQ -2 OR R(45424.) EQ -2 OR R(45425.) EQ -2)
COMPUTE HRFTPT=-2
ELSE IF (Q5_30F NE -4)
COMPUTE HRFTPT=Q5_30F
ELSE IF (R(45423.) NE -4)
COMPUTE HRFTPT=R(45423.)
ELSE IF (R(45424.) NE -4)
COMPUTE HRFTPT=R(45424.)
ELSE IF (R(45425.) NE -4)
COMPUTE HRFTPT=R(45425.)
ELSE
COMPUTE HRFTPT=-3
END IF 
 
/* the following lines create the var HRWANT */
DO IF (Q5B2_33 NE -4)
COMPUTE HRWANT=Q5B2_33
ELSE IF (Q5B_33 NE -4)
COMPUTE HRWANT=Q5B_33
ELSE 
COMPUTE HRWANT=R(45436.)
END IF
 
/* the following lines create the var HRRSN1 */
DO IF (Q5B2_34 NE -4)
COMPUTE HRRSN1=Q5B2_34
ELSE IF (Q5B_34 NE -4)
COMPUTE HRRSN1=Q5B_34
ELSE
COMPUTE HRRSN1=R(45437.)
END IF
 
/* the following lines create the var HRCK7 */
COMPUTE HRCK7=-4
DO IF ((BUS2 EQ 2 OR BUS2 EQ -2 OR BUS2 EQ -1) AND (HRACT1 LT 15 OR HRACT1 EQ -2))
COMPUTE HRCK7=1
ELSE IF ((BUS2 EQ 2 OR BUS2 EQ -2 OR BUS2 EQ -1) AND HRACT1 GE 15)
COMPUTE HRCK7=2
ELSE IF ((HRUSLT GE 35 OR HRFTPT EQ 1) AND HRACTT LT 35 AND (HRACT1 NE -1 OR 
                    HRACT1 NE -2 OR HRACT2 NE -1 OR HRACT2 NE -2)) 
COMPUTE HRCK7=3
ELSE IF (HRWANT EQ 1 AND HRACTT LT 35 AND (HRRSN1 EQ 1 OR HRRSN1 EQ 2 OR HRRSN1 EQ 3))
COMPUTE HRCK7=4
ELSE 
COMPUTE HRCK7=5
END IF 
 
/* the following lines create the var ABSOT */
DO IF (HRACT1 EQ 0 AND HRACT2 EQ 0)
COMPUTE ABSOT=1
ELSE
COMPUTE ABSOT=0
END IF
 
/* the following lines create the var HRCK6 */
COMPUTE HRCK6=-4
DO IF ((HRACT1 EQ 0 AND HRACT2 EQ 0) AND (BUS2 EQ 2 OR BUS2 EQ -1 OR BUS2 EQ -2))
COMPUTE HRCK6=1
ELSE IF (ABSOT EQ 1)
COMPUTE HRCK6=2
ELSE 
COMPUTE HRCK6=3
END IF
 
/* the following lines create the var WK */
COMPUTE WK=-4
DO IF (R(45364.) NE -4)
COMPUTE WK=R(45364.)
ELSE IF (R(45365.) NE -4)
COMPUTE WK=R(45365.)
END IF
 
/* the following lines create the var RETOT */
DO IF (WK EQ 3)
COMPUTE RETOT=1
ELSE
COMPUTE RETOT=0
END IF
 
/* the following lines rename the vars */
COMPUTE BUS1=R(45367.)
COMPUTE RET1=R(45374.)
COMPUTE IO1COW=R(45360.)
COMPUTE NLFACT=R(45737.)
 
/* the following lines create additional variables */
 
DO IF (Q5B2_22 NE -4)
COMPUTE ABSPD=Q5B2_22
ELSE IF (R(45577.) NE -4)
COMPUTE ABSPD=R(45577.)
ELSE
COMPUTE ABSPD=R(45393.)
END IF
 
DO IF (Q5B2_65 NE -4)
COMPUTE LKAVL=Q5B2_65
ELSE IF (R(45647.) NE -4)
COMPUTE LKAVL=R(45647.)
ELSE
COMPUTE LKAVL=R(45539.)
END IF
 
DO IF (Q5B2_51 NE -4)
COMPUTE LAYAVL=Q5B2_51
ELSE IF (Q5B_51 NE -4)
COMPUTE LAYAVL=Q5B_51
ELSE
COMPUTE LAYAVL=R(45470.)
END IF
 
DO IF (Q5B2_66 NE -4)
COMPUTE LKAVR=Q5B2_66
ELSE IF (Q5B_66 NE -4)
COMPUTE LKAVR=Q5B_66
ELSE
COMPUTE LKAVR=R(45540.)
END IF
 
DO IF (Q5B2_52 NE -4)
COMPUTE LAYAVR=Q5B2_52
ELSE IF (Q5B_52 NE -4)
COMPUTE LAYAVR=Q5B_52
ELSE
COMPUTE LAYAVR=R(45471.)
END IF
 
DO IF (Q5B2_60 NE -4)
COMPUTE LK=Q5B2_60
ELSE IF (R(45600.) NE -4)
COMPUTE LK=R(45600.)
ELSE
COMPUTE LK=R(45480.)
END IF
 
DO IF (Q5B2_11 NE -4)
COMPUTE DIS1=Q5B2_11
ELSE IF (R(45562.) NE -4)
COMPUTE DIS1=R(45562.)
ELSE
COMPUTE DIS1=R(45375.)
END IF
 
DO IF (Q5B2_12 NE -4)
COMPUTE DIS2=Q5B2_12
ELSE IF (R(45563.) NE -4)
COMPUTE DIS2=R(45563.)
ELSE
COMPUTE DIS2=R(45376.)
END IF
 
/* the following lines create the var DWWNTO */
DO IF (RET1 EQ 1)
COMPUTE DWWNTO=1
 
ELSE IF (Q5B2_78 EQ 1)
COMPUTE DWWNTO=1
ELSE IF (Q5B2_78 EQ 0)
COMPUTE DWWNTO=2
ELSE IF (Q5B2_78 EQ -2)
COMPUTE DWWNTO=-2
ELSE IF (Q5B2_78 EQ -1)
COMPUTE DWWNTO=-1
ELSE IF (Q5B2_78 EQ 3)
COMPUTE DWWNTO=3
ELSE IF (Q5B2_78 EQ 4)
COMPUTE DWWNTO=4
ELSE IF (R(45662.) EQ 1)
COMPUTE DWWNTO=1
ELSE IF (R(45662.) EQ 0)
COMPUTE DWWNTO=2
ELSE IF (R(45662.) EQ -2)
COMPUTE DWWNTO=-2
ELSE IF (R(45662.) EQ -1)
COMPUTE DWWNTO=-1
ELSE IF (R(45662.) EQ 3)
COMPUTE DWWNTO=3
ELSE IF (R(45662.) EQ 4)
COMPUTE DWWNTO=4
ELSE IF (R(45558.) EQ 1)
COMPUTE DWWNTO=1
ELSE IF (R(45558.) EQ 0)
COMPUTE DWWNTO=2
ELSE IF (R(45558.) EQ -2)
COMPUTE DWWNTO=-2
ELSE IF (R(45558.) EQ -1)
COMPUTE DWWNTO=-1
ELSE IF (R(45558.) EQ 3)
COMPUTE DWWNTO=3
ELSE IF (R(45558.) EQ 4)
COMPUTE DWWNTO=4
ELSE
COMPUTE DWWNTO=-3
END IF
 
/* the following lines create the var DIS */
DO IF (Q5_9A4 EQ -4)
COMPUTE DIS=-4
ELSE IF (Q5_9D EQ -1 OR Q5_9E EQ -1 OR Q5_9F EQ -1 OR Q5_9G EQ -1) OR (Q5_9D EQ -2 OR 
                    Q5_9E EQ -2 OR Q5_9F EQ -2 OR Q5_9G EQ -2)
COMPUTE DIS=-2
ELSE IF (Q5_9A4 EQ 1 AND Q5_9D EQ 1)
COMPUTE DIS=1
ELSE IF (Q5_9D EQ 0)
COMPUTE DIS=0
ELSE IF (Q5_9A5 EQ 1 AND Q5_9E EQ 1)
COMPUTE DIS=1
ELSE IF (Q5_9E EQ 0)
COMPUTE DIS=0
ELSE IF (Q5_9A6 EQ 1 AND Q5_9F EQ 1)
COMPUTE DIS=1
ELSE IF (Q5_9F EQ 0)
COMPUTE DIS=0
ELSE IF (Q5_9A7 EQ 1 AND Q5_9G EQ 1)
COMPUTE DIS=1
ELSE IF (Q5_9G EQ 0)
COMPUTE DIS=0
ELSE 
COMPUTE DIS=-3
END IF
 
/* the following lines create IO1COW */
DO IF (R(45360.) EQ 1)
COMPUTE IO1COW=8
ELSE
COMPUTE IO1COW=0
END IF
 
/* the following lines create the ESR var approximating MLR */
DO IF ((WK EQ 1 AND (HRCK6 EQ 3 OR HRCK6 EQ -4 OR HRCK6 EQ 99 OR HRCK6 EQ 999)) OR 
                    (BUS1 EQ 1 AND (HRCK7 EQ 2 OR HRCK7 EQ 3 OR HRCK7 EQ 4 OR HRCK7 EQ 5 OR 
                    HRCK7 EQ -4)))
COMPUTE ESR=1
ELSE IF (ABSPD EQ 1 OR ABSPD EQ 0 OR ABSPD EQ -1 OR ABSPD EQ -2)
COMPUTE ESR=2
ELSE IF ((LAYAVL EQ 1 OR LAYAVL EQ -1 OR LAYAVL EQ -2) OR LAYAVR EQ 1)
COMPUTE ESR=3
ELSE IF ((LKAVL EQ 1 OR LKAVL EQ -1 OR LKAVL EQ -2) OR (LKAVR EQ 1 OR LKAVR EQ 2))
COMPUTE ESR=4
ELSE IF ((WK EQ 3 AND AGE GE 50 AND RET1 EQ 1 AND LK EQ 1 AND LKAVL EQ 0 AND 
                    (LKAVR EQ 3 OR LKAVR EQ 4 OR LKAVR EQ -1 OR LKAVR EQ -2)) OR             (RET1 EQ 0 OR 
                    LK EQ 3 OR DWWNTO EQ 3) OR NLFACT EQ 5 OR RETOT EQ 1) 
COMPUTE ESR=5
ELSE IF (DIS1 EQ 1 OR DIS2 EQ 1 OR DIS EQ 1)
COMPUTE ESR=6
ELSE IF (R(45360.) EQ 1)
COMPUTE ESR=8
ELSE
COMPUTE ESR=7
END IF 
 
          ESR(6)=R(15199.);
          ESR(7)=R(18906.);
          ESR(8)=R(22577.);
          ESR(9)=R(24451.);
          ESR(10)=R(28706.);
          ESR(11)=R(30743.);
          ESR(12)=R(34010.);
          ESR(13)=R(36564.);
          ESR(14)=R(40069.);
          ESR(15)=R(44180.);
          ESR(16)=R(50810.);
          ESRC(6)=R(15199.01);
          ESRC(7)=R(18906.01);
          ESRC(8)=R(22577.01);
          ESRC(9)=R(24451.01);
          ESRC(10)=R(28707.);
          ESRC(11)=R(30744.);
          ESRC(12)=R(34011.);
          EARC(13)=R(36565.);
          EARC(14)=R(40070.);
          ESRC(15)=R(44181.);
     ESRC(16)=R(50811.);

1996 VARIABLES

/* The programming for the new 1996 ESR variables is done in SPSS */
 
/* the following lines create the var AGE */
COMPUTE AGE=37
 
/* the following lines construct the var HRACT1 */
DO IF (Q5B2_40A EQ -4)
COMPUTE HRACT1=-4
ELSE IF (Q5B2_41A EQ -1 OR Q5B2_41B EQ -1 OR Q5B2_41C EQ -1 OR Q5B2_41D EQ -1 OR 
                    Q5B2_41A EQ -2 OR Q5B2_41B EQ -2 OR Q5B2_41C EQ -2 OR Q5B2_41D EQ -2)
COMPUTE HRACT1=-2
ELSE IF (Q5B2_41A EQ 995 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ 995 OR Q5B2_41D EQ 995)
COMPUTE HRACT1=995
ELSE IF (Q5B2_40B EQ 1 AND Q5B2_41A NE -4)
COMPUTE HRACT1=Q5B2_41A
ELSE IF (Q5B2_40C EQ 1 AND Q5B2_41B NE -4)
COMPUTE HRACT1=Q5B2_41B
ELSE IF (Q5B2_40D EQ 1 AND Q5B2_41C NE -4)
COMPUTE HRACT1=Q5B2_41C
ELSE IF (Q5B2_40E EQ 1 OR Q5B2_40E EQ 0)
COMPUTE HRACT1=Q5B2_41D
ELSE IF (Q5B_40A EQ -4)
COMPUTE HRACT1=-4
ELSE IF (Q5B_41A EQ -1 OR Q5B_41B EQ -1 OR Q5B_41C EQ -1 OR Q5B_41D EQ -1 OR Q5B_41A EQ -2 OR 
                    Q5B_41B EQ -2 OR Q5B_41C EQ -2 OR Q5B_41D EQ -2)
COMPUTE HRACT1=-2
ELSE IF (Q5B_41A EQ 995 OR Q5B_41B EQ 995 OR Q5B_41C EQ 995 OR Q5B_41D EQ 995)
COMPUTE HRACT1=995
ELSE IF (Q5BCK_40B EQ 1 AND Q5B_41A NE -4)
COMPUTE HRACT1=Q5B_41A
ELSE IF (Q5BCK_40C EQ 1 AND Q5B_41B NE -4)
COMPUTE HRACT1=Q5B_41B
ELSE IF (Q5BCK_40D EQ 1 AND Q5B_41C NE -4)
COMPUTE HRACT1=Q5B_41C
ELSE IF (Q5B_40E EQ 1 OR Q5B_40E EQ 0)
COMPUTE HRACT1=Q5B_41D
ELSE IF (R(52404.) EQ -4)
COMPUTE HRACT1=-4
ELSE IF (Q5_41A EQ -1 OR Q5_41B EQ -1 OR Q5_41C EQ -1 OR Q5_41D EQ -1 OR Q5_41A EQ -2 OR 
                    Q5_41B EQ -2 OR Q5_41C EQ -2 OR Q5_41D EQ -2)
COMPUTE HRACT1=-2
ELSE IF (Q5_41A EQ 995 OR Q5_41B EQ 995 OR Q5_41C EQ 995 OR Q5_41D EQ 995)
COMPUTE HRACT1=995
ELSE IF (Q5_40B EQ 1 AND Q5_41A NE -4)
COMPUTE HRACT1= Q5_41A
ELSE IF (Q5_40C EQ 1 AND Q5_41B NE -4)
COMPUTE HRACT1= Q5_41B
ELSE IF (Q5_40D EQ 1 AND Q5_41C NE -4)
COMPUTE HRACT1= Q5_41C
ELSE IF (Q5_40E EQ 1 OR Q5_4OE EQ 0)
COMPUTE HRACT1= Q5_41D
ELSE
COMPUTE HRACT1=-3
END IF
 
/* the following lines construct the var HRACT2 */
DO IF (Q5B2_42 EQ -4 OR Q5B2_42 EQ 0)
COMPUTE HRACT2=-4
ELSE IF (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1OR Q5B2_43A EQ -2 OR Q5B2_43B EQ -2)
COMPUTE HRACT2=-2
ELSE IF (Q5B2_43A EQ 995 OR Q5B2_43B EQ 995)
COMPUTE HRACT2=995
ELSE IF (Q5B2_43 EQ 1)
COMPUTE HRACT2=Q5B2_43A
ELSE IF (Q5B2_42 EQ 1 AND Q5B2_43 EQ 0)
COMPUTE HRACT2=Q5B2_43B
ELSE IF (Q5B_42 EQ -4 OR Q5B_42 EQ 0)
COMPUTE HRACT2=-4
ELSE IF (Q5B_43A EQ -1 OR Q5B_43B EQ -1 OR Q5B_43A EQ -2 OR Q5B_43B EQ -2)
COMPUTE HRACT2=-2
ELSE IF (Q5B_43A EQ 995 OR Q5B_43B EQ 995)
COMPUTE HRACT2=995
ELSE IF (Q5B_43 EQ 1)
COMPUTE HRACT2=Q5B_43A
ELSE IF (Q5B_42 EQ 1 AND Q5B_43 EQ 0)
COMPUTE HRACT2=Q5B_43B
ELSE IF (Q5_42 EQ -4 OR Q5_42 EQ 0)
COMPUTE HRACT2=-4
ELSE IF (Q5_43A EQ -1 OR Q5_43B EQ -1 OR Q5_43A EQ -2 OR Q5_43B EQ -2)
COMPUTE HRACT2=-2
ELSE IF (Q5_43A EQ 995 OR Q5_43B EQ 995)
COMPUTE HRACT2=995
ELSE IF (Q5_43 EQ 1)
COMPUTE HRACT2= Q5_43A
ELSE IF (Q5_42 EQ 1 AND Q5_43 EQ 0)
COMPUTE HRACT2= Q5_43B
ELSE 
COMPUTE HRACT2=-3
END IF
 
/* the following lines create the var HRACTT */
DO IF (Q5B2_40A EQ -4)
COMPUTE HRACTT=-4
ELSE IF ((Q5B2_41A EQ -1 OR Q5B2_41B EQ -1 OR Q5B2_41C EQ -1 OR Q5B2_41D EQ -1 OR 
                    Q5B2_41A EQ -2 OR Q5B2_41B EQ -2 OR Q5B2_41C EQ -2 OR Q5B2_41D EQ -2) AND 
                    (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1 OR Q5B2_43A EQ -2 OR Q5B2_43B EQ -2))
COMPUTE HRACTT=-2
ELSE IF ((Q5B2_41A EQ 995 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ 995 OR Q5B2_41D EQ 995) AND 
                    (Q5B2_43A EQ 995 OR Q5B2_43B EQ 995))
COMPUTE HRACTT=995
ELSE IF ((Q5B2_41A EQ -1 OR Q5B2_41B EQ -1 OR Q5B2_41C EQ -1 OR Q5B2_41D EQ -1 OR 
                    Q5B2_41A EQ -2 OR Q5B2_41B EQ -2 OR Q5B2_41C EQ -2 OR Q5B2_41D EQ -2) AND 
                    (Q5B2_43A EQ 995 OR Q5B2_43B EQ 995))
COMPUTE HRACTT=995
ELSE IF ((Q5B2_41A EQ 995 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ 995 OR Q5B2_41D EQ 995 OR 
                    Q5B2_41A EQ 995 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ 995 OR Q5B2_41D EQ 995) AND 
                    (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1 OR Q5B2_43A EQ -2 OR Q5B2_43B EQ -2))
COMPUTE HRACTT=995
ELSE IF ((Q5B2_41A NE -4 AND Q5B2_41A NE -1 AND Q5B2_41A NE -2 AND Q5B2_41A NE 995) AND 
                    (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1 OR Q5B2_43A EQ -2 OR Q5B2_43B EQ -2 OR 
                    Q5B2_43A EQ 995 OR Q5B2_43B EQ 995))
COMPUTE HRACTT=Q5B2_41A
ELSE IF ((Q5B2_41B NE -4 AND Q5B2_41B NE -1 AND Q5B2_41B NE -2 AND Q5B2_41B NE 995) AND 
                    (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1 OR Q5B2_43A EQ -2 OR Q5B2_43B EQ -2 OR 
                    Q5B2_43A EQ 995 OR Q5B2_43B EQ 995))
COMPUTE HRACTT=Q5B2_41B
ELSE IF ((Q5B2_41C NE -4 AND Q5B2_41C NE -1 AND Q5B2_41C NE -2 AND Q5B2_41C NE 995) AND 
                    (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1 OR Q5B2_43A EQ -2 OR Q5B2_43B EQ -2 OR 
                    Q5B2_43A EQ 995 OR Q5B2_43B EQ 995))
COMPUTE HRACTT=Q5B2_41C
ELSE IF ((Q5B2_41D NE -4 AND Q5B2_41D NE -1 AND Q5B2_41D NE -2 AND Q5B2_41D NE 995) AND 
                    (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1 OR Q5B2_43A EQ -2 OR Q5B2_43B EQ -2 OR 
                    Q5B2_43A EQ 995 OR Q5B2_43B EQ 995))
COMPUTE HRACTT=Q5B2_41D
ELSE IF ((Q5B2_43A NE -4 AND Q5B2_43A NE -1 AND Q5B2_43A NE -2 AND Q5B2_43A NE 995) AND 
                    (Q5B2_41A EQ -1 OR Q5B2_41A EQ -2 OR Q5B2_41A EQ 995 OR Q5B2_41B EQ -1 OR 
                    Q5B2_41B EQ -2 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ -1 OR Q5B2_41C EQ -2 OR 
                    Q5B2_41C EQ 995 OR Q5B2_41D EQ -1 OR Q5B2_41D EQ -2 OR Q5B2_41D EQ 995))
COMPUTE HRACTT=Q5B2_43A
ELSE IF ((Q5B2_43B NE -4 AND Q5B2_43B NE -1 AND Q5B2_43B NE -2 AND Q5B2_43B NE 995) AND 
                    (Q5B2_41A EQ -1 OR Q5B2_41A EQ -2 OR Q5B2_41A EQ 995 OR Q5B2_41B EQ -1 OR 
                    Q5B2_41B EQ -2 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ -1 OR Q5B2_41C EQ -2 OR 
                    Q5B2_41C EQ 995 OR Q5B2_41D EQ -1 OR Q5B2_41D EQ -2 OR Q5B2_41D EQ 995))
COMPUTE HRACTT=Q5B2_43B
ELSE IF ((Q5B2_41A NE -4 AND Q5B2_41A NE -1 AND Q5B2_41A NE -2 AND Q5B2_41A NE 995) AND 
                    (Q5B2_43A NE -1 AND Q5B2_43A NE -2 AND Q5B2_43A NE 995 AND Q5B2_43A NE -4)) 
COMPUTE HRACTT=Q5B2_41A+Q5B2_43A
ELSE IF ((Q5B2_41A NE -4 AND Q5B2_41A NE -1 AND Q5B2_41A NE -2 AND Q5B2_41A NE 995) AND 
                    (Q5B2_43B NE -1 AND Q5B2_43B NE -2 AND Q5B2_43B NE 995 AND Q5B2_43B NE -4)) 
COMPUTE HRACTT=Q5B2_41A+Q5B2_43B
ELSE IF ((Q5B2_41B NE -4 AND Q5B2_41B NE -1 AND Q5B2_41B NE -2 AND Q5B2_41B NE 995) AND 
                    (Q5B2_43A NE -1 AND Q5B2_43A NE -2 AND Q5B2_43A NE 995 AND Q5B2_43A NE -4)) 
COMPUTE HRACTT=Q5B2_41B+Q5B2_43A
ELSE IF ((Q5B2_41B NE -4 AND Q5B2_41B NE -1 AND Q5B2_41B NE -2 AND Q5B2_41B NE 995) AND 
                    (Q5B2_43B NE -1 AND Q5B2_43B NE -2 AND Q5B2_43B NE 995 AND Q5B2_43B NE -4)) 
COMPUTE HRACTT=Q5B2_41B+Q5B2_43B
ELSE IF ((Q5B2_41C NE -4 AND Q5B2_41C NE -1 AND Q5B2_41C NE -2 AND Q5B2_41C NE 995) AND 
                    (Q5B2_43A NE -1 AND Q5B2_43A NE -2 AND Q5B2_43A NE 995 AND Q5B2_43A NE -4)) 
COMPUTE HRACTT=Q5B2_41C+Q5B2_43A
ELSE IF ((Q5B2_41C NE -4 AND Q5B2_41C NE -1 AND Q5B2_41C NE -2 AND Q5B2_41C NE 995) AND 
                    (Q5B2_43B NE -1 AND Q5B2_43B NE -2 AND Q5B2_43B NE 995 AND Q5B2_43B NE -4)) 
COMPUTE HRACTT=Q5B2_41C+Q5B2_43B
ELSE IF ((Q5B2_41D NE -4 AND Q5B2_41D NE -1 AND Q5B2_41D NE -2 AND Q5B2_41D NE 995) AND 
                    (Q5B2_43A NE -1 AND Q5B2_43A NE -2 AND Q5B2_43A NE 995 AND Q5B2_43A NE -4)) 
COMPUTE HRACTT=Q5B2_41D+Q5B2_43A
ELSE IF ((Q5B2_41D NE -4 AND Q5B2_41D NE -1 AND Q5B2_41D NE -2 AND Q5B2_41D NE 995) AND 
                    (Q5B2_43B NE -1 AND Q5B2_43B NE -2 AND Q5B2_43B NE 995 AND Q5B2_43B NE -4)) 
COMPUTE HRACTT=Q5B2_41D+Q5B2_43B
ELSE IF ((Q5B2_41A NE -4 AND Q5B2_41A NE -1 AND Q5B2_41A NE -2 AND Q5B2_41A NE 995) AND 
                    Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=Q5B2_41A
ELSE IF ((Q5B2_41B NE -4 AND Q5B2_41B NE -1 AND Q5B2_41B NE -2 AND Q5B2_41B NE 995) AND 
                    Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=Q5B2_41B
ELSE IF ((Q5B2_41C NE -4 AND Q5B2_41C NE -1 AND Q5B2_41C NE -2 AND Q5B2_41C NE 995) AND 
                    Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=Q5B2_41C
ELSE IF ((Q5B2_41D NE -4 AND Q5B2_41D NE -1 AND Q5B2_41D NE -2 AND Q5B2_41D NE 995) AND 
                    Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=Q5B2_41D
ELSE IF ((Q5B2_41A EQ -1 OR Q5B2_41A EQ -2 OR Q5B2_41B EQ -1 OR Q5B2_41B EQ -2 OR 
                    Q5B2_41C EQ -1 OR Q5B2_41C EQ -2 OR Q5B2_41D EQ -1 OR Q5B2_41D EQ -2) AND 
                    Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=-2
ELSE IF ((Q5B2_41A EQ 995 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ 995 OR Q5B2_41D EQ 995) AND 
                    Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=995
ELSE IF (Q5B_40A EQ -4)
COMPUTE HRACTT=-4
ELSE IF ((Q5B_41A EQ -1 OR Q5B_41B EQ -1 OR Q5B_41C EQ -1 OR Q5B_41D EQ -1 OR Q5B_41A EQ -2 OR 
                    Q5B_41B EQ -2 OR Q5B_41C EQ -2 OR Q5B_41D EQ -2) AND (Q5B_43A EQ -1 OR 
                    Q5B_43B EQ -1 OR Q5B_43A EQ -2 OR Q5B_43B EQ -2))
COMPUTE HRACTT=-2
ELSE IF ((Q5B_41A EQ 995 OR Q5B_41B EQ 995 OR Q5B_41C EQ 995 OR Q5B_41D EQ 995) AND 
                    (Q5B_43A EQ 995 OR Q5B_43B EQ 995))
COMPUTE HRACTT=995
ELSE IF ((Q5B_41A EQ -1 OR Q5B_41B EQ -1 OR Q5B_41C EQ -1 OR Q5B_41D EQ -1 OR Q5B_41A EQ -2 OR 
                    Q5B_41B EQ -2 OR Q5B_41C EQ -2 OR Q5B_41D EQ -2) AND (Q5B_43A EQ 995 OR 
                    Q5B_43B EQ 995))
COMPUTE HRACTT=995
ELSE IF ((Q5B_41A EQ 995 OR Q5B_41B EQ 995 OR Q5B_41C EQ 995 OR Q5B_41D EQ 995 OR 
                    Q5B_41A EQ 995 OR Q5B_41B EQ 995 OR Q5B_41C EQ 995 OR Q5B_41D EQ 995) AND 
                    (Q5B_43A EQ -1 OR Q5B_43B EQ -1 OR Q5B_43A EQ -2 OR Q5B_43B EQ -2))
COMPUTE HRACTT=995
ELSE IF ((Q5B_41A NE -4 AND Q5B_41A NE -1 AND Q5B_41A NE -2 AND Q5B_41A NE 995) AND 
                    (Q5B_43A EQ -1 OR Q5B_43B EQ -1 OR Q5B_43A EQ -2 OR Q5B_43B EQ -2 OR Q5B_43A EQ 995 OR 
                    Q5B_43B EQ 995))
COMPUTE HRACTT=Q5B_41A
ELSE IF ((Q5B_41B NE -4 AND Q5B_41B NE -1 AND Q5B_41B NE -2 AND Q5B_41B NE 995) AND 
                    (Q5B_43A EQ -1 OR Q5B_43B EQ -1 OR Q5B_43A EQ -2 OR Q5B_43B EQ -2 OR Q5B_43A EQ 995 OR 
                    Q5B_43B EQ 995))
COMPUTE HRACTT=Q5B_41B
ELSE IF ((Q5B_41C NE -4 AND Q5B_41C NE -1 AND Q5B_41C NE -2 AND Q5B_41C NE 995) AND 
                    (Q5B_43A EQ -1 OR Q5B_43B EQ -1 OR Q5B_43A EQ -2 OR Q5B_43B EQ -2 OR Q5B_43A EQ 995 OR
                    Q5B_43B EQ 995))
COMPUTE HRACTT=Q5B_41C
ELSE IF ((Q5B_41D NE -4 AND Q5B_41D NE -1 AND Q5B_41D NE -2 AND Q5B_41D NE 995) AND 
                    (Q5B_43A EQ -1 OR Q5B_43B EQ -1 OR Q5B_43A EQ -2 OR Q5B_43B EQ -2 OR Q5B_43A EQ 995 OR 
                    Q5B_43B EQ 995))
COMPUTE HRACTT=Q5B_41D
ELSE IF ((Q5B_43A NE -4 AND Q5B_43A NE -1 AND Q5B_43A NE -2 AND Q5B_43A NE 995) AND 
                    (Q5B_41A EQ -1 OR Q5B_41A EQ -2 OR Q5B_41A EQ 995 OR Q5B_41B EQ -1 OR Q5B_41B EQ -2 OR 
                    Q5B_41B EQ 995 OR Q5B_41C EQ -1 OR Q5B_41C EQ -2 OR Q5B_41C EQ 995 OR 
                    Q5B_41D EQ -1 OR Q5B_41D EQ -2 OR Q5B_41D EQ 995))
COMPUTE HRACTT=Q5B_43A
ELSE IF ((Q5B_43B NE -4 AND Q5B_43B NE -1 AND Q5B_43B NE -2 AND Q5B_43B NE 995) AND 
                    (Q5B_41A EQ -1 OR Q5B_41A EQ -2 OR Q5B_41A EQ 995 OR Q5B_41B EQ -1 OR Q5B_41B EQ -2 OR 
                    Q5B_41B EQ 995 OR Q5B_41C EQ -1 OR Q5B_41C EQ -2 OR Q5B_41C EQ 995 OR 
                    Q5B_41D EQ -1 OR Q5B_41D EQ -2 OR Q5B_41D EQ 995))
COMPUTE HRACTT=Q5B_43B
ELSE IF ((Q5B_41A NE -4 AND Q5B_41A NE -1 AND Q5B_41A NE -2 AND Q5B_41A NE 995) AND 
                    (Q5B_43A NE -1 AND Q5B_43A NE -2 AND Q5B_43A NE 995 AND Q5B_43A NE -4)) 
COMPUTE HRACTT=Q5B_41A+Q5B_43A
ELSE IF ((Q5B_41A NE -4 AND Q5B_41A NE -1 AND Q5B_41A NE -2 AND Q5B_41A NE 995) AND 
                    (Q5B_43B NE -1 AND Q5B_43B NE -2 AND Q5B_43B NE 995 AND Q5B_43B NE -4)) 
COMPUTE HRACTT=Q5B_41A+Q5B_43B
ELSE IF ((Q5B_41B NE -4 AND Q5B_41B NE -1 AND Q5B_41B NE -2 AND Q5B_41B NE 995) AND 
                    (Q5B_43A NE -1 AND Q5B_43A NE -2 AND Q5B_43A NE 995 AND Q5B_43A NE -4)) 
COMPUTE HRACTT=Q5B_41B+Q5B_43A
ELSE IF ((Q5B_41B NE -4 AND Q5B_41B NE -1 AND Q5B_41B NE -2 AND Q5B_41B NE 995) AND 
                    (Q5B_43B NE -1 AND Q5B_43B NE -2 AND Q5B_43B NE 995 AND Q5B_43B NE -4)) 
COMPUTE HRACTT=Q5B_41B+Q5B_43B
ELSE IF ((Q5B_41C NE -4 AND Q5B_41C NE -1 AND Q5B_41C NE -2 AND Q5B_41C NE 995) AND 
                    (Q5B_43A NE -1 AND Q5B_43A NE -2 AND Q5B_43A NE 995 AND Q5B_43A NE -4)) 
COMPUTE HRACTT=Q5B_41C+Q5B_43A
ELSE IF ((Q5B_41C NE -4 AND Q5B_41C NE -1 AND Q5B_41C NE -2 AND Q5B_41C NE 995) AND 
                    (Q5B_43B NE -1 AND Q5B_43B NE -2 AND Q5B_43B NE 995 AND Q5B_43B NE -4)) 
COMPUTE HRACTT=Q5B_41C+Q5B_43B
ELSE IF ((Q5B_41D NE -4 AND Q5B_41D NE -1 AND Q5B_41D NE -2 AND Q5B_41D NE 995) AND 
                    (Q5B_43A NE -1 AND Q5B_43A NE -2 AND Q5B_43A NE 995 AND Q5B_43A NE -4)) 
COMPUTE HRACTT=Q5B_41D+Q5B_43A
ELSE IF ((Q5B_41D NE -4 AND Q5B_41D NE -1 AND Q5B_41D NE -2 AND Q5B_41D NE 995) AND 
                    (Q5B_43B NE -1 AND Q5B_43B NE -2 AND Q5B_43B NE 995 AND Q5B_43B NE -4)) 
COMPUTE HRACTT=Q5B_41D+Q5B_43B
ELSE IF ((Q5B_41A NE -4 AND Q5B_41A NE -1 AND Q5B_41A NE -2 AND Q5B_41A NE 995) AND 
                    Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=Q5B_41A
ELSE IF ((Q5B_41B NE -4 AND Q5B_41B NE -1 AND Q5B_41B NE -2 AND Q5B_41B NE 995) AND 
                    Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=Q5B_41B
ELSE IF ((Q5B_41C NE -4 AND Q5B_41C NE -1 AND Q5B_41C NE -2 AND Q5B_41C NE 995) AND 
                    Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=Q5B_41C
ELSE IF ((Q5B_41D NE -4 AND Q5B_41D NE -1 AND Q5B_41D NE -2 AND Q5B_41D NE 995) AND 
                    Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=Q5B_41D
ELSE IF ((Q5B_41A EQ -1 OR Q5B_41A EQ -2 OR Q5B_41B EQ -1 OR Q5B_41B EQ -2 OR Q5B_41C EQ -1 OR
                    Q5B_41C EQ -2 OR Q5B_41D EQ -1 OR Q5B_41D EQ -2) AND Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=-2
ELSE IF ((Q5B_41A EQ 995 OR Q5B_41B EQ 995 OR Q5B_41C EQ 995 OR Q5B_41D EQ 995) AND 
                    Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=995
ELSE IF (R(52404.) EQ -4)
COMPUTE HRACTT=-4
ELSE IF ((Q5_41A EQ -1 OR Q5_41B EQ -1 OR Q5_41C EQ -1 OR Q5_41D EQ -1 OR Q5_41A EQ -2 OR 
                    Q5_41B EQ -2 OR Q5_41C EQ -2 OR Q5_41D EQ -2) AND (Q5_43A EQ -1 OR 
                    Q5_43B EQ -1 OR Q5_43A EQ -2 OR Q5_43B EQ -2))
COMPUTE HRACTT=-2
ELSE IF ((Q5_41A EQ 995 OR Q5_41B EQ 995 OR Q5_41C EQ 995 OR Q5_41D EQ 995) AND 
                    (Q5_43A EQ 995 OR Q5_43B EQ 995))
COMPUTE HRACTT=995
ELSE IF ((Q5_41A EQ -1 OR Q5_41B EQ -1 OR Q5_41C EQ -1 OR Q5_41D EQ -1 OR Q5_41A EQ -2 OR 
                    Q5_41B EQ -2 OR Q5_41C EQ -2 OR Q5_41D EQ -2) AND (Q5_43A EQ 995 OR 
                    Q5_43B EQ 995))
COMPUTE HRACTT=995
ELSE IF ((Q5_41A EQ 995 OR Q5_41B EQ 995 OR Q5_41C EQ 995 OR Q5_41D EQ 995 OR 
                    Q5_41A EQ 995 OR Q5_41B EQ 995 OR Q5_41C EQ 995 OR Q5_41D EQ 995) AND 
                    (Q5_43A EQ -1 OR Q5_43B EQ -1 OR Q5_43A EQ -2 OR Q5_43B EQ -2))
COMPUTE HRACTT=995
ELSE IF ((Q5_41A NE -4 AND Q5_41A NE -1 AND Q5_41A NE -2 AND Q5_41A NE 995) AND 
                    (Q5_43A EQ -1 OR Q5_43B EQ -1 OR Q5_43A EQ -2 OR Q5_43B EQ -2 OR 
                    Q5_43A EQ 995 OR Q5_43B EQ 995))
COMPUTE HRACTT= Q5_41A
ELSE IF ((Q5_41B NE -4 AND Q5_41B NE -1 AND Q5_41B NE -2 AND Q5_41B NE 995) AND 
                    (Q5_43A EQ -1 OR Q5_43B EQ -1 OR Q5_43A EQ -2 OR Q5_43B EQ -2 OR 
                    Q5_43A EQ 995 OR Q5_43B EQ 995))
COMPUTE HRACTT= Q5_41B
ELSE IF ((Q5_41C NE -4 AND Q5_41C NE -1 AND Q5_41C NE -2 AND Q5_41C NE 995) AND 
                    (Q5_43A EQ -1 OR Q5_43B EQ -1 OR Q5_43A EQ -2 OR Q5_43B EQ -2 OR 
                    Q5_43A EQ 995 OR Q5_43B EQ 995))
COMPUTE HRACTT= Q5_41C
ELSE IF ((Q5_41D NE -4 AND Q5_41D NE -1 AND Q5_41D NE -2 AND Q5_41D NE 995) AND 
                    (Q5_43A EQ -1 OR Q5_43B EQ -1 OR Q5_43A EQ -2 OR Q5_43B EQ -2 OR 
                    Q5_43A EQ 995 OR Q5_43B EQ 995))
COMPUTE HRACTT= Q5_41D
ELSE IF ((Q5_43A NE -4 AND Q5_43A NE -1 AND Q5_43A NE -2 AND Q5_43A NE 995) AND 
                    (Q5_41A EQ -1 OR Q5_41A EQ -2 OR Q5_41A EQ 995 OR Q5_41B EQ -1 OR 
                    Q5_41B EQ -2 OR Q5_41B EQ 995 OR Q5_41C EQ -1 OR Q5_41C EQ -2 OR 
                    Q5_41C EQ 995 OR Q5_41D EQ -1 OR Q5_41D EQ -2 OR Q5_41D EQ 995))
COMPUTE HRACTT= Q5_43A
ELSE IF ((Q5_43B NE -4 AND Q5_43B NE -1 AND Q5_43B NE -2 AND Q5_43B NE 995) AND 
                    Q5_41A EQ -1 OR Q5_41A EQ -2 OR Q5_41A EQ 995 OR Q5_41B EQ -1 OR Q5_41B EQ -2 OR 
                    Q5_41B EQ 995 OR Q5_41C EQ -1 OR Q5_41C EQ -2 OR Q5_41C EQ 995 OR 
                    Q5_41D EQ -1 OR Q5_41D EQ -2 OR Q5_41D EQ 995))
COMPUTE HRACTT= Q5_43B
ELSE IF ((Q5_41A NE -4 AND Q5_41A NE -1 AND Q5_41A NE -2 AND Q5_41A NE 995) AND 
                    (Q5_43A NE -1 AND Q5_43A NE -2 AND Q5_43A NE 995 AND Q5_43A NE -4)) 
COMPUTE HRACTT= Q5_41A+Q5_43A
ELSE IF ((Q5_41A NE -4 AND Q5_41A NE -1 AND Q5_41A NE -2 AND Q5_41A NE 995) AND 
                    (Q5_43B NE -1 AND Q5_43B NE -2 AND Q5_43B NE 995 AND Q5_43B NE -4)) 
COMPUTE HRACTT= Q5_41A+Q5_43B
ELSE IF ((Q5_41B NE -4 AND Q5_41B NE -1 AND Q5_41B NE -2 AND Q5_41B NE 995) AND 
                    (Q5_43A NE -1 AND Q5_43A NE -2 AND Q5_43A NE 995 AND Q5_43A NE -4)) 
COMPUTE HRACTT= Q5_41B+ Q5_43A
ELSE IF ((Q5_41B NE -4 AND Q5_41B NE -1 AND Q5_41B NE -2 AND Q5_41B NE 995) AND 
                    (Q5_43B NE -1 AND Q5_43B NE -2 AND Q5_43B NE 995 AND Q5_43B NE -4)) 
COMPUTE HRACTT= Q5_41B+ Q5_43B
ELSE IF ((Q5_41C NE -4 AND Q5_41C NE -1 AND Q5_41C NE -2 AND Q5_41C NE 995) AND 
                    (Q5_43A NE -1 AND Q5_43A NE -2 AND Q5_43A NE 995 AND Q5_43A NE -4)) 
COMPUTE HRACTT= Q5_41C+ Q5_43A
ELSE IF ((Q5_41C NE -4 AND Q5_41C NE -1 AND Q5_41C NE -2 AND Q5_41C NE 995) AND 
                    (Q5_43B NE -1 AND Q5_43B NE -2 AND Q5_43B NE 995 AND Q5_43B NE -4)) 
COMPUTE HRACTT= Q5_41C Q5_43B
ELSE IF ((Q5_41D NE -4 AND Q5_41D NE -1 AND Q5_41D NE -2 AND Q5_41D NE 995) AND 
                    (Q5_43A NE -1 AND Q5_43A NE -2 AND Q5_43A NE 995 AND Q5_43A NE -4)) 
COMPUTE HRACTT= Q5_41D+ Q5_43A
ELSE IF ((Q5_41D NE -4 AND Q5_41D NE -1 AND Q5_41D NE -2 AND Q5_41D NE 995) AND 
                    (Q5_43B NE -1 AND Q5_43B NE -2 AND Q5_43B NE 995 AND Q5_43B NE -4)) 
COMPUTE HRACTT= Q5_41D+ Q5_43B
ELSE IF ((Q5_41A NE -4 AND Q5_41A NE -1 AND Q5_41A NE -2 AND Q5_41A NE 995) AND 
                    Q5_43A EQ -4 AND Q5_43B EQ -4)
COMPUTE HRACTT= Q5_41A
ELSE IF ((Q5_41B NE -4 AND Q5_41B NE -1 AND Q5_41B NE -2 AND Q5_41B NE 995) AND 
                    Q5_43A EQ -4 AND Q5_43B EQ -4)
COMPUTE HRACTT= Q5_41B
ELSE IF ((Q5_41C NE -4 AND Q5_41C NE -1 AND Q5_41C NE -2 AND Q5_41C NE 995) AND 
                    Q5_43A EQ -4 AND Q5_43B EQ -4)
COMPUTE HRACTT= Q5_41C
ELSE IF ((Q5_41D NE -4 AND Q5_41D NE -1 AND Q5_41D NE -2 AND Q5_41D NE 995) AND 
                    Q5_43A EQ -4 AND Q5_43B EQ -4)
COMPUTE HRACTT= Q5_41D
ELSE IF ((Q5_41A EQ -1 OR Q5_41A EQ -2 OR Q5_41B EQ -1 OR Q5_41B EQ -2 OR Q5_41C EQ -1 OR
                    Q5_41C EQ -2 OR Q5_41D EQ -1 OR Q5_41D EQ -2) AND Q5_43A EQ -4 AND Q5_43B EQ -4)
COMPUTE HRACTT=-2
ELSE IF ((Q5_41A EQ 995 OR Q5_41B EQ 995 OR Q5_41C EQ 995 OR Q5_41D EQ 995) AND 
                    Q5_43A EQ -4 AND Q5_43B EQ -4)
COMPUTE HRACTT=995
ELSE 
COMPUTE HRACTT=-3
END IF
 
/* the following lines creates the var BUS2 */
DO IF (R(52322.) EQ -4)
COMPUTE BUS2=-4
ELSE IF (R(52322.) EQ -1)
COMPUTE BUS2=-1
ELSE IF (R(52322.) EQ -2)
COMPUTE BUS2=-2
ELSE IF (R(52323.) EQ -1 OR R(52324.) EQ -1)
COMPUTE BUS2=-1
ELSE IF (R(52323.) EQ -2 OR R(52324.) EQ -2)
COMPUTE BUS2=-2
ELSE IF (R(52323.) EQ 1 OR R(52324.) EQ 1)
COMPUTE BUS2=1
ELSE IF (R(52324.) EQ 0)
COMPUTE BUS2=2  /* this should normally be 0 */
ELSE 
COMPUTE BUS2=-3
END IF
 
/* the following lines create the var HRUSL1 */
DO IF (Q5BCK2_25 EQ -4)
COMPUTE HRUSL1=-4
ELSE IF (Q5BCK2_26A EQ -1 OR Q5BCK2_26C EQ -1 OR Q5BCK2_26A EQ -2 OR Q5BCK2_26C EQ -2)
COMPUTE HRUSL1=-2
ELSE IF (Q5BCK2_26A EQ 995 OR Q5BCK2_26C EQ 995)
COMPUTE HRUSL1=995
ELSE IF (Q5BCK2_26A EQ 1)
COMPUTE HRUSL1=Q5B2_26B
ELSE IF (Q5BCK2_26C EQ 1)
COMPUTE HRUSL1=Q5B2_26D
ELSE IF (R(52486.) EQ -4)
COMPUTE HRUSL1=-4
ELSE IF (Q5B_26A EQ -1 OR R(52487.) EQ -1 OR Q5B_26A EQ -2 OR R(52487.) EQ -2)
COMPUTE HRUSL1=-2
ELSE IF (Q5B_26A EQ 995 OR R(52487.) EQ 995)
COMPUTE HRUSL1=995
ELSE IF (Q5B_26A EQ 1)
COMPUTE HRUSL1=Q5B_26B
ELSE IF (R(52487.) EQ 1)
COMPUTE HRUSL1=R(52488.)
ELSE IF (R(52360.) EQ -4)
COMPUTE HRUSL1=-4
ELSE IF (R(52361.) EQ -1 OR R(52363.) EQ -1 OR R(52361.) EQ -2 OR R(52363.) EQ -2)
COMPUTE HRUSL1=-2
ELSE IF (R(52361.) EQ 995 OR R(52363.) EQ 995)
COMPUTE HRUSL1=995
ELSE IF (R(52361.) EQ 1)
COMPUTE HRUSL1=R(52362.)
ELSE IF (R(52363.) EQ 1)
COMPUTE HRUSL1=R(52364.)
ELSE 
COMPUTE HRUSL1=-3
END IF
 
/* the following lines create the var HRUSL2 */
DO IF (Q5B2_28A EQ -4)
COMPUTE HRUSL2=-4
ELSE IF (Q5B2_28B EQ -1 OR Q5B2_28D EQ -1 OR Q5B2_28B EQ -2 OR Q5B2_28D EQ -2)
COMPUTE HRUSL2=-2
ELSE IF (Q5B2_28B EQ 995 OR Q5B2_28D EQ 995)
COMPUTE HRUSL2=995
ELSE IF (Q5B2_28B EQ 1)
COMPUTE HRUSL2=Q5B2_28C
ELSE IF (Q5B2_28D EQ 1)
COMPUTE HRUSL2=Q5B2_28E
ELSE IF (Q5B_28A EQ -4)
COMPUTE HRUSL2=-4
ELSE IF (Q5B_28B EQ -1 OR Q5B_28D EQ -1 OR Q5B_28B EQ -2 OR Q5B_28D EQ -2)
COMPUTE HRUSL2=-2
ELSE IF (Q5B_28B EQ 995 OR Q5B_28D EQ 995)
COMPUTE HRUSL2=995
ELSE IF (Q5B_28B EQ 1)
COMPUTE HRUSL2=Q5B_28C
ELSE IF (Q5B_28D EQ 1)
COMPUTE HRUSL2=Q5B_28E
ELSE IF (R(52366.) EQ -4)
COMPUTE HRUSL2=-4
ELSE IF (R(52367.) EQ -1 OR R(52369.) EQ -1 OR R(52367.) EQ -2 OR R(52369.) EQ -2)
COMPUTE HRUSL2=-2
ELSE IF (R(52367.) EQ 995 OR R(52369.) EQ 995)
COMPUTE HRUSL2=995
ELSE IF (R(52367.) EQ 1)
COMPUTE HRUSL2=Q5_28C
ELSE IF (R(52369.) EQ 1)
COMPUTE HRUSL2=Q5_28E
ELSE 
COMPUTE HRUSL2=-3
END IF 
 
/* the following lines create the var HRUSLT */
DO IF (Q5BCK2_25 EQ -4)
COMPUTE HRUSLT=-4
ELSE IF ((Q5BCK2_26A EQ -1 OR Q5BCK2_26C EQ -1 OR Q5BCK2_26A EQ -2 OR Q5BCK2_26C EQ -2) AND 
                    (Q5B2_28B EQ -1 OR Q5B2_28D EQ -1 OR Q5B2_28B EQ -2 OR Q5B2_28D EQ -2))
COMPUTE HRUSLT=-2
ELSE IF ((Q5BCK2_26A EQ 995 OR Q5BCK2_26C EQ 995) AND (Q5B2_28B EQ 995 OR Q5B2_28D EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((Q5BCK2_26A EQ -1 OR Q5BCK2_26C EQ -1 OR Q5BCK2_26A EQ -2 OR Q5BCK2_26C EQ -2) AND 
                    (Q5B2_28B EQ 995 OR Q5B2_28D EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((Q5BCK2_26A EQ 995 OR Q5BCK2_26C EQ 995) AND (Q5B2_28B EQ -1 OR Q5B2_28D EQ -1 OR 
                    Q5B2_28B EQ -2 OR Q5B2_28D EQ -2))
COMPUTE HRUSLT=995
ELSE IF ((Q5BCK2_26A EQ 995 OR Q5BCK2_26C EQ 995) AND Q5B2_27 NE 1)
COMPUTE HRUSLT=995
ELSE IF ((Q5BCK2_26A EQ -1 OR Q5BCK2_26C EQ -1 OR Q5BCK2_26A EQ -2 OR Q5BCK2_26C EQ -2) AND Q5B2_27 NE 1)
COMPUTE HRUSLT=-2
ELSE IF (Q5BCK2_26A EQ 1 AND (Q5B2_28B EQ -1 OR Q5B2_28B EQ -2 OR Q5B2_28B EQ 995 OR 
                    Q5B2_28D EQ -1 OR Q5B2_28D EQ -2 OR Q5B2_28D EQ 995))
COMPUTE HRUSLT=Q5B2_26B
ELSE IF (Q5BCK2_26C EQ 1 AND (Q5B2_28B EQ -1 OR Q5B2_28B EQ -2 OR Q5B2_28B EQ 995 OR 
                    Q5B2_28D EQ -1 OR Q5B2_28D EQ -2 OR Q5B2_28D EQ 995))
COMPUTE HRUSLT=Q5B2_26D
ELSE IF (Q5B2_28B EQ 1 AND (Q5BCK2_26A EQ -1 OR Q5BCK2_26A EQ -2 OR Q5BCK2_26A EQ 995 OR 
                    Q5BCK2_26C EQ -1 OR Q5BCK2_26C EQ -2 OR Q5BCK2_26C EQ 995))
COMPUTE HRUSLT=Q5B2_28C
ELSE IF (Q5B2_28D EQ 1 AND (Q5BCK2_26A EQ -1 OR Q5BCK2_26A EQ -2 OR Q5BCK2_26A EQ 995 OR 
                    Q5BCK2_26C EQ -1 OR Q5BCK2_26C EQ -2 OR Q5BCK2_26C EQ 995))
COMPUTE HRUSLT=Q5B2_28E
ELSE IF (Q5BCK2_26A EQ 1 AND Q5B2_27 NE 1)
COMPUTE HRUSLT=Q5B2_26B
ELSE IF (Q5BCK2_26C EQ 1 AND Q5B2_27 NE 1)
COMPUTE HRUSLT=Q5B2_26D
ELSE IF (Q5BCK2_26A EQ 1 AND Q5B2_28B EQ 1)
COMPUTE HRUSLT=Q5B2_26B+Q5B2_28C
ELSE IF (Q5BCK2_26A EQ 1 AND Q5B2_28D EQ 1)
COMPUTE HRUSLT=Q5B2_26B+Q5B2_28E
ELSE IF (Q5BCK2_26C EQ 1 AND Q5B2_28B EQ 1)
COMPUTE HRUSLT=Q5B2_26D+Q5B2_28C
ELSE IF (Q5BCK2_26C EQ 1 AND Q5B2_28D EQ 1)
COMPUTE HRUSLT= Q5BCK2_26C+Q5B2_28E
ELSE IF (R(52486.) EQ -4)
COMPUTE HRUSLT=-4
ELSE IF ((Q5B_26A EQ -1 OR R(52487.) EQ -1 OR Q5B_26A EQ -2 OR R(52487.) EQ -2) AND 
                    (Q5B_28B EQ -1 OR Q5B_28D EQ -1 OR Q5B_28B EQ -2 OR Q5B_28D EQ -2))
COMPUTE HRUSLT=-2
ELSE IF ((Q5B_26A EQ 995 OR R(52487.) EQ 995) AND (Q5B_28B EQ 995 OR Q5B_28D EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((Q5B_26A EQ -1 OR R(52487.) EQ -1 OR Q5B_26A EQ -2 OR R(52489.) EQ -2) AND 
                    (Q5B_28B EQ 995 OR Q5B_28D EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((Q5B_26A EQ 995 OR R(52487.) EQ 995) AND (Q5B_28B EQ -1 OR Q5B_28D EQ -1 OR 
                    Q5B_28B EQ -2 OR Q5B_28D EQ -2))
COMPUTE HRUSLT=995
ELSE IF ((Q5B_26A EQ 995 OR R(52487.) EQ 995) AND R(52489.) NE 1)
COMPUTE HRUSLT=995
ELSE IF ((Q5B_26A EQ -1 OR R(52487.) EQ -1 OR Q5B_26A EQ -2 OR R(52487.) EQ -2) AND R(52489.) NE 1)
COMPUTE HRUSLT=-2
ELSE IF (Q5B_26A EQ 1 AND (Q5B_28B EQ -1 OR Q5B_28B EQ -2 OR Q5B_28B EQ 995 OR 
                    Q5B_28D EQ -1 OR Q5B_28D EQ -2 OR Q5B_28D EQ 995))
COMPUTE HRUSLT=Q5B_26B
ELSE IF (R(52487.) EQ 1 AND (Q5B_28B EQ -1 OR Q5B_28B EQ -2 OR Q5B_28B EQ 995 OR 
                    Q5B_28D EQ -1 OR Q5B_28D EQ -2 OR Q5B_28D EQ 995))
COMPUTE HRUSLT=R(52488.)
ELSE IF (Q5B_28B EQ 1 AND (Q5B_26A EQ -1 OR Q5B_26A EQ -2 OR Q5B_26A EQ 995 OR 
                    R(52487.) EQ -1 OR R(52487.) EQ -2 OR R(52487.) EQ 995))
COMPUTE HRUSLT=Q5B_28C
ELSE IF (Q5B_28D EQ 1 AND (Q5B_26A EQ -1 OR Q5B_26A EQ -2 OR Q5B_26A EQ 995 OR 
                    R(52487.) EQ -1 OR R(52487.) EQ -2 OR R(52487.) EQ 995))
COMPUTE HRUSLT=Q5B_28E
ELSE IF (Q5B_26A EQ 1 AND R(52489.) NE 1)
COMPUTE HRUSLT=Q5B_26B
ELSE IF (R(52487.) EQ 1 AND R(52489.) NE 1)
COMPUTE HRUSLT=R(52488.)
ELSE IF (Q5B_26A EQ 1 AND Q5B_28B EQ 1)
COMPUTE HRUSLT=Q5B_26B+Q5B_28C
ELSE IF (Q5B_26A EQ 1 AND Q5B_28D EQ 1)
COMPUTE HRUSLT=Q5B_26B+Q5B_28E
ELSE IF (R(52487.) EQ 1 AND Q5B_28B EQ 1)
COMPUTE HRUSLT=R(52488.)+Q5B_28C
ELSE IF (R(52487.) EQ 1 AND Q5B_28D EQ 1)
COMPUTE HRUSLT=R(52487.)+Q5B_28E
ELSE IF (R(52360.) EQ -4)
COMPUTE HRUSLT=-4
ELSE IF ((R(52361.) EQ -1 OR R(52363.) EQ -1 OR R(52361.) EQ -2 OR R(52363.) EQ -2) AND 
                    (R(52367.) EQ -1 OR R(52369.) EQ -1 OR R(52367.) EQ -2 OR R(52369.) EQ -2))
COMPUTE HRUSLT=-2
ELSE IF ((R(52361.) EQ 995 OR R(52363.) EQ 995) AND (R(52367.) EQ 995 OR R(52369.) EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((R(52361.) EQ -1 OR R(52363.) EQ -1 OR R(52361.) EQ -2 OR R(52363.) EQ -2) AND 
                    (R(52367.) EQ 995 OR R(52369.) EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((R(52361.) EQ 995 OR R(52363.) EQ 995) AND (R(52367.) EQ -1 OR R(52369.) EQ -1 OR 
                    R(52367.) EQ -2 OR R(52369.) EQ -2))
COMPUTE HRUSLT=995
ELSE IF ((R(52361.) EQ 995 OR R(52363.) EQ 995) AND R(52365.) NE 1)
COMPUTE HRUSLT=995
ELSE IF ((R(52361.) EQ -1 OR R(52363.) EQ -1 OR R(52361.) EQ -2 OR R(52363.) EQ -2) AND R(52365.) NE 1)
COMPUTE HRUSLT=-2
ELSE IF (R(52361.) EQ 1 AND (R(52367.) EQ -1 OR R(52367.) EQ -2 OR R(52367.) EQ 995 OR 
                    R(52369.) EQ -1 OR R(52369.) EQ -2 OR R(52369.) EQ 995))
COMPUTE HRUSLT=R(52362.)
ELSE IF (R(52363.) EQ 1 AND (R(52367.) EQ -1 OR R(52367.) EQ -2 OR R(52367.) EQ 995 OR 
                    R(52369.) EQ -1 OR R(52369.) EQ -2 OR R(52369.) EQ 995))
COMPUTE HRUSLT=R(52364.)
ELSE IF (R(52367.) EQ 1 AND (R(52361.) EQ -1 OR R(52361.) EQ -2 OR R(52361.) EQ 995 OR 
                    R(52363.) EQ -1 OR R(52363.) EQ -2 OR R(52363.) EQ 995))
COMPUTE HRUSLT=R(52368.)
ELSE IF (R(52369.) EQ 1 AND (R(52361.) EQ -1 OR R(52361.) EQ -2 OR R(52361.) EQ 995 OR 
                    R(52363.) EQ -1 OR R(52363.) EQ -2 OR R(52363.) EQ 995))
COMPUTE HRUSLT=R(52370.)
ELSE IF (R(52361.) EQ 1 AND R(52365.) NE 1)
COMPUTE HRUSLT=R(52362.)
ELSE IF (R(52363.) EQ 1 AND R(52365.) NE 1)
COMPUTE HRUSLT=R(52364.)
ELSE IF (R(52361.) EQ 1 AND R(52367.) EQ 1)
COMPUTE HRUSLT=R(52362.)+R(52368.)
ELSE IF (R(52361.) EQ 1 AND R(52369.) EQ 1)
COMPUTE HRUSLT=R(52362.)+R(52370.)
ELSE IF (R(52363.) EQ 1 AND R(52367.) EQ 1)
COMPUTE HRUSLT=R(52364.)+R(52368.)
ELSE IF (R(52363.) EQ 1 AND R(52369.) EQ 1)
COMPUTE HRUSLT=R(52363.)+R(52370.)
ELSE 
COMPUTE HRUSLT=-3
END IF
 
/* the following lines create the var HRFTPT */
DO IF (Q5B2_30C EQ -4)
COMPUTE HRFTPT=-4
ELSE IF (Q5B2_30F EQ -1 OR Q5B2_30G EQ -1 OR Q5B2_30H EQ -1 OR Q5B2_30I EQ -1)
COMPUTE HRFTPT=-1
ELSE IF (Q5B2_30F EQ -2 OR Q5B2_30G EQ -2 OR Q5B2_30H EQ -2 OR Q5B2_30I EQ -2)
COMPUTE HRFTPT=-2
ELSE IF (Q5B2_30F NE -4)
COMPUTE HRFTPT=Q5B2_30F
ELSE IF (Q5B2_30G NE -4)
COMPUTE HRFTPT=Q5B2_30G
ELSE IF (Q5B2_30H NE -4)
COMPUTE HRFTPT=Q5B2_30H
ELSE IF (Q5B2_30I NE -4)
COMPUTE HRFTPT=Q5B2_30I
ELSE IF (Q5B_30C EQ -4)
COMPUTE HRFTPT=-4
ELSE IF (Q5B_30F EQ -1 OR Q5B_30G EQ -1 OR Q5B_30H EQ -1 OR Q5B_30I EQ -1)
COMPUTE HRFTPT=-1
ELSE IF (Q5B_30F EQ -2 OR Q5B_30G EQ -2 OR Q5B_30H EQ -2 OR Q5B_30I EQ -2)
COMPUTE HRFTPT=-2
ELSE IF (Q5B_30F NE -4)
COMPUTE HRFTPT=Q5B_30F
ELSE IF (Q5B_30G NE -4)
COMPUTE HRFTPT=Q5B_30G
ELSE IF (Q5B_30H NE -4)
COMPUTE HRFTPT=Q5B_30H
ELSE IF (Q5B_30I NE -4)
COMPUTE HRFTPT=Q5B_30I
ELSE IF (R(52381.) EQ -4)
COMPUTE HRFTPT=-4
ELSE IF (Q5_30F EQ -1 OR R(52384.) EQ -1 OR R(52385.) EQ -1 OR R(52386.) EQ -1)
COMPUTE HRFTPT=-1
ELSE IF (Q5_30F EQ -2 OR R(52384.) EQ -2 OR R(52385.) EQ -2 OR R(52386.) EQ -2)
COMPUTE HRFTPT=-2
ELSE IF (Q5_30F NE -4)
COMPUTE HRFTPT=Q5_30F
ELSE IF (R(52384.) NE -4)
COMPUTE HRFTPT=R(52384.)
ELSE IF (R(52385.) NE -4)
COMPUTE HRFTPT=R(52385.)
ELSE IF (R(52386.) NE -4)
COMPUTE HRFTPT=R(52386.)
ELSE
COMPUTE HRFTPT=-3
END IF 
 
/* the following lines create the var HRWANT */
DO IF (Q5B2_33 NE -4)
COMPUTE HRWANT=Q5B2_33
ELSE IF (Q5B_33 NE -4)
COMPUTE HRWANT=Q5B_33
ELSE 
COMPUTE HRWANT=R(52397.)
END IF
 
/* the following lines create the var HRRSN1 */
DO IF (Q5B2_34 NE -4)
COMPUTE HRRSN1=Q5B2_34
ELSE IF (Q5B_34 NE -4)
COMPUTE HRRSN1=Q5B_34
ELSE
COMPUTE HRRSN1=R(52398.)
END IF
 
/* the following lines create the var HRCK7 */
COMPUTE HRCK7=-4
DO IF ((BUS2 EQ 2 OR BUS2 EQ -2 OR BUS2 EQ -1) AND (HRACT1 LT 15 OR HRACT1 EQ -2))
COMPUTE HRCK7=1
ELSE IF ((BUS2 EQ 2 OR BUS2 EQ -2 OR BUS2 EQ -1) AND HRACT1 GE 15)
COMPUTE HRCK7=2
ELSE IF ((HRUSLT GE 35 OR HRFTPT EQ 1) AND HRACTT LT 35 AND (HRACT1 NE -1 OR 
                    HRACT1 NE -2 OR HRACT2 NE -1 OR HRACT2 NE -2)) 
COMPUTE HRCK7=3
ELSE IF (HRWANT EQ 1 AND HRACTT LT 35 AND (HRRSN1 EQ 1 OR HRRSN1 EQ 2 OR HRRSN1 EQ 3))
COMPUTE HRCK7=4
ELSE 
COMPUTE HRCK7=5
END IF 
 
/* the following lines create the var ABSOT */
DO IF (HRACT1 EQ 0 AND HRACT2 EQ 0)
COMPUTE ABSOT=1
ELSE
COMPUTE ABSOT=0
END IF
 
/* the following lines create the var HRCK6 */
COMPUTE HRCK6=-4
DO IF ((HRACT1 EQ 0 AND HRACT2 EQ 0) AND (BUS2 EQ 2 OR BUS2 EQ -1 OR BUS2 EQ -2))
COMPUTE HRCK6=1
ELSE IF (ABSOT EQ 1)
COMPUTE HRCK6=2
ELSE 
COMPUTE HRCK6=3
END IF
 
/* the following lines create the var WK */
COMPUTE WK=-4
DO IF (R(52318.) NE -4)
COMPUTE WK=R(52318.)
ELSE IF (R(52319.) NE -4)
COMPUTE WK=R(52319.)
END IF
 
/* the following lines create the var RETOT */
DO IF (WK EQ 3)
COMPUTE RETOT=1
ELSE
COMPUTE RETOT=0
END IF
 
/* the following lines rename the vars */
COMPUTE BUS1=R(52321.)
COMPUTE RET1=R(52335.)
COMPUTE IO1COW=R(52314.)
COMPUTE NLFACT=R(52578.)
 
/* the following lines create additional variables */
 
DO IF (Q5B2_22 NE -4)
COMPUTE ABSPD=Q5B2_22
ELSE IF (R(52481.) NE -4)
COMPUTE ABSPD=R(52481.)
ELSE
COMPUTE ABSPD=R(52354.)
END IF
 
DO IF (Q5B2_65 NE -4)
COMPUTE LKAVL=Q5B2_65
ELSE IF (R(52515.) NE -4)
COMPUTE LKAVL=R(52515.)
ELSE
COMPUTE LKAVL=R(52437.)
END IF
 
DO IF (Q5B2_51 NE -4)
COMPUTE LAYAVL=Q5B2_51
ELSE IF (Q5B_51 NE -4)
COMPUTE LAYAVL=Q5B_51
ELSE
COMPUTE LAYAVL=R(52410.)
END IF
 
DO IF (Q5B2_66 NE -4)
COMPUTE LKAVR=Q5B2_66
ELSE IF (Q5B_66 NE -4)
COMPUTE LKAVR=Q5B_66
ELSE
COMPUTE LKAVR=R(45540.)
END IF
 
DO IF (Q5B2_52 NE -4)
COMPUTE LAYAVR=Q5B2_52
ELSE IF (Q5B_52 NE -4)
COMPUTE LAYAVR=Q5B_52
ELSE
COMPUTE LAYAVR=R(52411.)
END IF
 
DO IF (Q5B2_60 NE -4)
COMPUTE LK=Q5B2_60
ELSE IF (R(52503.) NE -4)
COMPUTE LK=R(52503.)
ELSE
COMPUTE LK=R(52420.)
END IF
 
DO IF (Q5B2_11 NE -4)
COMPUTE DIS1=Q5B2_11
ELSE IF (R(52455.) NE -4)
COMPUTE DIS1=R(52455.)
ELSE
COMPUTE DIS1=R(52336.)
END IF
 
DO IF (Q5B2_12 NE -4)
COMPUTE DIS2=Q5B2_12
ELSE IF (R(52456.) NE -4)
COMPUTE DIS2=R(52456.)
ELSE
COMPUTE DIS2=R(52337.)
END IF
 
/* the following lines create the var DWWNTO */
DO IF (RET1 EQ 1)
COMPUTE DWWNTO=1
 
ELSE IF (Q5B2_78 EQ 1)
COMPUTE DWWNTO=1
ELSE IF (Q5B2_78 EQ 0)
COMPUTE DWWNTO=2
ELSE IF (Q5B2_78 EQ -2)
COMPUTE DWWNTO=-2
ELSE IF (Q5B2_78 EQ -1)
COMPUTE DWWNTO=-1
ELSE IF (Q5B2_78 EQ 3)
COMPUTE DWWNTO=3
ELSE IF (Q5B2_78 EQ 4)
COMPUTE DWWNTO=4
ELSE IF (Q5BCK_78 EQ 1)
COMPUTE DWWNTO=1
ELSE IF (Q5BCK_78 EQ 0)
COMPUTE DWWNTO=2
ELSE IF (Q5BCK_78 EQ -2)
COMPUTE DWWNTO=-2
ELSE IF (Q5BCK_78 EQ -1)
COMPUTE DWWNTO=-1
ELSE IF (Q5BCK_78 EQ 3)
COMPUTE DWWNTO=3
ELSE IF (Q5BCK_78 EQ 4)
COMPUTE DWWNTO=4
ELSE IF (Q5_78 EQ 1)
COMPUTE DWWNTO=1
ELSE IF (Q5_78 EQ 0)
COMPUTE DWWNTO=2
ELSE IF (Q5_78 EQ -2)
COMPUTE DWWNTO=-2
ELSE IF (Q5_78 EQ -1)
COMPUTE DWWNTO=-1
ELSE IF (Q5_78 EQ 3)
COMPUTE DWWNTO=3
ELSE IF (Q5_78 EQ 4)
COMPUTE DWWNTO=4
ELSE
COMPUTE DWWNTO=-3
END IF
 
/* the following lines create the var DIS */
DO IF (Q5_9A4 EQ -4)
COMPUTE DIS=-4
ELSE IF (Q5_9D EQ -1 OR Q5_9E EQ -1 OR Q5_9F EQ -1 OR Q5_9G EQ -1) OR (Q5_9D EQ -2 OR 
                    Q5_9E EQ -2 OR Q5_9F EQ -2 OR Q5_9G EQ -2)
COMPUTE DIS=-2
ELSE IF (Q5_9A4 EQ 1 AND Q5_9D EQ 1)
COMPUTE DIS=1
ELSE IF (Q5_9D EQ 0)
COMPUTE DIS=0
ELSE IF (Q5_9A5 EQ 1 AND Q5_9E EQ 1)
COMPUTE DIS=1
ELSE IF (Q5_9E EQ 0)
COMPUTE DIS=0
ELSE IF (Q5_9A6 EQ 1 AND Q5_9F EQ 1)
COMPUTE DIS=1
ELSE IF (Q5_9F EQ 0)
COMPUTE DIS=0
ELSE IF (Q5_9A7 EQ 1 AND Q5_9G EQ 1)
COMPUTE DIS=1
ELSE IF (Q5_9G EQ 0)
COMPUTE DIS=0
ELSE 
COMPUTE DIS=-3
END IF
 
/* the following lines create IO1COW */
DO IF (R(52314.) EQ 1)
COMPUTE IO1COW=8
ELSE
COMPUTE IO1COW=0
END IF
 
/* the following lines create the ESR var approximating MLR */
DO IF ((WK EQ 1 AND (HRCK6 EQ 3 OR HRCK6 EQ -4 OR HRCK6 EQ 99 OR HRCK6 EQ 999)) OR 
                    (BUS1 EQ 1 AND (HRCK7 EQ 2 OR HRCK7 EQ 3 OR HRCK7 EQ 4 OR HRCK7 EQ 5 OR 
                    HRCK7 EQ -4)))
COMPUTE ESR=1
ELSE IF (ABSPD EQ 1 OR ABSPD EQ 0 OR ABSPD EQ -1 OR ABSPD EQ -2)
COMPUTE ESR=2
ELSE IF ((LAYAVL EQ 1 OR LAYAVL EQ -1 OR LAYAVL EQ -2) OR LAYAVR EQ 1)
COMPUTE ESR=3
ELSE IF ((LKAVL EQ 1 OR LKAVL EQ -1 OR LKAVL EQ -2) OR (LKAVR EQ 1 OR LKAVR EQ 2))
COMPUTE ESR=4
ELSE IF ((WK EQ 3 AND AGE GE 50 AND RET1 EQ 1 AND LK EQ 1 AND LKAVL EQ 0 AND 
                    (LKAVR EQ 3 OR LKAVR EQ 4 OR LKAVR EQ -1 OR LKAVR EQ -2)) OR             (RET1 EQ 0 OR 
                    LK EQ 3 OR DWWNTO EQ 3) OR NLFACT EQ 5 OR RETOT EQ 1) 
COMPUTE ESR=5
ELSE IF (DIS1 EQ 1 OR DIS2 EQ 1 OR DIS EQ 1)
COMPUTE ESR=6
ELSE IF (R(52314.) EQ 1)
COMPUTE ESR=8
ELSE
COMPUTE ESR=7
END IF 
 
          ESR(6)=R(15199.);
          ESR(7)=R(18906.);
          ESR(8)=R(22577.);
          ESR(9)=R(24451.);
          ESR(10)=R(28706.);
          ESR(11)=R(30743.);
          ESR(12)=R(34010.);
          ESR(13)=R(36564.);
          ESR(14)=R(40069.);
          ESR(15)=R(44180.);
          ESR(16)=R(50810.);
          ESR(17)=R(51663.);
          ESRC(6)=R(15199.01);
          ESRC(7)=R(18906.01);
          ESRC(8)=R(22577.01);
          ESRC(9)=R(24451.01);
          ESRC(10)=R(28707.);
          ESRC(11)=R(30744.);
          ESRC(12)=R(34011.);
          EARC(13)=R(36565.);
          EARC(14)=R(40070.);
          ESRC(15)=R(44181.);
          ESRC(16)=R(50811.);
          ESRC(17)=R(51664.);

1998 VARIABLES

/* The programming for the new 1998 ESR variables is done in SPSS */
 
/* the following lines create the var AGE */
COMPUTE AGE=41
 
/* the following lines construct the var HRACT1 */
DO IF (Q5B2_40A EQ -4)
COMPUTE HRACT1=-4
ELSE IF (Q5B2_41A EQ -1 OR Q5B2_41B EQ -1 OR Q5B2_41C EQ -1 OR Q5B2_41D EQ -1
                     OR Q5B2_41A EQ -2 OR Q5B2_41B EQ -2 OR Q5B2_41C EQ -2 OR 
         Q5B2_41D EQ -2)
COMPUTE HRACT1=-2
ELSE IF (Q5B2_41A EQ 995 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ 995 OR 
         Q5B2_41D EQ 995)
COMPUTE HRACT1=995
ELSE IF (Q5B2_40B EQ 1 AND Q5B2_41A NE -4)
COMPUTE HRACT1=Q5B2_41A
ELSE IF (Q5B2_40C EQ 1 AND Q5B2_41B NE -4)
COMPUTE HRACT1=Q5B2_41B
ELSE IF (Q5B2_40D EQ 1 AND Q5B2_41C NE -4)
COMPUTE HRACT1=Q5B2_41C
ELSE IF (Q5B2_40E EQ 1 OR Q5B2_40E EQ 0)
COMPUTE HRACT1=Q5B2_41D
 
ELSE IF (Q5B_40A EQ -4)
COMPUTE HRACT1=-4
ELSE IF (Q5B_41A EQ -1 OR Q5B_41B EQ -1 OR Q5B_41C EQ -1 OR Q5B_41D EQ -1
                     OR Q5B_41A EQ -2 OR Q5B_41B EQ -2 OR Q5B_41C EQ -2 OR 
         Q5B_41D EQ -2)
COMPUTE HRACT1=-2
ELSE IF (Q5B_41A EQ 995 OR Q5B_41B EQ 995 OR Q5B_41C EQ 995 OR 
         Q5B_41D EQ 995)
COMPUTE HRACT1=995
ELSE IF (Q5B_40B EQ 1 AND Q5B_41A NE -4)
COMPUTE HRACT1=Q5B_41A
ELSE IF (Q5B_40C EQ 1 AND Q5B_41B NE -4)
COMPUTE HRACT1=Q5B_41B
ELSE IF (Q5B_40D EQ 1 AND Q5B_41C NE -4)
COMPUTE HRACT1=Q5B_41C
ELSE IF (Q5B_40E EQ 1 OR Q5B_40E EQ 0)
COMPUTE HRACT1=Q5B_41D
 
ELSE IF (Q5_40A EQ -4)
COMPUTE HRACT1=-4
ELSE IF (Q5_41A EQ -1 OR Q5_41B EQ -1 OR Q5_41C EQ -1 OR Q5_41D EQ -1
                     OR Q5_41A EQ -2 OR Q5_41B EQ -2 OR Q5_41C EQ -2 OR Q5_41D EQ -2)
COMPUTE HRACT1=-2
ELSE IF (Q5_41A EQ 995 OR Q5_41B EQ 995 OR Q5_41C EQ 995 OR Q5_41D EQ 995)
COMPUTE HRACT1=995
ELSE IF (Q5_40B EQ 1 AND Q5_41A NE -4)
COMPUTE HRACT1=Q5_41A
ELSE IF (Q5_40C EQ 1 AND Q5_41B NE -4)
COMPUTE HRACT1=Q5_41B
ELSE IF (Q5_40D EQ 1 AND Q5_41C NE -4)
COMPUTE HRACT1=Q5_41C
ELSE IF (Q5_40E EQ 1 OR Q5_40E EQ 0)
COMPUTE HRACT1=Q5_41D
ELSE
COMPUTE HRACT1=-3
END IF
 
/* the following lines construct the var HRACT2 */
DO IF (Q5B2_42 EQ -4 OR Q5B2_42 EQ 0)
COMPUTE HRACT2=-4
ELSE IF (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1
                    OR Q5B2_43A EQ -2 OR Q5B2_43B EQ -2)
COMPUTE HRACT2=-2
ELSE IF (Q5B2_43A EQ 995 OR Q5B2_43B EQ 995)
COMPUTE HRACT2=995
ELSE IF (Q5B2_43 EQ 1)
COMPUTE HRACT2=Q5B2_43A
ELSE IF (Q5B2_42 EQ 1 AND Q5B2_43 EQ 0)
COMPUTE HRACT2=Q5B2_43B
 
ELSE IF (Q5B_42 EQ -4 OR Q5B_42 EQ 0)
COMPUTE HRACT2=-4
ELSE IF (Q5B_43A EQ -1 OR Q5B_43B EQ -1
                    OR Q5B_43A EQ -2 OR Q5B_43B EQ -2)
COMPUTE HRACT2=-2
ELSE IF (Q5B_43A EQ 995 OR Q5B_43B EQ 995)
COMPUTE HRACT2=995
ELSE IF (Q5B_43 EQ 1)
COMPUTE HRACT2=Q5B_43A
ELSE IF (Q5B_42 EQ 1 AND Q5B_43 EQ 0)
COMPUTE HRACT2=Q5B_43B
 
ELSE IF (Q5_42 EQ -4 OR Q5_42 EQ 0)
COMPUTE HRACT2=-4
ELSE IF (Q5_43A EQ -1 OR Q5_43B EQ -1
                    OR Q5_43A EQ -2 OR Q5_43B EQ -2)
COMPUTE HRACT2=-2
ELSE IF (Q5_43A EQ 995 OR Q5_43B EQ 995)
COMPUTE HRACT2=995
ELSE IF (Q5_43 EQ 1)
COMPUTE HRACT2=Q5_43A
ELSE IF (Q5_42 EQ 1 AND Q5_43 EQ 0)
COMPUTE HRACT2=Q5_43B
ELSE 
COMPUTE HRACT2=-3
END IF
 
/* the following lines create the var HRACTT */
DO IF (Q5B2_40A EQ -4)
COMPUTE HRACTT=-4
ELSE IF ((Q5B2_41A EQ -1 OR Q5B2_41B EQ -1 OR Q5B2_41C EQ -1 OR 
        Q5B2_41D EQ -1 OR Q5B2_41A EQ -2 OR Q5B2_41B EQ -2 OR 
        Q5B2_41C EQ -2 OR Q5B2_41D EQ -2) AND (Q5B2_43A EQ -1 OR 
        Q5B2_43B EQ -1 OR Q5B2_43A EQ -2 OR Q5B2_43B EQ -2))
COMPUTE HRACTT=-2
ELSE IF ((Q5B2_41A EQ 995 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ 995 OR 
        Q5B2_41D EQ 995) AND (Q5B2_43A EQ 995 OR Q5B2_43B EQ 995))
COMPUTE HRACTT=995
ELSE IF ((Q5B2_41A EQ -1 OR Q5B2_41B EQ -1 OR Q5B2_41C EQ -1 OR 
        Q5B2_41D EQ -1 OR Q5B2_41A EQ -2 OR Q5B2_41B EQ -2 OR 
        Q5B2_41C EQ -2 OR Q5B2_41D EQ -2) AND (Q5B2_43A EQ 995 OR 
        Q5B2_43B EQ 995))
COMPUTE HRACTT=995
ELSE IF ((Q5B2_41A EQ 995 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ 995 OR 
        Q5B2_41D EQ 995 OR Q5B2_41A EQ 995 OR Q5B2_41B EQ 995 OR 
        Q5B2_41C EQ 995 OR Q5B2_41D EQ 995) AND (Q5B2_43A EQ -1 OR 
        Q5B2_43B EQ -1 OR Q5B2_43A EQ -2 OR Q5B2_43B EQ -2))
COMPUTE HRACTT=995
ELSE IF ((Q5B2_41A NE -4 AND Q5B2_41A NE -1 AND Q5B2_41A NE -2 AND 
        Q5B2_41A NE 995) AND (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1 OR 
        Q5B2_43A EQ -2 OR Q5B2_43B EQ -2 OR Q5B2_43A EQ 995 OR 
        Q5B2_43B EQ 995))
COMPUTE HRACTT=Q5B2_41A
ELSE IF ((Q5B2_41B NE -4 AND Q5B2_41B NE -1 AND Q5B2_41B NE -2 AND 
        Q5B2_41B NE 995) AND (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1 OR 
        Q5B2_43A EQ -2 OR Q5B2_43B EQ -2 OR Q5B2_43A EQ 995 OR 
        Q5B2_43B EQ 995))
COMPUTE HRACTT=Q5B2_41B
ELSE IF ((Q5B2_41C NE -4 AND Q5B2_41C NE -1 AND Q5B2_41C NE -2 AND 
        Q5B2_41C NE 995) AND (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1 OR 
        Q5B2_43A EQ -2 OR Q5B2_43B EQ -2 OR Q5B2_43A EQ 995 OR 
        Q5B2_43B EQ 995))
COMPUTE HRACTT=Q5B2_41C
ELSE IF ((Q5B2_41D NE -4 AND Q5B2_41D NE -1 AND Q5B2_41D NE -2 AND 
        Q5B2_41D NE 995) AND (Q5B2_43A EQ -1 OR Q5B2_43B EQ -1 OR 
        Q5B2_43A EQ -2 OR Q5B2_43B EQ -2 OR Q5B2_43A EQ 995 OR 
        Q5B2_43B EQ 995))
COMPUTE HRACTT=Q5B2_41D
ELSE IF ((Q5B2_43B NE -4 AND Q5B2_43A NE -1 AND Q5B2_43A NE -2 AND 
        Q5B2_43A NE 995) AND (Q5B2_41A EQ -1 OR Q5B2_41A EQ -2 OR 
        Q5B2_41A EQ 995 OR Q5B2_41B EQ -1 OR Q5B2_41B EQ -2 OR 
        Q5B2_41B EQ 995 OR Q5B2_41C EQ -1 OR Q5B2_41C EQ -2 OR 
        Q5B2_41C EQ 995 OR Q5B2_41D EQ -1 OR Q5B2_41D EQ -2 OR 
        Q5B2_41D EQ 995))
COMPUTE HRACTT=Q5B2_43A
ELSE IF ((Q5B2_43A NE -4 AND Q5B2_43B NE -1 AND Q5B2_43B NE -2 AND 
        Q5B2_43B NE 995) AND (Q5B2_41A EQ -1 OR Q5B2_41A EQ -2 OR 
        Q5B2_41A EQ 995 OR Q5B2_41B EQ -1 OR Q5B2_41B EQ -2 OR 
        Q5B2_41B EQ 995 OR Q5B2_41C EQ -1 OR Q5B2_41C EQ -2 OR 
        Q5B2_41C EQ 995 OR Q5B2_41D EQ -1 OR Q5B2_41D EQ -2 OR 
        Q5B2_41D EQ 995))
COMPUTE HRACTT=Q5B2_43B
ELSE IF ((Q5B2_41A NE -4 AND Q5B2_41A NE -1 AND Q5B2_41A NE -2 AND 
        Q5B2_41A NE 995) AND (Q5B2_43A NE -1 AND Q5B2_43A NE -2 AND 
        Q5B2_43A NE 995 AND Q5B2_43A NE -4)) 
COMPUTE HRACTT=Q5B2_41A+Q5B2_43A
ELSE IF ((Q5B2_41A NE -4 AND Q5B2_41A NE -1 AND Q5B2_41A NE -2 AND 
        Q5B2_41A NE 995) AND (Q5B2_43B NE -1 AND Q5B2_43B NE -2 AND 
        Q5B2_43B NE 995 AND Q5B2_43B NE -4)) 
COMPUTE HRACTT=Q5B2_41A+Q5B2_43B
ELSE IF ((Q5B2_41B NE -4 AND Q5B2_41B NE -1 AND Q5B2_41B NE -2 AND 
        Q5B2_41B NE 995) AND (Q5B2_43A NE -1 AND Q5B2_43A NE -2 AND 
        Q5B2_43A NE 995 AND Q5B2_43A NE -4)) 
COMPUTE HRACTT=Q5B2_41B+Q5B2_43A
ELSE IF ((Q5B2_41B NE -4 AND Q5B2_41B NE -1 AND Q5B2_41B NE -2 AND 
        Q5B2_41B NE 995) AND (Q5B2_43B NE -1 AND Q5B2_43B NE -2 AND 
        Q5B2_43B NE 995 AND Q5B2_43B NE -4)) 
COMPUTE HRACTT=Q5B2_41B+Q5B2_43B
ELSE IF ((Q5B2_41C NE -4 AND Q5B2_41C NE -1 AND Q5B2_41C NE -2 AND 
        Q5B2_41C NE 995) AND (Q5B2_43A NE -1 AND Q5B2_43A NE -2 AND 
        Q5B2_43A NE 995 AND Q5B2_43A NE -4)) 
COMPUTE HRACTT=Q5B2_41C+Q5B2_43A
ELSE IF ((Q5B2_41C NE -4 AND Q5B2_41C NE -1 AND Q5B2_41C NE -2 AND 
        Q5B2_41C NE 995) AND (Q5B2_43B NE -1 AND Q5B2_43B NE -2 AND 
        Q5B2_43B NE 995 AND Q5B2_43B NE -4)) 
COMPUTE HRACTT=Q5B2_41C+Q5B2_43B
ELSE IF ((Q5B2_41D NE -4 AND Q5B2_41D NE -1 AND Q5B2_41D NE -2 AND 
        Q5B2_41D NE 995) AND (Q5B2_43A NE -1 AND Q5B2_43A NE -2 AND 
        Q5B2_43A NE 995 AND Q5B2_43A NE -4)) 
COMPUTE HRACTT=Q5B2_41D+Q5B2_43A
ELSE IF ((Q5B2_41D NE -4 AND Q5B2_41D NE -1 AND Q5B2_41D NE -2 AND 
        Q5B2_41D NE 995) AND (Q5B2_43B NE -1 AND Q5B2_43B NE -2 AND 
        Q5B2_43B NE 995 AND Q5B2_43B NE -4)) 
COMPUTE HRACTT=Q5B2_41D+Q5B2_43B
ELSE IF ((Q5B2_41A NE -4 AND Q5B2_41A NE -1 AND Q5B2_41A NE -2 AND 
        Q5B2_41A NE 995) AND Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=Q5B2_41A
ELSE IF ((Q5B2_41B NE -4 AND Q5B2_41B NE -1 AND Q5B2_41B NE -2 AND 
        Q5B2_41B NE 995) AND Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=Q5B2_41B
ELSE IF ((Q5B2_41C NE -4 AND Q5B2_41C NE -1 AND Q5B2_41C NE -2 AND 
        Q5B2_41C NE 995) AND Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=Q5B2_41C
ELSE IF ((Q5B2_41D NE -4 AND Q5B2_41D NE -1 AND Q5B2_41D NE -2 AND 
        Q5B2_41D NE 995) AND Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=Q5B2_41D
ELSE IF ((Q5B2_41A EQ -1 OR Q5B2_41A EQ -2 OR Q5B2_41B EQ -1 OR Q5B2_41B EQ -2
                    OR Q5B2_41C EQ -1 OR Q5B2_41C EQ -2 OR Q5B2_41D EQ -1 OR 
        Q5B2_41D EQ -2) AND Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=-2
ELSE IF ((Q5B2_41A EQ 995 OR Q5B2_41B EQ 995 OR Q5B2_41C EQ 995 OR 
        Q5B2_41D EQ 995) AND Q5B2_43A EQ -4 AND Q5B2_43B EQ -4)
COMPUTE HRACTT=995
 
ELSE IF (Q5B_40A EQ -4)
COMPUTE HRACTT=-4
ELSE IF ((Q5B_41A EQ -1 OR Q5B_41B EQ -1 OR Q5B_41C EQ -1 OR 
        Q5B_41D EQ -1 OR Q5B_41A EQ -2 OR Q5B_41B EQ -2 OR 
        Q5B_41C EQ -2 OR Q5B_41D EQ -2) AND (Q5B_43A EQ -1 OR 
        Q5B_43B EQ -1 OR Q5B_43A EQ -2 OR Q5B_43B EQ -2))
COMPUTE HRACTT=-2
ELSE IF ((Q5B_41A EQ 995 OR Q5B_41B EQ 995 OR Q5B_41C EQ 995 OR 
        Q5B_41D EQ 995) AND (Q5B_43A EQ 995 OR Q5B_43B EQ 995))
COMPUTE HRACTT=995
ELSE IF ((Q5B_41A EQ -1 OR Q5B_41B EQ -1 OR Q5B_41C EQ -1 OR 
        Q5B_41D EQ -1 OR Q5B_41A EQ -2 OR Q5B_41B EQ -2 OR 
        Q5B_41C EQ -2 OR Q5B_41D EQ -2) AND (Q5B_43A EQ 995 OR 
        Q5B_43B EQ 995))
COMPUTE HRACTT=995
ELSE IF ((Q5B_41A EQ 995 OR Q5B_41B EQ 995 OR Q5B_41C EQ 995 OR 
        Q5B_41D EQ 995 OR Q5B_41A EQ 995 OR Q5B_41B EQ 995 OR 
        Q5B_41C EQ 995 OR Q5B_41D EQ 995) AND (Q5B_43A EQ -1 OR 
        Q5B_43B EQ -1 OR Q5B_43A EQ -2 OR Q5B_43B EQ -2))
COMPUTE HRACTT=995
ELSE IF ((Q5B_41A NE -4 AND Q5B_41A NE -1 AND Q5B_41A NE -2 AND 
        Q5B_41A NE 995) AND (Q5B_43A EQ -1 OR Q5B_43B EQ -1 OR 
        Q5B_43A EQ -2 OR Q5B_43B EQ -2 OR Q5B_43A EQ 995 OR 
        Q5B_43B EQ 995))
COMPUTE HRACTT=Q5B_41A
ELSE IF ((Q5B_41B NE -4 AND Q5B_41B NE -1 AND Q5B_41B NE -2 AND 
        Q5B_41B NE 995) AND (Q5B_43A EQ -1 OR Q5B_43B EQ -1 OR 
        Q5B_43A EQ -2 OR Q5B_43B EQ -2 OR Q5B_43A EQ 995 OR 
        Q5B_43B EQ 995))
COMPUTE HRACTT=Q5B_41B
ELSE IF ((Q5B_41C NE -4 AND Q5B_41C NE -1 AND Q5B_41C NE -2 AND 
        Q5B_41C NE 995) AND (Q5B_43A EQ -1 OR Q5B_43B EQ -1 OR 
        Q5B_43A EQ -2 OR Q5B_43B EQ -2 OR Q5B_43A EQ 995 OR 
        Q5B_43B EQ 995))
COMPUTE HRACTT=Q5B_41C
ELSE IF ((Q5B_41D NE -4 AND Q5B_41D NE -1 AND Q5B_41D NE -2 AND 
        Q5B_41D NE 995) AND (Q5B_43A EQ -1 OR Q5B_43B EQ -1 OR 
        Q5B_43A EQ -2 OR Q5B_43B EQ -2 OR Q5B_43A EQ 995 OR 
        Q5B_43B EQ 995))
COMPUTE HRACTT=Q5B_41D
ELSE IF ((Q5B_43B NE -4 AND Q5B_43A NE -1 AND Q5B_43A NE -2 AND 
        Q5B_43A NE 995) AND (Q5B_41A EQ -1 OR Q5B_41A EQ -2 OR 
        Q5B_41A EQ 995 OR Q5B_41B EQ -1 OR Q5B_41B EQ -2 OR 
        Q5B_41B EQ 995 OR Q5B_41C EQ -1 OR Q5B_41C EQ -2 OR 
        Q5B_41C EQ 995 OR Q5B_41D EQ -1 OR Q5B_41D EQ -2 OR 
        Q5B_41D EQ 995))
COMPUTE HRACTT=Q5B_43A
ELSE IF ((Q5B_43A NE -4 AND Q5B_43B NE -1 AND Q5B_43B NE -2 AND 
        Q5B_43B NE 995) AND (Q5B_41A EQ -1 OR Q5B_41A EQ -2 OR 
        Q5B_41A EQ 995 OR Q5B_41B EQ -1 OR Q5B_41B EQ -2 OR 
        Q5B_41B EQ 995 OR Q5B_41C EQ -1 OR Q5B_41C EQ -2 OR 
        Q5B_41C EQ 995 OR Q5B_41D EQ -1 OR Q5B_41D EQ -2 OR 
        Q5B_41D EQ 995))
COMPUTE HRACTT=Q5B_43B
ELSE IF ((Q5B_41A NE -4 AND Q5B_41A NE -1 AND Q5B_41A NE -2 AND 
        Q5B_41A NE 995) AND (Q5B_43A NE -1 AND Q5B_43A NE -2 AND 
        Q5B_43A NE 995 AND Q5B_43A NE -4)) 
COMPUTE HRACTT=Q5B_41A+Q5B_43A
ELSE IF ((Q5B_41A NE -4 AND Q5B_41A NE -1 AND Q5B_41A NE -2 AND 
        Q5B_41A NE 995) AND (Q5B_43B NE -1 AND Q5B_43B NE -2 AND 
        Q5B_43B NE 995 AND Q5B_43B NE -4)) 
COMPUTE HRACTT=Q5B_41A+Q5B_43B
ELSE IF ((Q5B_41B NE -4 AND Q5B_41B NE -1 AND Q5B_41B NE -2 AND 
        Q5B_41B NE 995) AND (Q5B_43A NE -1 AND Q5B_43A NE -2 AND 
        Q5B_43A NE 995 AND Q5B_43A NE -4)) 
COMPUTE HRACTT=Q5B_41B+Q5B_43A
ELSE IF ((Q5B_41B NE -4 AND Q5B_41B NE -1 AND Q5B_41B NE -2 AND 
        Q5B_41B NE 995) AND (Q5B_43B NE -1 AND Q5B_43B NE -2 AND 
        Q5B_43B NE 995 AND Q5B_43B NE -4)) 
COMPUTE HRACTT=Q5B_41B+Q5B_43B
ELSE IF ((Q5B_41C NE -4 AND Q5B_41C NE -1 AND Q5B_41C NE -2 AND 
        Q5B_41C NE 995) AND (Q5B_43A NE -1 AND Q5B_43A NE -2 AND 
        Q5B_43A NE 995 AND Q5B_43A NE -4)) 
COMPUTE HRACTT=Q5B_41C+Q5B_43A
ELSE IF ((Q5B_41C NE -4 AND Q5B_41C NE -1 AND Q5B_41C NE -2 AND 
        Q5B_41C NE 995) AND (Q5B_43B NE -1 AND Q5B_43B NE -2 AND 
        Q5B_43B NE 995 AND Q5B_43B NE -4)) 
COMPUTE HRACTT=Q5B_41C+Q5B_43B
ELSE IF ((Q5B_41D NE -4 AND Q5B_41D NE -1 AND Q5B_41D NE -2 AND 
        Q5B_41D NE 995) AND (Q5B_43A NE -1 AND Q5B_43A NE -2 AND 
        Q5B_43A NE 995 AND Q5B_43A NE -4)) 
COMPUTE HRACTT=Q5B_41D+Q5B_43A
ELSE IF ((Q5B_41D NE -4 AND Q5B_41D NE -1 AND Q5B_41D NE -2 AND 
        Q5B_41D NE 995) AND (Q5B_43B NE -1 AND Q5B_43B NE -2 AND 
        Q5B_43B NE 995 AND Q5B_43B NE -4)) 
COMPUTE HRACTT=Q5B_41D+Q5B_43B
ELSE IF ((Q5B_41A NE -4 AND Q5B_41A NE -1 AND Q5B_41A NE -2 AND 
        Q5B_41A NE 995) AND Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=Q5B_41A
ELSE IF ((Q5B_41B NE -4 AND Q5B_41B NE -1 AND Q5B_41B NE -2 AND 
        Q5B_41B NE 995) AND Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=Q5B_41B
ELSE IF ((Q5B_41C NE -4 AND Q5B_41C NE -1 AND Q5B_41C NE -2 AND 
        Q5B_41C NE 995) AND Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=Q5B_41C
ELSE IF ((Q5B_41D NE -4 AND Q5B_41D NE -1 AND Q5B_41D NE -2 AND 
        Q5B_41D NE 995) AND Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=Q5B_41D
ELSE IF ((Q5B_41A EQ -1 OR Q5B_41A EQ -2 OR Q5B_41B EQ -1 OR Q5B_41B EQ -2
                    OR Q5B_41C EQ -1 OR Q5B_41C EQ -2 OR Q5B_41D EQ -1 OR 
        Q5B_41D EQ -2) AND Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=-2
ELSE IF ((Q5B_41A EQ 995 OR Q5B_41B EQ 995 OR Q5B_41C EQ 995 OR 
        Q5B_41D EQ 995) AND Q5B_43A EQ -4 AND Q5B_43B EQ -4)
COMPUTE HRACTT=995
 
ELSE IF (Q5_40A EQ -4)
COMPUTE HRACTT=-4
ELSE IF ((Q5_41A EQ -1 OR Q5_41B EQ -1 OR Q5_41C EQ -1 OR Q5_41D EQ -1 OR
                    Q5_41A EQ -2 OR Q5_41B EQ -2 OR Q5_41C EQ -2 OR Q5_41D EQ -2) AND
                    (Q5_43A EQ -1 OR Q5_43B EQ -1 OR Q5_43A EQ -2 OR Q5_43B EQ -2))
COMPUTE HRACTT=-2
ELSE IF ((Q5_41A EQ 995 OR Q5_41B EQ 995 OR Q5_41C EQ 995 OR Q5_41D EQ 995)
                    AND (Q5_43A EQ 995 OR Q5_43B EQ 995))
COMPUTE HRACTT=995
ELSE IF ((Q5_41A EQ -1 OR Q5_41B EQ -1 OR Q5_41C EQ -1 OR Q5_41D EQ -1 OR
                    Q5_41A EQ -2 OR Q5_41B EQ -2 OR Q5_41C EQ -2 OR Q5_41D EQ -2) AND
                    (Q5_43A EQ 995 OR Q5_43B EQ 995))
COMPUTE HRACTT=995
ELSE IF ((Q5_41A EQ 995 OR Q5_41B EQ 995 OR Q5_41C EQ 995 OR Q5_41D EQ 995 OR
                    Q5_41A EQ 995 OR Q5_41B EQ 995 OR Q5_41C EQ 995 OR Q5_41D EQ 995) AND
                    (Q5_43A EQ -1 OR Q5_43B EQ -1 OR Q5_43A EQ -2 OR Q5_43B EQ -2))
COMPUTE HRACTT=995
ELSE IF ((Q5_41A NE -4 AND Q5_41A NE -1 AND Q5_41A NE -2 AND Q5_41A NE 995)
                     AND (Q5_43A EQ -1 OR Q5_43B EQ -1 OR Q5_43A EQ -2 OR Q5_43B EQ -2 
                    OR Q5_43A EQ 995 OR Q5_43B EQ 995))
COMPUTE HRACTT=Q5_41A
ELSE IF ((Q5_41B NE -4 AND Q5_41B NE -1 AND Q5_41B NE -2 AND Q5_41B NE 995) 
                    AND (Q5_43A EQ -1 OR Q5_43B EQ -1 OR Q5_43A EQ -2 OR Q5_43B EQ -2 
                    OR Q5_43A EQ 995 OR Q5_43B EQ 995))
COMPUTE HRACTT=Q5_41B
ELSE IF ((Q5_41C NE -4 AND Q5_41C NE -1 AND Q5_41C NE -2 AND Q5_41C NE 995) 
                    AND (Q5_43A EQ -1 OR Q5_43B EQ -1 OR Q5_43A EQ -2 OR Q5_43B EQ -2 
                    OR Q5_43A EQ 995 OR Q5_43B EQ 995))
COMPUTE HRACTT=Q5_41C
ELSE IF ((Q5_41D NE -4 AND Q5_41D NE -1 AND Q5_41D NE -2 AND Q5_41D NE 995) 
                    AND (Q5_43A EQ -1 OR Q5_43B EQ -1 OR Q5_43A EQ -2 OR Q5_43B EQ -2 
                    OR Q5_43A EQ 995 OR Q5_43B EQ 995))
COMPUTE HRACTT=Q5_41D
ELSE IF ((Q5_43B NE -4 AND Q5_43A NE -1 AND Q5_43A NE -2 AND Q5_43A NE 995) 
                    AND (Q5_41A EQ -1 OR Q5_41A EQ -2 OR Q5_41A EQ 995 OR Q5_41B EQ -1 
                    OR Q5_41B EQ -2 OR Q5_41B EQ 995 OR 
                    Q5_41C EQ -1 OR Q5_41C EQ -2 OR Q5_41C EQ 995 OR Q5_41D EQ -1 
                    OR Q5_41D EQ -2 OR Q5_41D EQ 995))
COMPUTE HRACTT=Q5_43A
ELSE IF ((Q5_43A NE -4 AND Q5_43B NE -1 AND Q5_43B NE -2 AND Q5_43B NE 995) 
                    AND (Q5_41A EQ -1 OR Q5_41A EQ -2 OR Q5_41A EQ 995 OR Q5_41B EQ -1 
                    OR Q5_41B EQ -2 OR Q5_41B EQ 995 OR 
                    Q5_41C EQ -1 OR Q5_41C EQ -2 OR Q5_41C EQ 995 OR Q5_41D EQ -1 
                    OR Q5_41D EQ -2 OR Q5_41D EQ 995))
COMPUTE HRACTT=Q5_43B
ELSE IF ((Q5_41A NE -4 AND Q5_41A NE -1 AND Q5_41A NE -2 AND Q5_41A NE 995) 
                    AND (Q5_43A NE -1 AND Q5_43A NE -2 AND Q5_43A NE 995 AND Q5_43A NE -4)) 
COMPUTE HRACTT=Q5_41A+Q5_43A
ELSE IF ((Q5_41A NE -4 AND Q5_41A NE -1 AND Q5_41A NE -2 AND Q5_41A NE 995) 
                    AND (Q5_43B NE -1 AND Q5_43B NE -2 AND Q5_43B NE 995 AND Q5_43B NE -4)) 
COMPUTE HRACTT=Q5_41A+Q5_43B
ELSE IF ((Q5_41B NE -4 AND Q5_41B NE -1 AND Q5_41B NE -2 AND Q5_41B NE 995) 
                    AND (Q5_43A NE -1 AND Q5_43A NE -2 AND Q5_43A NE 995 AND Q5_43A NE -4)) 
COMPUTE HRACTT=Q5_41B+Q5_43A
ELSE IF ((Q5_41B NE -4 AND Q5_41B NE -1 AND Q5_41B NE -2 AND Q5_41B NE 995) 
                    AND (Q5_43B NE -1 AND Q5_43B NE -2 AND Q5_43B NE 995 AND Q5_43B NE -4)) 
COMPUTE HRACTT=Q5_41B+Q5_43B
ELSE IF ((Q5_41C NE -4 AND Q5_41C NE -1 AND Q5_41C NE -2 AND Q5_41C NE 995) 
                    AND (Q5_43A NE -1 AND Q5_43A NE -2 AND Q5_43A NE 995 AND Q5_43A NE -4)) 
COMPUTE HRACTT=Q5_41C+Q5_43A
ELSE IF ((Q5_41C NE -4 AND Q5_41C NE -1 AND Q5_41C NE -2 AND Q5_41C NE 995) 
                    AND (Q5_43B NE -1 AND Q5_43B NE -2 AND Q5_43B NE 995 AND Q5_43B NE -4)) 
COMPUTE HRACTT=Q5_41C+Q5_43B
ELSE IF ((Q5_41D NE -4 AND Q5_41D NE -1 AND Q5_41D NE -2 AND Q5_41D NE 995) 
                    AND (Q5_43A NE -1 AND Q5_43A NE -2 AND Q5_43A NE 995 AND Q5_43A NE -4)) 
COMPUTE HRACTT=Q5_41D+Q5_43A
ELSE IF ((Q5_41D NE -4 AND Q5_41D NE -1 AND Q5_41D NE -2 AND Q5_41D NE 995) 
                    AND (Q5_43B NE -1 AND Q5_43B NE -2 AND Q5_43B NE 995 AND Q5_43B NE -4)) 
COMPUTE HRACTT=Q5_41D+Q5_43B
ELSE IF ((Q5_41A NE -4 AND Q5_41A NE -1 AND Q5_41A NE -2 AND Q5_41A NE 995) 
                    AND Q5_43A EQ -4 AND Q5_43B EQ -4)
COMPUTE HRACTT=Q5_41A
ELSE IF ((Q5_41B NE -4 AND Q5_41B NE -1 AND Q5_41B NE -2 AND Q5_41B NE 995) 
                    AND Q5_43A EQ -4 AND Q5_43B EQ -4)
COMPUTE HRACTT=Q5_41B
ELSE IF ((Q5_41C NE -4 AND Q5_41C NE -1 AND Q5_41C NE -2 AND Q5_41C NE 995) 
                    AND Q5_43A EQ -4 AND Q5_43B EQ -4)
COMPUTE HRACTT=Q5_41C
ELSE IF ((Q5_41D NE -4 AND Q5_41D NE -1 AND Q5_41D NE -2 AND Q5_41D NE 995) 
                    AND Q5_43A EQ -4 AND Q5_43B EQ -4)
COMPUTE HRACTT=Q5_41D
ELSE IF ((Q5_41A EQ -1 OR Q5_41A EQ -2 OR Q5_41B EQ -1 OR Q5_41B EQ -2
                    OR Q5_41C EQ -1 OR Q5_41C EQ -2 OR Q5_41D EQ -1 OR Q5_41D EQ -2) 
                    AND Q5_43A EQ -4 AND Q5_43B EQ -4)
COMPUTE HRACTT=-2
ELSE IF ((Q5_41A EQ 995 OR Q5_41B EQ 995 OR Q5_41C EQ 995 OR Q5_41D EQ 995)
                    AND Q5_43A EQ -4 AND Q5_43B EQ -4)
COMPUTE HRACTT=995
ELSE 
COMPUTE HRACTT=-3
END IF
 
/* the following lines creates the var BUS2 */
DO IF (Q5_6 EQ -4)
COMPUTE BUS2=-4
ELSE IF (Q5_6 EQ -1)
COMPUTE BUS2=-1
ELSE IF (Q5_6 EQ -2)
COMPUTE BUS2=-2
ELSE IF (Q5_7 EQ -1 OR Q5_8 EQ -1)
COMPUTE BUS2=-1
ELSE IF (Q5_7 EQ -2 OR Q5_8 EQ -2)
COMPUTE BUS2=-2
ELSE IF (Q5_7 EQ 1 OR Q5_8 EQ 1)
COMPUTE BUS2=1
ELSE IF (Q5_8 EQ 0)
COMPUTE BUS2=2  /* this should normally be 0 */
ELSE 
COMPUTE BUS2=-3
END IF
 
/* the following lines create the var HRUSL1 */
DO IF (Q5B2_25 EQ -4)
COMPUTE HRUSL1=-4
ELSE IF (Q5B2_26A EQ -1 OR Q5B2_26C EQ -1 OR Q5B2_26A EQ -2 OR Q5B2_26C EQ -2)
COMPUTE HRUSL1=-2
ELSE IF (Q5B2_26A EQ 995 OR Q5B2_26C EQ 995)
COMPUTE HRUSL1=995
ELSE IF (Q5B2_26A EQ 1)
COMPUTE HRUSL1=Q5B2_26B
ELSE IF (Q5B2_26C EQ 1)
COMPUTE HRUSL1=Q5B2_26D
 
ELSE IF (Q5B_25 EQ -4)
COMPUTE HRUSL1=-4
ELSE IF (Q5B_26A EQ -1 OR Q5B_26C EQ -1 OR Q5B_26A EQ -2 OR Q5B_26C EQ -2)
COMPUTE HRUSL1=-2
ELSE IF (Q5B_26A EQ 995 OR Q5B_26C EQ 995)
COMPUTE HRUSL1=995
ELSE IF (Q5B_26A EQ 1)
COMPUTE HRUSL1=Q5B_26B
ELSE IF (Q5B_26C EQ 1)
COMPUTE HRUSL1=Q5B_26D
 
ELSE IF (Q5_25 EQ -4)
COMPUTE HRUSL1=-4
ELSE IF (Q5_26A EQ -1 OR Q5_26C EQ -1 OR Q5_26A EQ -2 OR Q5_26C EQ -2)
COMPUTE HRUSL1=-2
ELSE IF (Q5_26A EQ 995 OR Q5_26C EQ 995)
COMPUTE HRUSL1=995
ELSE IF (Q5_26A EQ 1)
COMPUTE HRUSL1=Q5_26B
ELSE IF (Q5_26C EQ 1)
COMPUTE HRUSL1=Q5_26D
ELSE 
COMPUTE HRUSL1=-3
END IF
 
/* the following lines create the var HRUSL2 */
DO IF (Q5B2_28A EQ -4)
COMPUTE HRUSL2=-4
ELSE IF (Q5B2_28B EQ -1 OR Q5B2_28D EQ -1 OR Q5B2_28B EQ -2 OR Q5B2_28D EQ -2)
COMPUTE HRUSL2=-2
ELSE IF (Q5B2_28B EQ 995 OR Q5B2_28D EQ 995)
COMPUTE HRUSL2=995
ELSE IF (Q5B2_28B EQ 1)
COMPUTE HRUSL2=Q5B2_28C
ELSE IF (Q5B2_28D EQ 1)
COMPUTE HRUSL2=Q5B2_28E
 
ELSE IF (Q5B_28A EQ -4)
COMPUTE HRUSL2=-4
ELSE IF (Q5B_28B EQ -1 OR Q5B_28D EQ -1 OR Q5B_28B EQ -2 OR Q5B_28D EQ -2)
COMPUTE HRUSL2=-2
ELSE IF (Q5B_28B EQ 995 OR Q5B_28D EQ 995)
COMPUTE HRUSL2=995
ELSE IF (Q5B_28B EQ 1)
COMPUTE HRUSL2=Q5B_28C
ELSE IF (Q5B_28D EQ 1)
COMPUTE HRUSL2=Q5B_28E
 
ELSE IF (Q5_28A EQ -4)
COMPUTE HRUSL2=-4
ELSE IF (Q5_28B EQ -1 OR Q5_28D EQ -1 OR Q5_28B EQ -2 OR Q5_28D EQ -2)
COMPUTE HRUSL2=-2
ELSE IF (Q5_28B EQ 995 OR Q5_28D EQ 995)
COMPUTE HRUSL2=995
ELSE IF (Q5_28B EQ 1)
COMPUTE HRUSL2=Q5_28C
ELSE IF (Q5_28D EQ 1)
COMPUTE HRUSL2=Q5_28E
ELSE 
COMPUTE HRUSL2=-3
END IF 
 
/* the following lines create the var HRUSLT */
DO IF (Q5B2_25 EQ -4)
COMPUTE HRUSLT=-4
ELSE IF ((Q5B2_26A EQ -1 OR Q5B2_26C EQ -1 OR Q5B2_26A EQ -2 OR 
        Q5B2_26C EQ -2) AND (Q5B2_28B EQ -1 OR Q5B2_28D EQ -1 OR 
        Q5B2_28B EQ -2 OR Q5B2_28D EQ -2))
COMPUTE HRUSLT=-2
ELSE IF ((Q5B2_26A EQ 995 OR Q5B2_26C EQ 995) AND (Q5B2_28B EQ 995 OR 
        Q5B2_28D EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((Q5B2_26A EQ -1 OR Q5B2_26C EQ -1 OR Q5B2_26A EQ -2 OR 
        Q5B2_26C EQ -2) AND (Q5B2_28B EQ 995 OR Q5B2_28D EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((Q5B2_26A EQ 995 OR Q5B2_26C EQ 995) AND
                    (Q5B2_28B EQ -1 OR Q5B2_28D EQ -1 OR Q5B2_28B EQ -2 OR Q5B2_28D EQ -2))
COMPUTE HRUSLT=995
ELSE IF ((Q5B2_26A EQ 995 OR Q5B2_26C EQ 995) AND Q5B2_27 NE 1)
COMPUTE HRUSLT=995
ELSE IF ((Q5B2_26A EQ -1 OR Q5B2_26C EQ -1 OR Q5B2_26A EQ -2 OR 
        Q5B2_26C EQ -2) AND Q5B2_27 NE 1)
COMPUTE HRUSLT=-2
ELSE IF (Q5B2_26A EQ 1 AND (Q5B2_28B EQ -1 OR Q5B2_28B EQ -2 OR 
        Q5B2_28B EQ 995 OR Q5B2_28D EQ -1 OR Q5B2_28D EQ -2 OR 
        Q5B2_28D EQ 995))
COMPUTE HRUSLT=Q5B2_26B
ELSE IF (Q5B2_26C EQ 1 AND (Q5B2_28B EQ -1 OR Q5B2_28B EQ -2 OR 
        Q5B2_28B EQ 995 OR Q5B2_28D EQ -1 OR Q5B2_28D EQ -2 OR Q5B2_28D EQ 995))
COMPUTE HRUSLT=Q5B2_26D
ELSE IF (Q5B2_28B EQ 1 AND (Q5B2_26A EQ -1 OR Q5B2_26A EQ -2 OR 
        Q5B2_26A EQ 995 OR Q5B2_26C EQ -1 OR Q5B2_26C EQ -2 OR Q5B2_26C EQ 995))
COMPUTE HRUSLT=Q5B2_28C
ELSE IF (Q5B2_28D EQ 1 AND (Q5B2_26A EQ -1 OR Q5B2_26A EQ -2 OR 
        Q5B2_26A EQ 995 OR Q5B2_26C EQ -1 OR Q5B2_26C EQ -2 OR Q5B2_26C EQ 995))
COMPUTE HRUSLT=Q5B2_28E
ELSE IF (Q5B2_26A EQ 1 AND Q5B2_27 NE 1)
COMPUTE HRUSLT=Q5B2_26B
ELSE IF (Q5B2_26C EQ 1 AND Q5B2_27 NE 1)
COMPUTE HRUSLT=Q5B2_26D
ELSE IF (Q5B2_26A EQ 1 AND Q5B2_28B EQ 1)
COMPUTE HRUSLT=Q5B2_26B+Q5B2_28C
ELSE IF (Q5B2_26A EQ 1 AND Q5B2_28D EQ 1)
COMPUTE HRUSLT=Q5B2_26B+Q5B2_28E
ELSE IF (Q5B2_26C EQ 1 AND Q5B2_28B EQ 1)
COMPUTE HRUSLT=Q5B2_26D+Q5B2_28C
ELSE IF (Q5B2_26C EQ 1 AND Q5B2_28D EQ 1)
COMPUTE HRUSLT=Q5B2_26C+Q5B2_28E
 
ELSE IF (Q5B_25 EQ -4)
COMPUTE HRUSLT=-4
ELSE IF ((Q5B_26A EQ -1 OR Q5B_26C EQ -1 OR Q5B_26A EQ -2 OR 
        Q5B_26C EQ -2) AND (Q5B_28B EQ -1 OR Q5B_28D EQ -1 OR 
        Q5B_28B EQ -2 OR Q5B_28D EQ -2))
COMPUTE HRUSLT=-2
ELSE IF ((Q5B_26A EQ 995 OR Q5B_26C EQ 995) AND (Q5B_28B EQ 995 OR 
        Q5B_28D EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((Q5B_26A EQ -1 OR Q5B_26C EQ -1 OR Q5B_26A EQ -2 OR 
        Q5B_26C EQ -2) AND (Q5B_28B EQ 995 OR Q5B_28D EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((Q5B_26A EQ 995 OR Q5B_26C EQ 995) AND
                    (Q5B_28B EQ -1 OR Q5B_28D EQ -1 OR Q5B_28B EQ -2 OR Q5B_28D EQ -2))
COMPUTE HRUSLT=995
ELSE IF ((Q5B_26A EQ 995 OR Q5B_26C EQ 995) AND Q5B_27 NE 1)
COMPUTE HRUSLT=995
ELSE IF ((Q5B_26A EQ -1 OR Q5B_26C EQ -1 OR Q5B_26A EQ -2 OR 
        Q5B_26C EQ -2) AND Q5B_27 NE 1)
COMPUTE HRUSLT=-2
ELSE IF (Q5B_26A EQ 1 AND (Q5B_28B EQ -1 OR Q5B_28B EQ -2 OR 
        Q5B_28B EQ 995 OR Q5B_28D EQ -1 OR Q5B_28D EQ -2 OR 
        Q5B_28D EQ 995))
COMPUTE HRUSLT=Q5B_26B
ELSE IF (Q5B_26C EQ 1 AND (Q5B_28B EQ -1 OR Q5B_28B EQ -2 OR 
        Q5B_28B EQ 995 OR Q5B_28D EQ -1 OR Q5B_28D EQ -2 OR Q5B_28D EQ 995))
COMPUTE HRUSLT=Q5B_26D
ELSE IF (Q5B_28B EQ 1 AND (Q5B_26A EQ -1 OR Q5B_26A EQ -2 OR 
        Q5B_26A EQ 995 OR Q5B_26C EQ -1 OR Q5B_26C EQ -2 OR Q5B_26C EQ 995))
COMPUTE HRUSLT=Q5B_28C
ELSE IF (Q5B_28D EQ 1 AND (Q5B_26A EQ -1 OR Q5B_26A EQ -2 OR 
        Q5B_26A EQ 995 OR Q5B_26C EQ -1 OR Q5B_26C EQ -2 OR Q5B_26C EQ 995))
COMPUTE HRUSLT=Q5B_28E
ELSE IF (Q5B_26A EQ 1 AND Q5B_27 NE 1)
COMPUTE HRUSLT=Q5B_26B
ELSE IF (Q5B_26C EQ 1 AND Q5B_27 NE 1)
COMPUTE HRUSLT=Q5B_26D
ELSE IF (Q5B_26A EQ 1 AND Q5B_28B EQ 1)
COMPUTE HRUSLT=Q5B_26B+Q5B_28C
ELSE IF (Q5B_26A EQ 1 AND Q5B_28D EQ 1)
COMPUTE HRUSLT=Q5B_26B+Q5B_28E
ELSE IF (Q5B_26C EQ 1 AND Q5B_28B EQ 1)
COMPUTE HRUSLT=Q5B_26D+Q5B_28C
ELSE IF (Q5B_26C EQ 1 AND Q5B_28D EQ 1)
COMPUTE HRUSLT=Q5B_26C+Q5B_28E
 
ELSE IF (Q5_25 EQ -4)
COMPUTE HRUSLT=-4
ELSE IF ((Q5_26A EQ -1 OR Q5_26C EQ -1 OR Q5_26A EQ -2 OR Q5_26C EQ -2) AND
                    (Q5_28B EQ -1 OR Q5_28D EQ -1 OR Q5_28B EQ -2 OR Q5_28D EQ -2))
COMPUTE HRUSLT=-2
ELSE IF ((Q5_26A EQ 995 OR Q5_26C EQ 995) AND (Q5_28B EQ 995 OR Q5_28D EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((Q5_26A EQ -1 OR Q5_26C EQ -1 OR Q5_26A EQ -2 OR Q5_26C EQ -2) AND
                    (Q5_28B EQ 995 OR Q5_28D EQ 995))
COMPUTE HRUSLT=995
ELSE IF ((Q5_26A EQ 995 OR Q5_26C EQ 995) AND
                    (Q5_28B EQ -1 OR Q5_28D EQ -1 OR Q5_28B EQ -2 OR Q5_28D EQ -2))
COMPUTE HRUSLT=995
ELSE IF ((Q5_26A EQ 995 OR Q5_26C EQ 995) AND Q5_27 NE 1)
COMPUTE HRUSLT=995
ELSE IF ((Q5_26A EQ -1 OR Q5_26C EQ -1 OR Q5_26A EQ -2 OR Q5_26C EQ -2) AND 
                    Q5_27 NE 1)
COMPUTE HRUSLT=-2
ELSE IF (Q5_26A EQ 1 AND (Q5_28B EQ -1 OR Q5_28B EQ -2 OR Q5_28B EQ 995 OR
                    Q5_28D EQ -1 OR Q5_28D EQ -2 OR Q5_28D EQ 995))
COMPUTE HRUSLT=Q5_26B
ELSE IF (Q5_26C EQ 1 AND (Q5_28B EQ -1 OR Q5_28B EQ -2 OR Q5_28B EQ 995 OR
                    Q5_28D EQ -1 OR Q5_28D EQ -2 OR Q5_28D EQ 995))
COMPUTE HRUSLT=Q5_26D
ELSE IF (Q5_28B EQ 1 AND (Q5_26A EQ -1 OR Q5_26A EQ -2 OR Q5_26A EQ 995 OR
                    Q5_26C EQ -1 OR Q5_26C EQ -2 OR Q5_26C EQ 995))
COMPUTE HRUSLT=Q5_28C
ELSE IF (Q5_28D EQ 1 AND (Q5_26A EQ -1 OR Q5_26A EQ -2 OR Q5_26A EQ 995 OR
                    Q5_26C EQ -1 OR Q5_26C EQ -2 OR Q5_26C EQ 995))
COMPUTE HRUSLT=Q5_28E
ELSE IF (Q5_26A EQ 1 AND Q5_27 NE 1)
COMPUTE HRUSLT=Q5_26B
ELSE IF (Q5_26C EQ 1 AND Q5_27 NE 1)
COMPUTE HRUSLT=Q5_26D
ELSE IF (Q5_26A EQ 1 AND Q5_28B EQ 1)
COMPUTE HRUSLT=Q5_26B+Q5_28C
ELSE IF (Q5_26A EQ 1 AND Q5_28D EQ 1)
COMPUTE HRUSLT=Q5_26B+Q5_28E
ELSE IF (Q5_26C EQ 1 AND Q5_28B EQ 1)
COMPUTE HRUSLT=Q5_26D+Q5_28C
ELSE IF (Q5_26C EQ 1 AND Q5_28D EQ 1)
COMPUTE HRUSLT=Q5_26C+Q5_28E
ELSE 
COMPUTE HRUSLT=-3
END IF
 
/* the following lines create the var HRFTPT */
DO IF (Q5B2_30C EQ -4)
COMPUTE HRFTPT=-4
ELSE IF (Q5B2_30F EQ -1 OR Q5B2_30G EQ -1 OR Q5B2_30H EQ -1 OR Q5B2_30I EQ -1)
COMPUTE HRFTPT=-1
ELSE IF (Q5B2_30F EQ -2 OR Q5B2_30G EQ -2 OR Q5B2_30H EQ -2 OR Q5B2_30I EQ -2)
COMPUTE HRFTPT=-2
ELSE IF (Q5B2_30F NE -4)
COMPUTE HRFTPT=Q5B2_30F
ELSE IF (Q5B2_30G NE -4)
COMPUTE HRFTPT=Q5B2_30G
ELSE IF (Q5B2_30H NE -4)
COMPUTE HRFTPT=Q5B2_30H
ELSE IF (Q5B2_30I NE -4)
COMPUTE HRFTPT=Q5B2_30I
 
ELSE IF (Q5B_30C EQ -4)
COMPUTE HRFTPT=-4
ELSE IF (Q5B_30F EQ -1 OR Q5B_30G EQ -1 OR Q5B_30H EQ -1 OR Q5B_30I EQ -1)
COMPUTE HRFTPT=-1
ELSE IF (Q5B_30F EQ -2 OR Q5B_30G EQ -2 OR Q5B_30H EQ -2 OR Q5B_30I EQ -2)
COMPUTE HRFTPT=-2
ELSE IF (Q5B_30F NE -4)
COMPUTE HRFTPT=Q5B_30F
ELSE IF (Q5B_30G NE -4)
COMPUTE HRFTPT=Q5B_30G
ELSE IF (Q5B_30H NE -4)
COMPUTE HRFTPT=Q5B_30H
ELSE IF (Q5B_30I NE -4)
COMPUTE HRFTPT=Q5B_30I
 
ELSE IF (Q5_30C EQ -4)
COMPUTE HRFTPT=-4
ELSE IF (Q5_30F EQ -1 OR Q5_30G EQ -1 OR Q5_30H EQ -1 OR Q5_30I EQ -1)
COMPUTE HRFTPT=-1
ELSE IF (Q5_30F EQ -2 OR Q5_30G EQ -2 OR Q5_30H EQ -2 OR Q5_30I EQ -2)
COMPUTE HRFTPT=-2
ELSE IF (Q5_30F NE -4)
COMPUTE HRFTPT=Q5_30F
ELSE IF (Q5_30G NE -4)
COMPUTE HRFTPT=Q5_30G
ELSE IF (Q5_30H NE -4)
COMPUTE HRFTPT=Q5_30H
ELSE IF (Q5_30I NE -4)
COMPUTE HRFTPT=Q5_30I
ELSE
COMPUTE HRFTPT=-3
END IF 
 
/* the following lines create the var HRWANT */
DO IF (Q5B2_33 NE -4)
COMPUTE HRWANT=Q5B2_33
ELSE IF (Q5B_33 NE -4)
COMPUTE HRWANT=Q5B_33
ELSE 
COMPUTE HRWANT=Q5_33
END IF
 
/* the following lines create the var HRRSN1 */
DO IF (Q5B2_34 NE -4)
COMPUTE HRRSN1=Q5B2_34
ELSE IF (Q5B_34 NE -4)
COMPUTE HRRSN1=Q5B_34
ELSE
COMPUTE HRRSN1=Q5_34
END IF
 
/* the following lines create the var HRCK7 */
COMPUTE HRCK7=-4
DO IF ((BUS2 EQ 2 OR BUS2 EQ -2 OR BUS2 EQ -1) AND (HRACT1 LT 15 
                    OR HRACT1 EQ -2))
COMPUTE HRCK7=1
ELSE IF ((BUS2 EQ 2 OR BUS2 EQ -2 OR BUS2 EQ -1) AND HRACT1 GE 15)
COMPUTE HRCK7=2
ELSE IF ((HRUSLT GE 35 OR HRFTPT EQ 1) AND HRACTT LT 35 AND (HRACT1 NE -1
                    OR HRACT1 NE -2 OR HRACT2 NE -1 OR HRACT2 NE -2)) 
COMPUTE HRCK7=3
ELSE IF (HRWANT EQ 1 AND HRACTT LT 35 AND (HRRSN1 EQ 1 OR HRRSN1 EQ 2
                    OR HRRSN1 EQ 3))
COMPUTE HRCK7=4
ELSE 
COMPUTE HRCK7=5
END IF 
 
/* the following lines create the var ABSOT */
DO IF (HRACT1 EQ 0 AND HRACT2 EQ 0)
COMPUTE ABSOT=1
ELSE
COMPUTE ABSOT=0
END IF
 
/* the following lines create the var HRCK6 */
COMPUTE HRCK6=-4
DO IF ((HRACT1 EQ 0 AND HRACT2 EQ 0) AND (BUS2 EQ 2 OR BUS2 EQ -1 
                    OR BUS2 EQ -2))
COMPUTE HRCK6=1
ELSE IF (ABSOT EQ 1)
COMPUTE HRCK6=2
ELSE 
COMPUTE HRCK6=3
END IF
 
/* the following lines create the var WK */
COMPUTE WK=-4
DO IF (Q5_2 NE -4)
COMPUTE WK=Q5_2
ELSE IF (Q5_3 NE -4)
COMPUTE WK=Q5_3
END IF
 
/* the following lines create the var RETOT */
DO IF (WK EQ 2)
COMPUTE RETOT=1
ELSE
COMPUTE RETOT=0
END IF
 
/* the following lines rename the vars */
COMPUTE BUS1=Q5_5
COMPUTE RET1=Q5_10
COMPUTE IO1COW=Q5_JUMP
COMPUTE NLFACT=Q5_93
 
/* the following lines create additional variables */
DO IF (Q5B2_22 NE -4)
COMPUTE ABSPD=Q5B2_22
ELSE IF (Q5B_22 NE -4)
COMPUTE ABSPD=Q5B_22
ELSE
COMPUTE ABSPD=Q5_22
END IF
 
DO IF (Q5B2_65 NE -4)
COMPUTE LKAVL=Q5B2_65
ELSE IF (Q5B_65 NE -4)
COMPUTE LKAVL=Q5B_65
ELSE
COMPUTE LKAVL=Q5_65
END IF
 
DO IF (Q5B2_51 NE -4)
COMPUTE LAYAVL=Q5B2_51
ELSE IF (Q5B_51 NE -4)
COMPUTE LAYAVL=Q5B_51
ELSE
COMPUTE LAYAVL=Q5_51
END IF
 
DO IF (Q5B2_66 NE -4)
COMPUTE LKAVR=Q5B2_66
ELSE IF (Q5B_66 NE -4)
COMPUTE LKAVR=Q5B_66
ELSE
COMPUTE LKAVR=Q5_66
END IF
 
DO IF (Q5B2_52 NE -4)
COMPUTE LAYAVR=Q5B2_52
ELSE IF (Q5B_52 NE -4)
COMPUTE LAYAVR=Q5B_52
ELSE
COMPUTE LAYAVR=Q5_52
END IF
 
DO IF (Q5B2_60 NE -4)
COMPUTE LK=Q5B2_60
ELSE IF (Q5B_60 NE -4)
COMPUTE LK=Q5B_60
ELSE
COMPUTE LK=Q5_60
END IF
 
DO IF (Q5B2_11 NE -4)
COMPUTE DIS1=Q5B2_11
ELSE IF (Q5B_11 NE -4)
COMPUTE DIS1=Q5B_11
ELSE
COMPUTE DIS1=Q5_11
END IF
 
DO IF (Q5B2_12 NE -4)
COMPUTE DIS2=Q5B2_12
ELSE IF (Q5B_12 NE -4)
COMPUTE DIS2=Q5B_12
ELSE
COMPUTE DIS2=Q5_12
END IF
 
/* the following lines create the var DWWNTO */
DO IF (RET1 EQ 1)
COMPUTE DWWNTO=1
 
ELSE IF (Q5B2_78 EQ 1)
COMPUTE DWWNTO=1
ELSE IF (Q5B2_78 EQ 0)
COMPUTE DWWNTO=2
ELSE IF (Q5B2_78 EQ -2)
COMPUTE DWWNTO=-2
ELSE IF (Q5B2_78 EQ -1)
COMPUTE DWWNTO=-1
ELSE IF (Q5B2_78 EQ 3)
COMPUTE DWWNTO=3
ELSE IF (Q5B2_78 EQ 4)
COMPUTE DWWNTO=4
ELSE IF (Q5B_78 EQ 1)
COMPUTE DWWNTO=1
ELSE IF (Q5B_78 EQ 0)
COMPUTE DWWNTO=2
ELSE IF (Q5B_78 EQ -2)
COMPUTE DWWNTO=-2
ELSE IF (Q5B_78 EQ -1)
COMPUTE DWWNTO=-1
ELSE IF (Q5B_78 EQ 3)
COMPUTE DWWNTO=3
ELSE IF (Q5B_78 EQ 4)
COMPUTE DWWNTO=4
ELSE IF (Q5_78 EQ 1)
COMPUTE DWWNTO=1
ELSE IF (Q5_78 EQ 0)
COMPUTE DWWNTO=2
ELSE IF (Q5_78 EQ -2)
COMPUTE DWWNTO=-2
ELSE IF (Q5_78 EQ -1)
COMPUTE DWWNTO=-1
ELSE IF (Q5_78 EQ 3)
COMPUTE DWWNTO=3
ELSE IF (Q5_78 EQ 4)
COMPUTE DWWNTO=4
ELSE
COMPUTE DWWNTO=-3
END IF
 
/* the following lines create the var DIS */
DO IF (Q5_9A4 EQ -4)
COMPUTE DIS=-4
ELSE IF (Q5_9D EQ -1 OR Q5_9E EQ -1 OR Q5_9F EQ -1 OR Q5_9G EQ -1)
                    OR (Q5_9D EQ -2 OR Q5_9E EQ -2 OR Q5_9F EQ -2 OR Q5_9G EQ -2)
COMPUTE DIS=-2
ELSE IF (Q5_9A4 EQ 1 AND Q5_9D EQ 1)
COMPUTE DIS=1
ELSE IF (Q5_9D EQ 0)
COMPUTE DIS=0
ELSE IF (Q5_9A5 EQ 1 AND Q5_9E EQ 1)
COMPUTE DIS=1
ELSE IF (Q5_9E EQ 0)
COMPUTE DIS=0
ELSE IF (Q5_9A6 EQ 1 AND Q5_9F EQ 1)
COMPUTE DIS=1
ELSE IF (Q5_9F EQ 0)
COMPUTE DIS=0
ELSE IF (Q5_9A7 EQ 1 AND Q5_9G EQ 1)
COMPUTE DIS=1
ELSE IF (Q5_9G EQ 0)
COMPUTE DIS=0
ELSE 
COMPUTE DIS=-3
END IF
 
/* the following lines create IO1COW */
DO IF (Q5_JUMP EQ 1)
COMPUTE IO1COW=8
ELSE
COMPUTE IO1COW=0
END IF
 
/* the following lines create the ESR var approximating MLR */
DO IF ((WK EQ 1 AND (HRCK6 EQ 3 OR HRCK6 EQ -4 OR HRCK6 EQ 99 OR 
        HRCK6 EQ 999)) OR 
       (BUS1 EQ 1 AND (HRCK7 EQ 2 OR HRCK7 EQ 3 OR HRCK7 EQ 4 OR 
        HRCK7 EQ 5 OR HRCK7 EQ -4)))
COMPUTE ESR=1
ELSE IF (ABSPD EQ 1 OR ABSPD EQ 0 OR ABSPD EQ -1 OR ABSPD EQ -2)
COMPUTE ESR=2
ELSE IF ((LAYAVL EQ 1 OR LAYAVL EQ -1 OR LAYAVL EQ -2) OR LAYAVR EQ 1)
COMPUTE ESR=3
ELSE IF ((LKAVL EQ 1 OR LKAVL EQ -1 OR LKAVL EQ -2) OR (LKAVR EQ 1 OR 
                    LKAVR EQ 2))
COMPUTE ESR=4
ELSE IF ((WK EQ 3 AND AGE GE 50 AND RET1 EQ 1 AND LK EQ 1 AND LKAVL EQ 0 AND
                    (LKAVR EQ 3 OR LKAVR EQ 4 OR LKAVR EQ -1 OR LKAVR EQ -2)) OR
                    (RET1 EQ 0 OR LK EQ 3 OR DWWNTO EQ 3) OR NLFACT EQ 5 OR RETOT EQ 1) 
COMPUTE ESR=5
ELSE IF (DIS1 EQ 1 OR DIS2 EQ 1 OR DIS EQ 1)
COMPUTE ESR=6
ELSE IF (Q5_JUMP EQ 1)
COMPUTE ESR=8
/* ELSE IF (IO1COW EQ 8) */
/* COMPUTE ESR=7 */
ELSE
COMPUTE ESR=7
END IF 

/*COLLAPSED EMPLOYMENT STATUS RECODE 1998*/

DO IF (ESR = -5)
COMPUTE ESRC=-5
ELSE IF (ESR = 1 OR ESR = 2)
COMPUTE ESRC=1
ELSE IF (ESR = 3 OR ESR = 4)
COMPUTE ESRC=2
ELSE IF (ESR >= 4 AND ESR <= 7)
COMPUTE ESRC=3
ELSE 
COMPUTE ESRC=ESR
END IF
 
IF (Q5_JUMP = 1) ESRC=4

2006 SAS CODE

/*this section computes hract1, hract2, & hractt*/
hract1=-4;

array q540a (i) Q5_40A_02 Q5_40A_01;*WAS Q5-36 ANSWERED:DID RESPONDENT LOSE OR TAKE OFF HOURS LAST WEEK?;
array q540b (i) Q5_40B_02 Q5_40B_01;*R ANSWERED Q5-36 AND DID HAVE MORE THAN ONE JOB/BUSINESS LAST WEEK.;
array q540c (i) Q5_40C_02 Q5_40C_01;*R DID NOT ANSWER Q5-36 AND DID HAVE MORE THAN ONE JOB/BUSINESS LAST WEEK.;
array q540d (i) Q5_40D_02 Q5_40D_01;*R ANSWERED Q5-36 BUT DID NOT HAVE MORE THAN ONE JOB/BUSINESS LAST WEEK;
array q540e (i) Q5_40E_02 Q5_40E_01;*R DID NOT ANSWER Q5-36 AND DID NOT HAVE MORE THAN ONE JOB/BUSINESS LAST WEEK;
array q541a (i) Q5_41A_02 Q5_41A_01;*NUMBER OF HOURS R ACTUALLY WORKED AT MAIN JOB LAST WEEK;
array q541b (i) Q5_41B_02 Q5_41B_01;*NUMBER OF HOURS R ACTUALLY WORKED AT MAIN JOB LAST WEEK;
array q541c (i) Q5_41C_02 Q5_41C_01;*NUMBER OF HOURS R ACTUALLY WORKED AT JOB LAST WEEK;
array q541d (i) Q5_41D_02 Q5_41D_01;*NUMBER OF HOURS R ACTUALLY WORKED AT JOB LAST WEEK;

do i=1 to 2;
if hract1=-4 then do;
if missing(q540a) then hract1=-4;
else if ((q541a=-1 | q541b=-1 | q541c=-1 | q541d=-1) | 
(q541a=-2 | q541b=-2 | q541c=-2 | q541d=-2)) then hract1=-2;
else if (q540b=1 & not missing(q541a)) then hract1= q541a;
else if (q540c=1 & not missing(q541b)) then hract1= q541b;
else if (q540d=1 & not missing(q541c)) then hract1= q541c;
else if (q540e=1 | q540e=0) then hract1= q541d;
end;
end;

hract2=-4;
array q542 (i) Q5_42_02 Q5_42_01;*DOES R HAVE MORE THAN ONE JOB?;
array q543 (i) Q5_43_02 Q5_43_01;*RESPONDENT HAS AT LEAST 3 JOBS;
array q543b (i) Q5_43B_02 Q5_43B_01;*NUMBER OF HOURS RESPONDENT ACTUALLY WORKED AT OTHER JOB LAST WEEK;

do i=1 to 2;
if hract2=-4 then do;
if (missing(q542)| q542=0) then hract2=-4;
else if (q543b=-1 | q543b=-2) then hract2=-2;
else if (q543=1) then hract2=q543b;*How about if q542=1???, line 93;
end;
end;

hractt=-4;
do i=1 to 2;
if hractt=-4 then do;
if missing(q540a) then hractt=-4;
else if ((hract1=-2) & (hract2=-2) | (missing(q543b))) then hractt=-2;
else if (hract1=-2 | hract2=-2) then hractt=995;
else if q543b=-4 then hractt=995;
else if ((q541a>0 & q541a~=995) & ((hract2=-2 | hract2=995)|missing(q543b)))
then hractt=q541a;
else if ((q541b>0 & q541b~=995) & ((hract2=-2 | hract2=995)|missing(q543b)))
then hractt=q541b;
else if ((q541c>0 & q541c~=995) & ((hract2=-2 | hract2=995)|missing(q543b)))
then hractt=q541c;
else if ((q541d>0 & q541d~=995) & ((hract2=-2 | hract2=995)|missing(q543b)))
then hractt=q541d;
else if ((q543b>0 & q543b~=995) & (hract1=-2 | hract1=995))
then hractt=q543b;
else if (q541a>0 & q541a~=995) then hractt=q541a;*total hours worked,last week;
else if ((q541a>0 & q541a~=995) & (q543b>0 & q543b~=995)) then hractt=q541a + q543b;
else if (q541b>0 & q541b~=995) then hractt=q541b;
else if ((q541b>0 & q541b~=995) & (q543b>0 & q543b~=995)) then hractt=q541b + q543b;
else if (q541c>0 & q541c~=995) then hractt=q541c;
else if ((q541c>0 & q541c~=995) & (q543b>0 & q543b~=995)) then hractt=q541c + q543b;
else if (q541a>0 & q541d~=995)then hractt=q541d;
else if ((q541a>0 & q541d~=995) & (q543b>0 & q543b~=995)) then hractt=q541d + q543b;
else hractt=-3;
end;
end;

/*business variables*/

bus2=0;

if missing(Q5_6) then bus2=-4; *DOES R OWN BUSINESS OR FARM?;
else if (Q5_6=-1 | Q5_8=-1) then bus2=-1;*NO Q5-7;
else if (Q5_6=-2 | Q5_8=-2) then bus2=-2;
else if (Q5_8=1) then bus2=1;*Q5-8: DOES R RECEIVES INCOME BUSINESS OR FARM (R DOES NOT OWN BUSINESS/FARM);
else if Q5_8=0 then bus2=0;
else bus2=-3;

/*set hours worked variables*/
hrusl1=-4;
array q525 (i) Q5_25_02 Q5_25_01;*R REPORTS MORE THAN ONE JOB OR BUSINESS;
array q526a (i) Q5_26A_02 Q5_26A_01;*NUMBER OF HOURS RESPONDENT USUALLY WORKS AT MAIN JOB;
array q526b (i) Q5_26B_02 Q5_26B_01;*NUMBER OF HOURS R USUALLY WORKS AT MAIN JOB;
array q526c (i) Q5_26C_02 Q5_26C_01;*NUMBER OF HOURS PER WEEK RESPONDENT USUALLY WORKS AT JOB;
array q526d (i) Q5_26D_02 Q5_26D_01;*NUMBER OF HOURS PER WEEK RESPONDENT USUALLY WORKS AT JOB;

do i=1 to 2;
if hrusl1=-4 then do;
if missing(q525) then hrusl=-4;
else if (q526a=-1 | q526c=-1 | q526a=-2 | q526c=-2)
then hrusl1=-2;
else if (q526a=995 | q526c=995) then hrusl1=995;
else if q526a=1 then hrusl1=q526b;
else if q526c=1 then hrusl1=q526d;
end;
end;

hrusl2=-4;
array q528a (i) Q5_28A_02 Q5_28A_01;*R REPORTS AT LEAST 3 OTHER JOBS;
array q528b (i) Q5_28B_02 Q5_28B_01;*NUMBER OF HOURS PER WEEK RESPONDENT USUALLY WORKS AT OTHER JOB;
array q528c (i) Q5_28C_02 Q5_28C_01;*NUMBER OF HOURS R USUALLY WORKS AT OTHER JOB;
array q528d (i) Q5_28D_02 Q5_28D_01;*NUMBER OF HOURS PER WEEK RESPONDENT USUALLY WORKS AT OTHER JOBS;
array q528e (i) Q5_28E_02 Q5_28E_01;*NUMBER OF HOURS PER WEEK R USUALLY WORKS AT OTHER JOBS;

do i= 1 to 2;
if hrusl2=-4 then do;
if missing(q528a) then hrusl2=-4;
else if (q528b=-1| q528d=-1 | q528b=-2 | q528d=-2) then hrusl2=-2;
else if (q528b=1) then hrusl2=q528c;
else if (q528d=1) then hrusl2=q528e;
else hrusl2=-3; 
end;
end;

hruslt=-4;
array q527 (i) Q5_27_02 Q5_27_01;*R REPORTS MORE THAN ONE JOB;

do i=1 to 2;
if hruslt=-4 then do;
if missing(q525) then hruslt=-4;
else if ((hrusl1=-2 & hrusl2=-2) | (hrusl1=-2 & q527~=1)) then hruslt=-2;
else if ((hrusl1=995 & hrusl2=995) | (hrusl1=-2 & hrusl2=995) | 
(hrusl1=995 & hrusl2=-2) | (hrusl1=-2 & q527~=1)) then hurslt=995;
else if (hrusl1=q526b & (hrusl2=-2 | hrusl2=995)) then hruslt= hrusl1;
else if (hrusl1=q526d & (hrusl2=-2 | hrusl2=995)) then hruslt= hrusl1;
else if (q528b=1 & (hrusl1=-2 | hrusl1=995)) then hruslt= hrusl2;
else if (q528d=1 & (hrusl1=-2 | hrusl1=995)) then hruslt= hrusl2;
else if (q526a=1 & q527~=1) then hruslt=q526b;
else if (q526c=1 & q527~=1) then hruslt=q526d;
else if (q526a=1 & q528b=1)then hruslt= (q526b + q528c);*total hours worked, usually;
else if (q526a=1 & q528d=1)then hruslt= (q526b + q528e);
else if (q526c=1 & q528b=1)then hruslt= (q526d + q528c);
else if (q526c=1 & q528d=1)then hruslt= (q526d + q528e);
else hruslt=-3;
end;
end;

hrftpt=-4;
array q530c (i) Q5_30C_02 Q5_30C_01;*R HAS MORE THAN ONE JOB AND DID UNPAID WORK FOR FAMILY LAST WEEK;
array q530g (i) Q5_30G_02 Q5_30G_01;*RESPONDENT USUALLY WORKS 35 HOURS OR MORE PER WEEK IN FAMILY BUSINESS OR FARM;
array q530i (i) Q5_30I_02 Q5_30I_01;*DOES R USUALLY WORK 35 HOURS OR MORE PER WEEK AT JOB?;

do i= 1 to 2;
if hrftpt=-4 then do;
if missing(q530c) then hrftpt=-4;
else if (q530g=-1 | q530i=-1) then hrftpt=-1;
else if (q530g=-2 | q530i=-2) then hrftpt=-2;
else if not missing(q530g) then hrftpt=q530g;
else if not missing(q530i) then hrftpt=q530i;
else hrftpt=-3;
end;
end;

hrwant=-4;
hrwant=Q5_33_01; *DOES RESPONDENT WANT TO WORK FULL TIME?;

hrrsn1=-4;
hrrsn1=Q5_34_01; *MAIN REASON RESPONDENT WORKS PART-TIME;

hrck7=-4;
if ((bus2=-2 | bus2=-1) & (hract1<15 | hract1=-2)) then hrck7=1;*bus2=2???;
else if ((bus2=-2 | bus2=-1) & (hract1>15)) then hrck7=2;
else if ((hruslt>35 or hrftpt=1) & (hractt<35) & (hract1~=-2 | hract2~=-2)) then hrck7=2;
else if ((hrwant=1) & (hractt<35) & (hrrsn1=1 | hrrsn1=2 | hrrsn1=3)) then hrck7=4;
else hrck7=5;

absot=0;
if (hract1=0 & hract2=0) then absot=1;

hrck6=-4;
if ((hract1=0 & hract2=0) & (bus2=-2 | bus2=-1)) then hrck6=1;
else if absot=1 then hrck6=2;
else hrck6=3;

wk=-4;
if not missing(Q5_2) then wk=Q5_2;*R DO ANY WORK FOR PAY LAST WEEK? (R DOES NOT OWN BUS/FARM);
else if not missing(Q5_3) then wk=Q5_3;*R DO ANY WORK LAST WEEK FOR PAY/PROFIT?;

retot=0;
if wk=2 then retot=1;

bus1=Q5_5;*R DO ANY UNPAID WORK IN FAMILY BUSINESS OR FARM LAST WEEK?;
ret1=Q5_10;*DOES R CURRENTLY WANT A JOB (FULL OR PART TIME)? ;
io1cow=Q5_JUMP;*IS R IN ACTIVE MILITARY?;
nlfact=Q5_93;*BEST DESCRIPTION OF RESPONDENT JOB SITUATION;

/*set out of work variables*/
abspd=-4;
if not missing(Q5_22_02) then abspd=Q5_22_02;*IS RESPONDENT BEING PAID BY EMPLOYER FOR TIME OFF LAST WEEK;
else if not missing(Q5_22_01) then abspd=Q5_22_01;*IS RESPONDENT BEING PAID BY EMPLOYER FOR TIME OFF LAST WEEK;

lkavl=-4;
if not missing(Q5_65_02) then lkavl=Q5_65_02;*COULD R HAVE STARTED A JOB LAST WEEK;
else if not missing(Q5_65_01) then lkavl=Q5_65_01;*COULD R HAVE STARTED A JOB LAST WEEK;

layavl=-4;
if not missing(Q5_51_02) then layavl=Q5_51_02;*COULD R HAVE RETURNED TO WORK LAST WEEK IF CALLED?;
else if not missing(Q5_51_01) then layavl=Q5_51_01;*COULD R HAVE RETURNED TO WORK LAST WEEK IF CALLED?;

lkavr=-4;
if not missing(Q5_66_02) then lkavr=Q5_66_02;*REASON FOR NOT BEING ABLE TO TAKE A JOB LAST WEEK;
else if not missing(Q5_66_01) then lkavr=Q5_66_01;*REASON FOR NOT BEING ABLE TO TAKE A JOB LAST WEEK;

layavr=-4;
if not missing(Q5_52_01) then layavr=Q5_52_01;*REASON FOR NOT BEING ABLE TO WORK LAST WEEK IF CALLED;

lk=-4;
if not missing(Q5_60_02) then lk=Q5_60_02;
else if not missing(Q5_60_01) then lk=Q5_60_01;*HAS R DONE ANYTHING TO FIND WORK DURING THE LAST 4 WEEKS;

dis1=-4;
if not missing(Q5_11_02) then dis1=Q5_11_02;*could not find the question;
else if not missing(Q5_11_01) then dis1=Q5_11_01;*DOES DISABILITY PREVENT R FROM ACCEPTING WORK IN NEXT 6 MONTHS;

dis2=-4;
if not missing(Q5_12_02) then dis2=Q5_12_02;*DOES R HAVE A DISABILITY THAT PREVENT R FROM WORKING IN NEXT 6 MONTHS;
else if not missing(Q5_12_01) then dis2=Q5_12_01; *DOES R HAVE A DISABILITY THAT PREVENT R FROM WORKING IN NEXT 6 MONTHS;

dwwnto=-4;
array q578 (i) Q5_78_02 Q5_78_01;*DOES R CURRENTLY WANT A FULL-TIME OR PART-TIME JOB?;

do i= 1 to 2;
if ret1=1 then dwwnto=1;
else if dwwnto=-4 then do;
if q578=1 then dwwnto=1;
else if q578=0 then dwwnto=2;
else if missing(q578) then dwwnto=-4;
else if q578=-2 then dwwnto=-2;
else if q578=-1 then dwwnto=-1;
else if q578=3 then dwwnto=3;
else if q578=4 then dwwnto=4;
else dwwnto=-3;
end;
end;

io1cow=0;
if Q5_JUMP=1 then io1cow=8;

/* sets esr code*/
esr_key=-4;

if ((wk=1 & (hrck6=3 | hrck6=-4 )) | (bus1=1 AND (hrck7=2 | hrck7=3 | hrck7=4 | 
hrck7=5 | hrck7=-4))) then esr_key=1;
else if (abspd=1 | abspd=0 | abspd=-1 | abspd=-2) then esr_key=2;
else if ((layavl=1 | layavl=-1 | layavl=-2) | layavr=1) then esr_key=3;
else if ((lkavl=1 | lkavl=-1 | lkavl=-2) | (lkavr=1 | lkavr=2)) then esr_key=4;
else if ((wk=3 & intage >=50 & ret1=1 & lk=1 & lkavl=0 & (lkavr=3 | lkavr=4 | lkavr=-1 | lkavr=-2)) | 
ret1=0 | (lk=3 & intage>=50) | (dwwnto=3 & intage>=50) | nlfact=5 | retot=1) then esr_key=5;
else if (dis1=1 | dis2=1 | (lk=3 & intage<50) | (dwwnto=3 & intage<50)) then esr_key=6;
else if (Q5_JUMP=1) then esr_key=8;*IS R IN ACTIVE MILITARY?;
else if not missing(CURDATE_M) then esr_key=7;
else esr_key=-5;

/*collapsed esr*/
esr_col=0;
if (esr_key=-5) then esr_col=-5;
else if (esr_key=1 | esr_key=2) then esr_col=1;
else if (esr_key=3 | esr_key=4) then esr_col=2;
else if (esr_key>=4 and esr_key<=7) then esr_col=3;
else if Q5_JUMP=1 then esr_col=4;
else esr_col=esr_key;run;

NLSY79 Attachment 106: Profiles of American Youth (ASVAB Data/AFQT Scores)

Information about the administration of the Armed Services Vocational Aptitude Battery (ASVAB) to NLSY79 respondents is available in PDF format. This documentation also includes information about the creation of the associated Armed Forces Qualification Test (AFQT) scores. Information includes:

Part 1: General & Technical Information (PDF)

  • Background and General Information (page 2)
  • Data Quality Analysis with Item Response Curve Models (page 5)
  • Annotated Bibliography of DoD Related Publications (page 25)
  • Addendum to Attachment 106 (page 34) -- describing additional subtest standard scores and the creation of revised AFQT scores in 1990

Part 2: Respondent Materials (PDF)

  • Two brochures given to NLSY79 respondents about their participation in the ASVAB testing and interpretation of their scores

NLSY79 Attachment 103: Religion Codes

Table: Religion codes
Code Religion

Code

Religion

0

None

229

Evangelical Friends

1

Protestant, etc.

230

Evangelical United Brethren

2

Baptist

231

Foursquare Gospel

3

Episcopalian

232

Free Christian Zion

4

Lutheran

233

Free Will Baptist

5

Methodist

234

Friends, Quaker

6

Presbyterian

235

Full Gospel

7

Roman Catholic

236

Fundamental

8

Jewish

237

Church of Holiness

101

Armenian Church

238

Jehovah's Witness

102

Baha'i

239

Latter Day Saints, Mormon

103

Buddhist

240

Latter Day Saints Reorganized

104

Confucian

241

Mennonite

105

Eastern Orthodox

242

Mennonite Reformed

106

Greek Orthodox

243

Missionary

107

Hindu

244

Moravian

108

Moslem

245

Nazarene

109

Muslim

246

New Apostolic

110

Russian Orthodox

247

Northern Baptist

111

Shinto

248

Open Bible

112

Sikh

249

Pentecostal

113

Taoist

250

Pentecostal Assembly of God

201

Advent Christian

251

Pentecostal Church of God

202

African Methodist

252

Pentecostal Free Will Baptist

203

African Methodist Episcopal

253

Pentecostal Holiness

204

African Methodist Episcopal-Zion

254

Pilgrim Holiness

205

Apostolic

255

Plymouth Brethren

206

Apostolic Faith

256

Primitive Baptist

207

Apostolic Pentecostal

257

Dutch Reformed

208

Assembly of God

258

Reformed Church of Christ

209

Bible Church, Independent

259

Reformed United Church of Christ

210

Brethren Church

260

Salvation Army

211

Christadelphian

261

Seventh Day Adventist

212

Christ in Christian Union

262

Southern Baptist

213

Christian, Disciples of Christ

263

Spiritualist

214

Christian and Missionary Alliance

264

Swedish Mission

215

Christian Catholic

265

Triumph the Church of the Kingdom

216

Christian Methodist-Episcopal

266

Unitarian Universalist

217

Christian Reformed

267

United Brethren in Christ

218

Christian Science

268

United Church of Christ

219

Church of Christ

269

United Holiness

220

Church of God

270

Wesleyan

221

Church of God in Christ

271

Wesleyan Methodist

222

Church of the Living God

272

Witness Holiness

223

Congregational

273

Zion Union

224

Conservative Baptist

274

Zion Union Apostolic

225

Evangelical

275

Zion Union Apostolic Reformed

226

Evangelical Reformed

300

Other Protestant

227

Evangelical Congregational

301

Other Non-Christian

228

Evangelical Mission Covenant    
Protestant denomination codes for R6558., R6583., R6586., R6613., R6616.

Code

Denomination

Code

Denomination

01

Hungarian Reformed

50

First Reformed

02

Evangelical Congregational

51

First Christian

03

Ind Bible, Bible, Bible Fellowship

52

Full Gospel

04

Eckankar

53

Four Square Gospel

05

Church of Prophecy

54

Friends

06

New Testament Christian

55

Holy Roller

07

Church of God, Saint, & Christ

56

Holiness; Church of Holiness

08

Moravian

57

Pilgrim Holiness

09

Christian & Missionary Alliances

58

Jehovah's Witness

10

Advent Christian

59

LDS

11

Spiritualist

60

LDS--Mormon

12

Assembly of God

61

LDS--Reorganized

13

Free Methodist

62

LDS--Jesus Christ; Church of Jesus LDS

14

Apostolic Faith

63

Mennonite

15

African Methodist

64

Mormon

16

Free Will Baptist

65

Nazarene

17

Eden Evangelist

66

Pentecostal Assembly of God

18

Holiness (Nazarene)

67

Pentecostal Church of God

19

Baptist (Northern)

68

Pentecostal

20

Brethren Church, Brethren

69

Pentecostal Holiness, Holiness Pentecostal

21

Witness Holiness

70

Quaker

22

Brethren, Plymouth

71

Reformed

23

United Brethren, United Brethren in Christ

72

Reformed United Church of Christ

24

Independent

73

Reformed Church of Christ

25

Christian Disciples

74

Religious Science

26

Christ in Christian Union

75

Mind Science

27

Open Bible

76

Salvation Army

28

Christian Catholic

77

7th Day Adventist

29

Christ Church Unity

78

Sanctified, Sanctification

30

Christ Adelphians

79

United Holiness

31

Christian; Central Christian

80

Unitarian, Universalist

32

Christian Reform

81

United Church of Christ

33

Christian Scientist

82

United Church, Unity Church

34

Church of Christ, Evangelical

83

Wesleyan

35

Church of Christ

84

Wesleyan Methodist--Pilgrim

36

Churches of God (Except with Christ and Holiness)

85

Zion Union

37

Church of God in Christ

86

Zion Union Apostolic

38

Church of God in Christ Holiness

87

Zion Union Apostolic--Reformed

39

Church of the Living God

88

Disciples of God

40

Congregationalist, First Congregation

89

Grace Reformed

41

Community Church

90

Holiness Church of God

42

Covenant

91

Evangelical Covenant

43

Dutch Reform

92

Mission Covenant

44

Disciplines of Christ

93

Missionary Baptist

45

Evangelical, Evangelist

94

Swedish Mission

46

Evangelical Reformed

95

Unity

47

Evangelist Free Church

96

United Church of Christianity

48

First Church

00

Other Fundamentalist

49

First Christian Disciples of Christ    
Subscribe to NLSY79