/******************************************************************************************************* ** ** This program creates the following education variables ** ** 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 The program follows the program DATE_DGR21.sas. Refer to DATE_DGR21.sas for the variables used in this program. *******************************************************************************************************/ options nocenter nolabel linesize=100 pagesize=40; libname xin20; libname xin21; data one; set xin20.out_hgcR20; locatorr20=locator; locar20=loca; locfr20=locf; grsurvFr20=grsurvF; chk31r20=chk31; chk32r20=chk32; chk33r20=chk33; chk5r20=chk5; chk11r20=chk11; chk12r20=chk12; chk13r20=chk13; chk14r20=chk14; chk22r20=chk22; clg_okr20=clg_ok; chk1encr20=chk1enc; chk1gedr20=chk1ged; chk2r20=chk2; chk3r20=chk3; hgcYr20=graug; keep id 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 he20_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 he20_deg chk31r: chk32r: chk33r: chk5r: chk11r: chk12r: chk13r: chk14r: chk22r: clg_okr: chk1encr: chk1gedr: chk2r: chk3r: hgcYr17 hgcYr18 hgcYr19 hgcYr20; data two; set xin21.out_date_dgR21; cvc_hgcr20=hgcr20; cvc_hdgr20=CVC_HIGHEST_DEGREE_EVER_XRND; keep id pubid gdr1-gdr8 gdr20 hsr1-hsr8 hsr20 aar3-aar8 aar20 bar5-bar8 bar20 mar6-mar8 mar20 dcr20 pfr20 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 scoder21_1-scoder21_3 stopmr21: stopyr21: strtmr21: strtyr21: e11700: e11900: e13300: e13500: e27337r21_1-e27337r21_3 e23450r21_1-e23450r21_3 t7000r21_1-t7000r21_6 intdr21 intmr21 intyr21 lftscr21_1-lftscr21_3 doicmR: e3112r: e3113r: hdgr1-hdgr20 hdgYr1-hdgYr20 encatr1-encatr20 cvc_hgcr20 cvc_hdgr20; data three; set xin21.in_C_HGCr21; data four; set xin21.in_P_Rostr_HGCr21; data final; merge one two three four; by id; ********************************************** 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=524; YEAR=2023; MONTH=8; doicm_LR=doicmr20; *** Define arrays to be used later in the program; array scode (*) scoder21_1-scoder21_3; array e27337 (*) e27337r21_1-e27337r21_3; array e23450 (*) e23450r21_1-e23450r21_3; array strtm (*) strtmr21_11-strtmr21_13 strtmr21_21-strtmr21_22 strtmr21_31; array strty (*) strtyr21_11-strtyr21_13 strtyr21_21-strtyr21_22 strtyr21_31; array stopm (*) stopmr21_11-stopmr21_13 stopmr21_21-stopmr21_22 stopmr21_31; array stopy (*) stopyr21_11-stopyr21_13 stopyr21_21-stopyr21_22 stopyr21_31; array degre (*) e27337r21_1-e27337r21_3 e27337r21_1-e27337r21_2 e27337r21_1; array codes (*) scoder21_1-scoder21_3 scoder21_1-scoder21_2 scoder21_1; array reasn (*) lftscr21_1-lftscr21_3 lftscr21_1-lftscr21_2 lftscr21_1; array stpcm (*) stpcm11-stpcm13 stpcm21-stpcm22 stpcm31; array strcm (*) strcm11-strcm13 strcm21-strcm22 strcm31; array gratnd (*) e8416r21_11 e8416r21_12 dum; array e6784 (*) e6784r21_1-e6784r21_2 dum; array e7142 (*) e7142r21_11 e7142r21_21 dum; array e7192 (*) e7192r21_1-e7192r21_2 dum; array e6938 (*) e6938r21_1-e6938r21_2 dum; array e6943 (*) e6943r21_11 dum dum; array doicmR (*) doicmr1-doicmr20; array encatR (*) encatr1-encatr20; array enrollR (*) enrollr1-enrollr20; array graugR (*) hgcr1 hgcYr2-hgcYr20; array grsurvR (*) hgcr1-hgcr19 cvc_hgcr20; array hgaR (*) e3500r1 e2857r2-e2857r20; array hgcR (*) e5000r1 e3112r2-e3112r20; array gdR (*) gdr1-gdr20; array hsR (*) hsr1-hsr20; array locaR (*) dum locar2-locar20; array chk31R (*) chk31r1-chk31r20; array chk32R (*) chk32r1-chk32r20; array chk1encR (*) chk1encr1-chk1encr20; array chk1gedR (*) chk1gedr1-chk1gedr20; array chk2R (*) chk2r1-chk2r20; array chk3R (*) chk3r1-chk3r20; array chk5R (*) chk5r1-chk5r20; array scoder [20,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 scoder20_1-scoder20_3 dum dum dum dum dum; array degR (*) hdgr1-hdgr19 cvc_hdgr20; *** initiate the cvc_ variables; if e3112r21=-5 then do; grsurv=cvc_hgcr20; degsurv=cvc_hdgr20; end; *** Create intermediate variables to be used in the program later.; ** Checking int dates; doicmr21=-5; if intyr21 ne -5 then doicmr21=(intyr21-1980)*12+intmr21; if doicmr21~=-5 then doicm=doicmr21; * 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=hsr20; gdrp=gdr20; 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_hgcr20; 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 hsr20>-4|gdr20>-4 then chk_commP=2; end; end; do i=1 to dim(encatR); if (e2806r21=-4|e2806r21>=13) & encatR(i) in (4,5,6,7,9,10,11) & (hsR(i)>-4|gdR(i)>-4) then prevcoll=1; if (e2806r21=-4|e2806r21>=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<=e2857r21<=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<=e2857r210 then ENROLL=0; if -3<=STOP<=-1 then ENROLL=0; if e3877A1r21=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 e3877A1r21=0 then enrollx=0; if e4795r21=1 & e4951r21=0 then enrollx=1; if e4795r21=0 then do; if e1605r21=-4 & e4951r21=0 then enrollx=0; if e1605r21=1 then do; if e1615r21_1=1 & e4951r21=0 then enrollx=1; if e1615r21_1=0 & e4951r21=0 then enrollx=0; end; if e1605r21=0 and e4951r21=0 then enrollx=0; end; if (e4951r21=1 or e3877A1r21=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<=e2857r21<=20)|e3112r21>=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 & e3112r21=12 then flaghs=1; if (1<=e2857r21<=12) & HSD<=0 & GED<=0 then ENCAT=8; if e2857r21=13 & HSD=0 & GED=0 then ENCAT=8; if e2857r21=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<=e2857r21<95)|e3112r21>=12|GED=1|HSD=1|clg_ok=1) then ENCAT=9; if sch=5 & deg in (1,3,4,5,6,10) & ((13<=e2857r21<95)|e3112r21>=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<=e2857r21<=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 & e3877A1r21~=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<=e2857r21<95) & (12<=e3112r21<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<=e2857r21<=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) & e3112r21 in (1,2,3,4,5,6) then do; inclg_lowHGC=1; e3112r21_imp=e3112r21+12; end; ***** For those who are asked of 3112; if (e3112r21>12 & (currcoll_1=1 or prevcoll=1)) or (e3112r21=12 & cdths ne hsr20) or (0<=e3112r21<12 & attsch=1) or (-4e3112r21+1 & e3112r21>GRSURVP>=0 then gr_ncomp1=3; if e2857r21>e3112r21+1 & 0<=e3112r2112 then GRSURV=e3112r21_imp; else inclg_lt12=1; LOCATOR=5.2; end; if currcoll=1 & 0<=grsurvP<95 & 0<=e3112r21<95 then inclgCI_grchg=e3112r21-grsurvP; if currcoll=0 & prevcoll=1 & encatP in (4,5,6,7,9,10,11) & 0<=grsurvP<95 & 0<=e3112r21<95 then inclgDLI_grchg=e3112r21-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=e3112r21-grsurvP; if ENCAT in (1,8,-3) then do; if ENCAT=-3 then do; GRSURV=-3; if e3112r21<=12|e3112r20=95 then GRAUG=-3; LOCATOR=6.11; LOCA=6.11; end; if 0<=e3112r21<=12 & (0<=sitm_pr<=rnd_dif|grsurvP=95) then do; subsitm=1; GRSURV=e3112r21; LOCATOR=6.12; GRAUG=e3112r21; 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=e3112r21; LOCATOR=6.22; end; if e3112r21_imp>grsurvP then do; GRSURV=e3112r21_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; *need to check such cases; 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=gdr20 & cdths=hsr20 & cdtaa=aar20 & cdtba=bar20 & cdtma=mar20 & cdtpf=pfr20 & cdtdc=dcr20) then do; if he20_deg ne . then do; he21_deg=degsurv; degsurv=-3; degaug=-3; if encatr20=-3 & encat in (1,2,3,5,6,7) then do; he21_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=grsurvFr20; grsurvF=grsurvFP; locF=6; if (e3112r21>12 & (currcoll_1=1 or prevcoll=1)) or (e3112r21=12 & cdths ne hsr20) or (0<=e3112r21<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; * comp to chk1; if e3877A1r21=0 & grsurv_cvc ne cvc_hgcr20 then chk11=1; if 0