/* Title: Admit Not Enrolled- Individual Detail Return File Created: August 2014 Author: Pam Borkowski-Valentin, Swarthmore College Office of Institutional Research */ Comment The following syntax can be run on each year to standardize the variables (just make sure that you are using the max width for all files) I set the lengths for the First & Last names to the NSC max, and put a longer number than I've seen for College Name, but adjust as needed. ALTER TYPE CollegeName (A100). ALTER TYPE @2year4year (A5). ALTER TYPE FirstName (A20). ALTER TYPE MiddleInitial (A1). ALTER TYPE LastName (A20). ALTER TYPE NameSuffix (A5). ALTER TYPE RequesterReturnField (F12.0). ALTER TYPE RecordFoundYN (A1). ALTER TYPE SearchDate (A8). ALTER TYPE CollegeCodeBranch (A10). ALTER TYPE CollegeState (A2). ALTER TYPE PublicPrivate (A7). ALTER TYPE EnrollmentBegin (A8). ALTER TYPE EnrollmentEnd (A8). ALTER TYPE EnrollmentStatus (A3). ALTER TYPE ClassLevel (A5). ALTER TYPE EnrollmentMajor1 (A100). ALTER TYPE EnrollmentCIP1 (A10). ALTER TYPE EnrollmentMajor2 (A100). ALTER TYPE EnrollmentCIP2 (A10). ALTER TYPE Graduated (A1). ALTER TYPE GraduationDate (A8). ALTER TYPE DegreeTitle (A100). ALTER TYPE DegreeMajor1 (A100). ALTER TYPE DegreeCIP1 (A10). ALTER TYPE DegreeMajor2 (A100). ALTER TYPE DegreeCIP2 (A10). ALTER TYPE DegreeMajor3 (A100). ALTER TYPE DegreeCIP3 (A10). ALTER TYPE DegreeMajor4 (A100). ALTER TYPE DegreeCIP4 (A10). ALTER TYPE CollegeSequence (F3.0). Comment Now merge all cohorts. RENAME VARIABLES RequesterReturnField= ID. EXECUTE. Comment We need to change the NSC dates into standard dates As some fields will have blank cells (graduation, no record found), expect some warnings. * Date and Time Wizard: EnrollmentEnd_Date. COMPUTE EnrollmentEnd_Date=date.dmy(number(substr(ltrim(EnrollmentEnd),7,2),f2.0), number(substr(ltrim(EnrollmentEnd),5,2),f2.0), number(substr(ltrim(EnrollmentEnd),1,4),f4.0)). VARIABLE LABELS EnrollmentEnd_Date 'Enrollment End'. VARIABLE LEVEL EnrollmentEnd_Date (SCALE). FORMATS EnrollmentEnd_Date (ADATE10). VARIABLE WIDTH EnrollmentEnd_Date(10). EXECUTE. * Date and Time Wizard: EnrollmentBegin_Date. COMPUTE EnrollmentBegin_Date=date.dmy(number(substr(ltrim(EnrollmentBegin),7,2),f2.0), number(substr(ltrim(EnrollmentBegin),5,2),f2.0), number(substr(ltrim(EnrollmentBegin),1,4),f4.0)). VARIABLE LABELS EnrollmentBegin_Date 'Enrollment Begin'. VARIABLE LEVEL EnrollmentBegin_Date (SCALE). FORMATS EnrollmentBegin_Date (ADATE10). VARIABLE WIDTH EnrollmentBegin_Date(10). EXECUTE. * Date and Time Wizard: SearchDate_Date. COMPUTE SearchDate_Date=date.dmy(number(substr(ltrim(SearchDate),7,2),f2.0), number(substr(ltrim(SearchDate),5,2),f2.0), number(substr(ltrim(SearchDate),1,4),f4.0)). VARIABLE LABELS SearchDate_Date 'Search Date'. VARIABLE LEVEL SearchDate_Date (SCALE). FORMATS SearchDate_Date (ADATE10). VARIABLE WIDTH SearchDate_Date(10). EXECUTE. * Date and Time Wizard: GraduationDate_Date. COMPUTE GraduationDate_Date=date.dmy(number(substr(ltrim(GraduationDate),7,2),f2.0), number(substr(ltrim(GraduationDate),5,2),f2.0), number(substr(ltrim(GraduationDate),1,4),f4.0)). VARIABLE LABELS GraduationDate_Date 'Graduation Date'. VARIABLE LEVEL GraduationDate_Date (SCALE). FORMATS GraduationDate_Date (ADATE10). VARIABLE WIDTH GraduationDate_Date(10). EXECUTE. Comment If you are running information for more than one cohort, you will want to pull out the admit year for all You can do this easily with a substring AS LONG AS the admit year was also the same year of your begin search date If, for some reason, it is not, you would want to create the term for each file before merging. STRING Admit_Year (A4). COMPUTE Admit_Year=CHAR.SUBSTR(SearchDate,1,4). EXECUTE. Comment For this project, we wanted to look at the first place a student enrolled, so this is a very simple unduplication based just on their first record found However, if your project dictates, you could first delete cases where the person has only enrolled for x number of days, or you could limit your results to only that fall term or only the first year after the admit term (as opposed to picking up the first record of someone who may have deffered for a year or taken gap year(s)) before unduplicating.. SORT CASES BY ID(A) EnrollmentBegin_Date(A). MATCH FILES /FILE=* /BY ID /FIRST=PrimaryFirst /LAST=PrimaryLast. DO IF (PrimaryFirst). COMPUTE MatchSequence=1-PrimaryLast. ELSE. COMPUTE MatchSequence=MatchSequence+1. END IF. LEAVE MatchSequence. FORMATS MatchSequence (f7). COMPUTE InDupGrp=MatchSequence>0. SORT CASES InDupGrp(D). MATCH FILES /FILE=* /DROP=PrimaryLast InDupGrp MatchSequence. VARIABLE LABELS PrimaryFirst 'Indicator of each first matching case as Primary'. VALUE LABELS PrimaryFirst 0 'Duplicate Case' 1 'Primary Case'. VARIABLE LEVEL PrimaryFirst (ORDINAL). FREQUENCIES VARIABLES=PrimaryFirst. EXECUTE. Comment This next syntax DELETES the duplicate cases. FILTER OFF. USE ALL. SELECT IF (PrimaryFirst=1). EXECUTE. Comment Schools by Year (this includes those with RecordFoundYN=N). * Custom Tables. CTABLES /VLABELS VARIABLES=CollegeName Admit_Year DISPLAY=LABEL /TABLE CollegeName [COUNT F40.0] BY Admit_Year /CATEGORIES VARIABLES=CollegeName Admit_Year ORDER=A KEY=VALUE EMPTY=EXCLUDE. Comment Public/Private by Year This ONLY includes those who have a found record. USE ALL. COMPUTE filter_$=(RecordFoundYN="Y"). VARIABLE LABELS filter_$ 'RecordFoundYN="Y" (FILTER)'. VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'. FORMATS filter_$ (f1.0). FILTER BY filter_$. EXECUTE. Comment Public/Private numbers only. * Custom Tables. CTABLES /VLABELS VARIABLES=PublicPrivate Admit_Year DISPLAY=LABEL /TABLE PublicPrivate BY Admit_Year [C][COUNT F40.0] /CATEGORIES VARIABLES=PublicPrivate Admit_Year ORDER=A KEY=VALUE EMPTY=EXCLUDE. Comment Public/Private both numbers & percents. * Custom Tables. CTABLES /VLABELS VARIABLES=PublicPrivate Admit_Year DISPLAY=LABEL /TABLE PublicPrivate [C] BY Admit_Year [C][COUNT F40.0, COLPCT.COUNT PCT40.1] /CATEGORIES VARIABLES=PublicPrivate Admit_Year ORDER=A KEY=VALUE EMPTY=EXCLUDE. Comment Public/Private just percents. * Custom Tables. CTABLES /VLABELS VARIABLES=PublicPrivate Admit_Year DISPLAY=LABEL /TABLE PublicPrivate [C] BY Admit_Year [C][COLPCT.COUNT PCT40.1] /CATEGORIES VARIABLES=PublicPrivate Admit_Year ORDER=A KEY=VALUE EMPTY=EXCLUDE. Comment 2year/ 4year by Year This ONLY includes those who have a found record. USE ALL. COMPUTE filter_$=(RecordFoundYN="Y"). VARIABLE LABELS filter_$ 'RecordFoundYN="Y" (FILTER)'. VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'. FORMATS filter_$ (f1.0). FILTER BY filter_$. EXECUTE. Comment 2year/ 4 year just numbers.. * Custom Tables. CTABLES /VLABELS VARIABLES=@2year4year Admit_Year DISPLAY=LABEL /TABLE @2year4year [C] BY Admit_Year [C][COUNT F40.0] /CATEGORIES VARIABLES=@2year4year Admit_Year ORDER=A KEY=VALUE EMPTY=EXCLUDE. Comment 2year/ 4 year numbers & percents. * Custom Tables. CTABLES /VLABELS VARIABLES=@2year4year Admit_Year DISPLAY=LABEL /TABLE @2year4year [C] BY Admit_Year [C][COUNT F40.0, COLPCT.COUNT PCT40.1] /CATEGORIES VARIABLES=@2year4year Admit_Year ORDER=A KEY=VALUE EMPTY=EXCLUDE. Comment 2year/ 4 year just percents. * Custom Tables. CTABLES /VLABELS VARIABLES=@2year4year Admit_Year DISPLAY=LABEL /TABLE @2year4year BY Admit_Year [C][COLPCT.COUNT PCT40.1] /CATEGORIES VARIABLES=@2year4year Admit_Year ORDER=A KEY=VALUE EMPTY=EXCLUDE.