/******************************************************************************************************* This program creates the following education variables for survey year 2021 variable name in variable name the program in the NLS ------------------------------------------------------ ENCAT CV_ENROLLSTAT GRSURV CV_HGC_EVER_EDT DEGSURV CV_HIGHEST_DEGREE_EVER_EDT GRSURV_CVC CVC_HGC_EVER DEGSURV_CVC CVC_HIGHEST_DEGREE_EVER *******************************************************************************************************/ options nocenter nolabel linesize=100 pagesize=40; libname xin20; libname xin19; data one; set xin19.out_hgcR19; locatorr19=locator; locar19=loca; locfr19=locf; grsurvFr19=grsurvF; chk31r19=chk31; chk32r19=chk32; chk33r19=chk33; chk5r19=chk5; chk11r19=chk11; chk12r19=chk12; chk13r19=chk13; chk14r19=chk14; chk22r19=chk22; clg_okr19=clg_ok; chk1encr19=chk1enc; chk1gedr19=chk1ged; chk2r19=chk2; chk3r19=chk3; hgcYr19=graug; keep pubid he2_en he3_en he4_en he5_en he6_en he7_en he8_en he9_en he10_en he11_en he12_en he13_en he14_en he15_en he16_en he17_en he18_en he19_en locatorr: locar: grsurvFr: locfr: he2_dg he3_dg he4_dg he5_dg he6_dg he7_dg he8_dg he9_dg he10_deg he11_deg he12_deg he13_deg he14_deg he15_deg he16_deg he17_deg he18_deg he19_deg chk31r: chk32r: chk33r: chk5r: chk11r: chk12r: chk13r: chk14r: chk22r: clg_okr: chk1encr: chk1gedr: chk2r: chk3r: hgcYr17 hgcYr18 hgcYr19; data two; set xin20.out_date_dgR20; cvc_hgcr19=hgcr19; cvc_hdgr19=CVC_HIGHEST_DEGREE_EVER_XRND; keep pubid gdr1-gdr19 hsr1-hsr19 aar3-aar19 bar4-bar19 mar6-mar19 dcr10-dcr19 pfr9-pfr19 CDTGD CDTHS CDTAA CDTBA CDTMA CDTDC CDTPF scoder1_1-scoder1_2 scoder2_1-scoder2_6 scoder3_1-scoder3_7 scoder4_1-scoder4_5 scoder5_1-scoder5_6 scoder6_1-scoder6_5 scoder7_1-scoder7_5 scoder8_1-scoder8_5 scoder9_1-scoder9_4 scoder10_1-scoder10_5 scoder11_1-scoder11_5 scoder12_1-scoder12_8 scoder13_1-scoder13_3 scoder14_1-scoder14_5 scoder15_1-scoder15_4 scoder16_1-scoder16_4 scoder17_1-scoder17_4 scoder18_1-scoder18_6 scoder19_1-scoder19_5 scoder20_1-scoder20_3 stopmr20: stopyr20: strtmr20: strtyr20: e11700: e11900: e13300: e13500: e27337r20_1-e27337r20_3 e23450r20_1-e23450r20_3 t7000r20_1-t7000r20_6 intdr20 intmr20 intyr20 lftscr20_1-lftscr20_3 doicmR: e3112r: e3113r: hdgr1-hdgr19 hdgYr1-hdgYr19 encatr1-encatr19 cvc_hgcr19 cvc_hdgr19; data three; set xin20.in_C_HGCr20; data four; set xin20.in_P_Rostr_HGCr20; data final; merge one two three four; by pubid; ********************************************** SECTION I **********************************************; ** Initialize and define variables; ENROLL=-3; * Indicates if R currently enrolled; ENCAT=-3; * Enrollment status variable (including educational attainment); HSD=0; * Indicates if R has a H. S. Diploma (check previous rounds); GED=0; * Indicates if R has a GED (check previous rounds); hgsch=0; * Indicates if R is currently attending grades 1-12 & no HSD or GED; college=0; * Indicates if R is in college and working towards a undergrad (=1) or grad degree (=2); attsch=0; * Indicates if R attended elementary, middle or high school; flagcoll=0; * Indicates if Rs currently attending grades 1-12, no HSD or GED but enrolled in college and working towards a grad or undergrad degree; flaghs=0; * Indicates if Rs who have a H.S. Diploma and HGC=12 but still report enrollment in school; somecoll=0; * Indicates if Rs have attended a college (in a degree program) in current or previous rounds; prevcoll=0; * Indicates if Rs have attended a college (in a degree program) in previous rounds. This pertains to those actually enrolled in a degree program in college only; currcoll=0; * Indicates if Rs have attended a college (in a degree program) in current round. This pertains to those enrolled in a college and reporting to be working towards a degree program. They may or may not be enrolled in a degree program.; clg_ok=-4; * Indicates if R being in college (as reported in this round) w/o GED/HSD is OK. That is if R is actually enrolled in a degree program. This pertains to currcoll and not prevcoll.; last_enr=0; * Identifies the last round when R was enrolled; ungraded=0; * Indicates Rs with no H.S. Diploma or GED have HGA=95 (ungraded); same_mth=0; * Indicates Rs who received a degree in the same month as the interview.; both=0; * Indicates that R reports receiving both GED and H. S. Diploma; rosprb1=0; * Indicates Rs with scode(i) in (4,5) but e27337(i)=-4; rosprb2=0; * Indicates Rs with scode(i)=-4 but e27337(i)>-4; chk_comm=0; * Indicates if R reports college in this round although R does not report receiving GED or H.S. Diploma, by this round. Check the comments in current round to see whether they were actually enrolled in a degree program in a college.; chk_commP=0; * Indicates if ENCAT in any prior rounds shows college although R does not report receiving GED or HS Diploma, by those rounds. Check the comments in current and earlier rounds for these cases to see whether they were actually enrolled in a degree program in a college.; hgc_hga=0; * Indicates if Rs reporting HGC greater than HGA; hgc_hga_n=-4; * Indicates if Rs reporting HGC greater than HGA, after HGC and HGA were edited for those never enrolled at or since DLI such that they remained the same as those at DLI.; ************************************************************** ** dlicm: date of last interview ** ** dli_rnd: the last round that R was interviewed ** ** doicm: date of current interview ** ** enroll_Rx: whether enrolled in earlier rounds ** ** encatP: ENCAT when last interviewed ** ** hgaloop: highest grade attended (from loops) ** ** hgcloop: highest grade completed (from loops) ** ** hgcdt: date of completion of hgcloop ** **************************************************************; MONYR=500; YEAR=2021; MONTH=8; doicm_LR=doicmr19; *** Define arrays to be used later in the program; array scode (*) scoder20_1-scoder20_3; array e27337 (*) e27337r20_1-e27337r20_3; array e23450 (*) e23450r20_1-e23450r20_3; array strtm (*) strtmr20_11-strtmr20_13 strtmr20_21-strtmr20_22; array strty (*) strtyr20_11-strtyr20_13 strtyr20_21-strtyr20_22; array stopm (*) stopmr20_11-stopmr20_13 stopmr20_21-stopmr20_22; array stopy (*) stopyr20_11-stopyr20_13 stopyr20_21-stopyr20_22; array degre (*) e27337r20_1-e27337r20_3 e27337r20_1-e27337r20_2; array codes (*) scoder20_1-scoder20_3 scoder20_1-scoder20_2 ; array reasn (*) lftscr20_1-lftscr20_3 lftscr20_1-lftscr20_2 ; array stpcm (*) stpcm11-stpcm13 stpcm21-stpcm22; array strcm (*) strcm11-strcm13 strcm21-strcm22; array gratnd (*) e8416r20_11 e8416r20_21 dum; array e6784 (*) e6784r20_1-e6784r20_3; array e7142 (*) e7142r20_11 e7142r20_21 e7142r20_31; array e7192 (*) e7192r20_1-e7192r20_3; array e6938 (*) e6938r20_1 dum dum; array e6943 (*) e6943r20_11 dum dum; array doicmR (*) doicmr1-doicmr19; array encatR (*) encatr1-encatr19; array enrollR (*) enrollr1-enrollr19; array graugR (*) hgcr1 hgcYr2-hgcYr19; array grsurvR (*) hgcr1-hgcr18 cvc_hgcr19; array hgaR (*) e3500r1 e2857r2-e2857r19; array hgcR (*) e5000r1 e3112r2-e3112r19; array gdR (*) gdr1-gdr19; array hsR (*) hsr1-hsr19; array locaR (*) dum locar2-locar19; array chk31R (*) chk31r1-chk31r19; array chk32R (*) chk32r1-chk32r19; array chk1encR (*) chk1encr1-chk1encr19; array chk1gedR (*) chk1gedr1-chk1gedr19; array chk2R (*) chk2r1-chk2r19; array chk3R (*) chk3r1-chk3r19; array chk5R (*) chk5r1-chk5r19; array scoder [19,8] scoder1_1-scoder1_2 dum dum dum dum dum dum scoder2_1-scoder2_6 dum dum scoder3_1-scoder3_7 dum scoder4_1-scoder4_5 dum dum dum scoder5_1-scoder5_6 dum dum scoder6_1-scoder6_5 dum dum dum scoder7_1-scoder7_5 dum dum dum scoder8_1-scoder8_5 dum dum dum scoder9_1-scoder9_4 dum dum dum dum scoder10_1-scoder10_5 dum dum dum scoder11_1-scoder11_5 dum dum dum scoder12_1-scoder12_8 scoder13_1-scoder13_3 dum dum dum dum dum scoder14_1-scoder14_5 dum dum dum scoder15_1-scoder15_4 dum dum dum dum scoder16_1-scoder16_4 dum dum dum dum scoder17_1-scoder17_4 dum dum dum dum scoder18_1-scoder18_6 dum dum scoder19_1-scoder19_5 dum dum dum; array degR (*) hdgr1-hdgr18 cvc_hdgr19; *** initiate the cvc_ variables; if e3112r20=-5 then do; grsurv=cvc_hgcr19; degsurv=cvc_hdgr19; end; *** Create intermediate variables to be used in the program later.; ** Checking int dates; doicmr20=-5; if intyr20 ne -5 then doicmr20=(intyr20-1980)*12+intmr20; if doicmr20~=-5 then doicm=doicmr20; * Whether received GED, ever; if CDTGD>-4 then GED=1; * Whether received HS Diploma, ever; if CDTHS>-4 then HSD=1; * Whether received both GED and HS Diploma, ever; if HSD=1 & GED=1 then both=1; * Compute dlicm and dli_rnd; do j=1 to dim(doicmR); if doicmR(j)~=-5 then do; dlicm=doicmR(j); dli_rnd=j; do k=1 to 8; if scoder(j,k) in (4,5) then ever_24yrinst=1; end; end; end; hsrp=hsr19; gdrp=gdr19; if HSD=0 & hsrP>-4 then hsrP=-4; if GED=0 & gdrP>-4 then gdrP=-4; * Enrollment status at each interview and ENCAT at last interview; do i=1 to dim(doicmR); if encatR(i) in (8,9,10,11) then enrollR(i)=1; if encatR(i) in (1,2,3,4,5,6,7) then enrollR(i)=0; if -5-5 then graugP=graugR(i); if locaR(i)>-5 then locaP=locaR(i); end; grsurvP=cvc_hgcr19; grsurvP_no3061=grsurvP; if 00 & stopy(i)>0 then stpcm(i)=((stopy(i)-1980)*12)+stopm(i); if -40 & strty(i)>0 then strcm(i)=((strty(i)-1980)*12)+strtm(i); if -4-4 then rosprb2=1; if scode(i) in (-2,-3) then INV1=1; if scode(i) in (4,5,6) & e27337(i) in (-2,-3) then INV2=1; end; do i=1 to dim(strcm); if strcm(i)=-3 then INV3=1; if stpcm(i)=-3 then INV3=2; if strcm(i)=-3 & stpcm(i)=-3 then INV3=3; end; * Last regular school enrolled in, its start and stop date of enrollmnet, type of school and degree working towards & school loop number; STOP=-4; do i=1 to dim(degre); if stpcm(i)>STOP then do; STOP=stpcm(i); STRT=strcm(i); sch=codes(i); deg=degre(i); rosnum=i; STOP_loc=1; end; if stpcm(i)=STOP & sch in (4,5,6) & codes(i)=sch & deg in (1,3,4,5,6,10) & degre(i)=deg then do; STOP=stpcm(i); STRT=strcm(i); sch=codes(i); deg=degre(i); rosnum=i; STOP_loc=2; end; if 0=STRT>0 then do; STOP=stpcm(i); STRT=strcm(i); sch=codes(i); deg=degre(i); rosnum=i; STOP_loc=7; end; if stpcm(i)=STOP & STOP=doicm & 00 then diff=doicm-STOP; do i=1 to dim(degre); if rosnum=i then do; if STOP=doicm & stpcm(i)=doicm & reasn(i)>-4 then diff=10000; end; end; do i=1 to dim(degre); if strcm(i)>=-3 & stpcm(i)>=-3 then lastloopnum=i; end; * Whether the last school attended was High School or College, and if the latter then for what degree?; if sch in (-1,-2,-3) then lastsch=-3; if sch in (1,2,3) then lastsch=1; if sch in (4,5,6) and deg in (1,3,4,5,6,10) then lastsch=2; if sch in (4,5,6) and deg in (2,7,8,999,11,12) then lastsch=2.1; if sch in (4,5,6) and deg in (9, 13) then lastsch=2.2; if sch in (4,5,6) and deg in (-1,-2,-3) then lastsch=2.3; if sch in (4,5,6) and deg=-4 then lastsch=2.4; * - When R attended college (in a degree program) in a previous round; do i=1 to dim(encatR); if encatR(i) in (4,5,6,7,9,10,11) & degR(i)>=1 then prevcoll=1; if encatR(i) in (4,5,6,7,9,10,11) & degR(i)<1 then do; prevcoll=1; chk_commP=1; if hsr19>-4|gdr19>-4 then chk_commP=2; end; end; do i=1 to dim(encatR); if (e2806r20=-4|e2806r20>=13) & encatR(i) in (4,5,6,7,9,10,11) & (hsR(i)>-4|gdR(i)>-4) then prevcoll=1; if (e2806r20=-4|e2806r20>=13) & encatR(i) in (4,5,6,7,9,10,11) & hsR(i)=-4 & gdR(i)=-4 then do; prevcoll=1; chk_commP=1; if 0hgaloop then do; hgaloop=gratnd(i); end; end; if (1<=e2857r20<=12) & HSD=0 & GED=0 then hgsch=1; do i=1 to dim(scode); if scode(i) in (1,2,3) then attsch=1; end; do i=1 to dim(e27337); if e27337(i) in (1,3) then college=1; if e27337(i) in (4,5,6,10) then college=2; if e27337(i) in (-1,-2,-3) then college=-3; end; if 0<=e2857r200 then ENROLL=0; if -3<=STOP<=-1 then ENROLL=0; if e3877A1r20=0 then ENROLL=0; do i=1 to dim(scode); if scode(i) in (4,5,6) then chk_enr2=0; end; if HSD=1 & ENROLL=1 & chk_enr2 ne 0 then do; chk_enr2=1; ENROLL=0; end; *** ENRollx; ** Computing ENROLL by another method - ENROLLx; if e3877A1r20=0 then enrollx=0; if e4795r20=1 & e4951r20=0 then enrollx=1; if e4795r20=0 then do; if e1605r20=-4 & e4951r20=0 then enrollx=0; if e1605r20=1 then do; if e1615r20_1=1 & e4951r20=0 then enrollx=1; if e1615r20_1=0 & e4951r20=0 then enrollx=0; end; if e1605r20=0 and e4951r20=0 then enrollx=0; end; if (e4951r20=1 or e3877A1r20=1) then do; do i=1 to dim(e6784); if e6784(i)=1 & e7192(i)=0 then enrollx=1; end; do i=1 to dim(e6784); if e6938(i)=0 & e7192(i)=0 then enrollx=0; end; do i=1 to dim(e6784); if e6784(i)=0 & e7192(i)=0 then do; if e6943(i)=1 then enrollx=1; end; end; do i=1 to dim(e6784); if e7142(i)=0 & e7192(i)=0 then enrollx=0; end; end; *** change "enroll" after going through the cases where "enroll" disagrees with "enrollx"; oldenroll=enroll; if oldenroll=0 & enrollx=1 & diff=10000 & rosnum>=4 then enroll=1; *** (IB) Determining the sub-categories of not enrolled; if ENROLL=0 then do; if (GED<=0) & (HSD<=0) then ENCAT=1; if GED=1 then ENCAT=2; if HSD=1 then ENCAT=3; if prevcoll=1 then ENCAT=4; if currcoll=1 & ((13<=e2857r20<=20)|e3112r20>=12|HSD=1|GED=1|somecoll=1) then ENCAT=4; if CDTAA>-4 then ENCAT=5; if CDTBA>-4 then ENCAT=6; if CDTMA>-4|CDTDC>-4|CDTPF>-4 then ENCAT=7; end; *** (IC) Determining the sub-categories of enrolled; if ENROLL=1 then do; if lastsch=1 then do; if CDTHS>0 & e3112r20=12 then flaghs=1; if (1<=e2857r20<=12) & HSD<=0 & GED<=0 then ENCAT=8; if e2857r20=13 & HSD=0 & GED=0 then ENCAT=8; if e2857r20=95 & HSD=0 & GED=0 then do; ENCAT=8; ungraded=1; end; end; if lastsch=2 then do; if sch=4 & deg in (1,3,4,5,6,10) & ((13<=e2857r20<95)|e3112r20>=12|GED=1|HSD=1|clg_ok=1) then ENCAT=9; if sch=5 & deg in (1,3,4,5,6,10) & ((13<=e2857r20<95)|e3112r20>=12|GED=1|HSD=1|clg_ok=1) then ENCAT=10; if sch in (5,6) & deg in (4,5,6,10) & ((16=16) then ENCAT=11; if sch in (5,6) & deg in (4,5,6,10) & CDTBA>-4 then ENCAT=11; if sch=6 and ENCAT ne 11 then gradsch=1; if (1<=e2857r20<=12) & HSD=0 & GED=0 & somecoll~=1 then do; ENCAT=8; flagcoll=1; end; end; if lastsch>2 then do; if GED=0 & HSD=0 & somecoll=0 then ENCAT=8; if currcoll=0 & prevcoll=1 then do; ENCAT=4; if CDTAA>-4 then ENCAT=5; if CDTBA>-4 then ENCAT=6; if CDTMA>-4|CDTDC>-4|CDTPF>-4 then ENCAT=7; end; if currcoll=1 & (HSD=1|GED=1|clg_ok=1) then do; ENCAT=4; if CDTAA>-4 then ENCAT=5; if CDTBA>-4 then ENCAT=6; if CDTMA>-4|CDTDC>-4|CDTPF>-4 then ENCAT=7; end; end; if lastsch=-3 then do; if (HSD=1|GED=1|clg_ok=1) & currcoll=1 then ENCAT=4; if prevcoll=1 then ENCAT=4; if CDTAA>-4 & somecoll=1 then ENCAT=5; if CDTBA>-4 & somecoll=1 then ENCAT=6; if (CDTMA>-4|CDTDC>-4|CDTPF>-4) & somecoll=1 then encat=7; end; if GED=1 & HSD=0 & somecoll=0 then ENCAT=2; if HSD=1 & somecoll=0 then ENCAT=3; end; if CDTHS>0 & doicm=CDTHS & ENCAT in (-3,1,2,8) then do; ENCAT=3; same_mth=1; end; if CDTGD>0 & doicm=CDTGD & ENCAT in (-3,1,8) then do; ENCAT=2; same_mth=1; end; if CDTAA>0 & doicm=CDTAA & ENCAT in (-3,1,2,8,3,4,9) then do; ENCAT=5; same_mth=1; end; if CDTBA>0 & doicm=CDTBA & ENCAT in (-3,1,2,8,3,4,5,10) then do; ENCAT=6; same_mth=1; end; if ((CDTMA>0 & doicm=CDTMA)|(CDTDC>0 & doicm=CDTDC)|(CDTPF>0 & doicm=CDTPF)) & ENCAT~=7 then do; ENCAT=7; same_mth=1; end; if ENROLL=1|(ENROLL=0 & e3877A1r20~=0) then do; if lastsch=-3 & ENCAT<0 then do; ENCAT=-3; reason=1; end; if INV2=1 then do; flagcoll=-3; college=-3; if enroll=0 & somecoll=0 & lastsch=2.3 then do; ENCAT=-3; reason=2.2; end; end; if (HSD=1|GED=1) & (13<=e2857r20<95) & (12<=e3112r20<95) then do; tmpvar1=ENCAT; tmpvar2=reason; ENCAT=-3; reason=3; do i=1 to dim(scode); if scode(i) in (-1,-2,-3,4,5,6) | prevcoll=1 then do; ENCAT=tmpvar1; reason=tmpvar2; end; end; end; if (13<=e2857r20<=20) & GED=0 & HSD=0 & clg_ok~=1 & currcoll=1 & prevcoll~=1 then do; ENCAT=-3; reason=5; end; if rosprb1=1 & ENCAT=-3 & reason=. then reason=6; end; ********************************************** SECTION II **********************************************; if ENCAT in (1,2,3,4,5,6,7) & ENROLL~=0 then do; ENROLL=0; enr_chg=2; end; if ENCAT in (8,9,10,11) & ENROLL~=1 then do; ENROLL=1; enr_chg=3; end; subsitm=0; subhgam=0; subprev=0; setto12=0; dateitm=0; disagre=0; datedeg=0; ******************************************************************************************************** *** [II] CREATED VARIABLE - HIGHEST GRADE COMPLETED AS OF THE SURVEY DATE (GRSURV) *** ********************************************************************************************************; GRSURV=GRSURVP; LOCATOR=1; GRAUG=GRAUGP; LOCA=1; if ENCAT in (4,5,6,7,9,10,11) & e3112r20 in (1,2,3,4,5,6) then do; inclg_lowHGC=1; e3112r20_imp=e3112r20+12; end; ***** For those who are asked of 3112; if (e3112r20>12 & (currcoll_1=1 or prevcoll=1)) or (e3112r20=12 & cdths ne hsr19) or (0<=e3112r20<12 & attsch=1) or (-4e3112r20+1 & e3112r20>GRSURVP>=0 then gr_ncomp1=3; if e2857r20>e3112r20+1 & 0<=e3112r2012 then GRSURV=e3112r20_imp; else inclg_lt12=1; LOCATOR=5.2; end; if currcoll=1 & 0<=grsurvP<95 & 0<=e3112r20<95 then inclgCI_grchg=e3112r20-grsurvP; if currcoll=0 & prevcoll=1 & encatP in (4,5,6,7,9,10,11) & 0<=grsurvP<95 & 0<=e3112r20<95 then inclgDLI_grchg=e3112r20-grsurvP; ** check on disagre; if 0-4|gdrP>-4) & GRSURV<12 & grsurvP>=12 then do; disagre=0.5; subsprev=1; GRSURV=grsurvP; LOCATOR=6.10; end; if disagre=1 then do; if 1<=dli_rnd<=15 then rnd_dif= YEAR-(1996 + dli_rnd)+1; else if dli_rnd>15 then rnd_diff= YEAR-(2011 + (dli_rnd -15)*2)+1; sitm_pr=e3112r20-grsurvP; if ENCAT in (1,8,-3) then do; if ENCAT=-3 then do; GRSURV=-3; if e3112r20<=12|e3112r19=95 then GRAUG=-3; LOCATOR=6.11; LOCA=6.11; end; if 0<=e3112r20<=12 & (0<=sitm_pr<=rnd_dif|grsurvP=95) then do; subsitm=1; GRSURV=e3112r20; LOCATOR=6.12; GRAUG=e3112r20; LOCA=6.12; end; end; if 12<=grsurvP<95 & ENCAT in (4,5,6,7,9,10,11) then do; GRSURV=grsurvP; subprev=1; LOCATOR=6.21; if currcoll=1 then do; subsitm=1; if 0<=sitm_pr<=rnd_dif then do; GRSURV=e3112r20; LOCATOR=6.22; end; if e3112r20_imp>grsurvP then do; GRSURV=e3112r20_imp; LOCATOR=6.23; end; end; end; end; if 0-4|gdrP>-4) & GRSURV~=grsurvP & 00 then do; if 0MONYR>0) then do; GRAUG=-3; LOCA=12.4; end; if (hsrP>-4|gdrP>-4) & 0<=grsurvP<=12 & GRAUG12 but R is not in a college-degree program we assign the HGC in highschool as the HGC received.; if ENCAT in (1,2,3,8,-3) & (12=12 & GRAUG~=12 then do; GRAUG=12; LOCA=16; end; if grsurvP<=12 & GRSURV>=12 & attsch=0 & (GRAUG=.|GRAUG=-3) & ENCAT in (4,5,6,7,9,10,11) then do; GRAUG=grsurvP; LOCA=17; end; if 12-4 then DEGSURV=3; ** Bachelor's Degree; if CDTBA>-4 then DEGSURV=4; ** Master's Degree; if CDTMA>-4 then DEGSURV=5; ** Doctoral Degree; if CDTDC>-4 then DEGSURV=6; ** Professional Degree; if CDTPF>-4 then DEGSURV=7; ** If cannot determine what degree received; do i=1 to dim(e23450); if e23450(i) in (-1, -2, -3) & DEGSURV not in (4 5 6 7) then DEGSURV=-3; end; if 0<=DEGSURV=0 then do; DEGAUG=degsurvP; end; if (cdtgd=gdr19 & cdths=hsr19 & cdtaa=aar19 & cdtba=bar19 & cdtma=mar19 & cdtpf=pfr19 & cdtdc=dcr19) then do; if he19_deg ne . then do; he20_deg=degsurv; degsurv=-3; degaug=-3; if encatr19=-3 & encat in (1,2,3,5,6,7) then do; he20_en=encat; encat=-3; end; end; else if degsurv ne degsurvP then chk21=1; end; if ENCAT in (-1,-2) then ENCAT=-3; if GRSURV in (-1,-2) then GRSURV=-3; if GRAUG in (-1,-2) then GRAUG=-3; if DEGSURV in (-1,-2) then DEGSURV=-3; if DEGAUG in (-1,-2) then DEGAUG=-3; ***** generate GRSURVF which is used to generate HGC in LEFT_HS program; grsurvFP=grsurvFr19; grsurvF=grsurvFP; locF=6; if (e3112r20>12 & (currcoll_1=1 or prevcoll=1)) or (e3112r20=12 & cdths ne hsr19) or (0<=e3112r20<12 & attsch=1) or (-4-4|gdrP>-4|grsurvFP=12 then do; grsurvF=grsurvFP; locF=4.1; if grsurvFP=-3 then do; if 0-4 & 0<=grsurv_cvc<12 & degsurv_cvc ne -3 then chk31=1; if cdths=-4 & grsurv_cvc=12 & degsurv_cvc ne -3 then chk32=1; if degsurv_cvc>2 & 0<=grsurv_cvc<=12 then chk33=1; if e3877A1r20=0 & grsurv_cvc ne cvc_hgcr19 then chk11=1; if 0