/* IMPORTANT: This program must be adapted depending on the data year used. NHDS data files prior to 2001 do not include ADM_TYPE, ASOURCE or DX0, so the record length for these years is 85, and DRG is the final input variable. ADM_TYPE and ASOURCE are available beginning in 2001, so the record length for data years 2001 to 2007 is 88. In 2008, DX0 (Admitting Diagnosis) was added to the file, resulting in a record length of 93. In order to avoid an error in reading the data, do not include the new variables in an INPUT statement for years when they are not available. */ ; DATA ANYNAME ; INFILE 'refer to location of NHDS datafile by drive and directory' ; INPUT @ 1 SVYEAR $2. @ 3 NEWBORN 1. @ 4 AGEUNITS 1. @ 5 AGE 2. @ 7 SEX 1. @ 8 RACE 1. @ 9 MARSTAT 1. @ 10 DISC_MON $2. @ 12 DISCSTAT 1. @ 13 DOC 4. @ 17 LOSFLAG 1. @ 18 REGION 1. @ 19 BEDSIZE 1. @ 20 OWNER 1. @ 21 WEIGHT 5. @ 26 CENTURY $2. @ 28 DX1 $5. @ 33 DX2 $5. @ 38 DX3 $5. @ 43 DX4 $5. @ 48 DX5 $5. @ 53 DX6 $5. @ 58 DX7 $5. @ 63 PD1 $4. @ 67 PD2 $4. @ 71 PD3 $4. @ 75 PD4 $4. @ 79 ESOP1 2. @ 81 ESOP2 2. @ 83 DRG $3. @ 86 ADM_TYPE 1. @ 87 ASOURCE 2. @ 89 DX0 $5. ; LABEL SVYEAR = 'Last two digits of survey year' NEWBORN = 'Newborn infant flag' AGEUNITS = 'Units for age' AGE = 'Age in years, months, or days' SEX = 'Patient sex' RACE = 'Patient race' MARSTAT = 'Marital status of patient' DISC_MON = 'Month of discharge' DISCSTAT = 'Status at discharge' DOC = 'Number of days of care' LOSFLAG = 'Zero length of stay flag' REGION = 'Geographic region of hospital' BEDSIZE = 'Bedsize grouping for hospital' OWNER = 'Ownership of hospital' WEIGHT = 'Analysis weight' CENTURY = 'First two digits of survey year' DX1 = 'ICD-9-CM diagnosis code - first' DX2 = 'ICD-9-CM diagnosis code - second' DX3 = 'ICD-9-CM diagnosis code - third' DX4 = 'ICD-9-CM diagnosis code - fourth' DX5 = 'ICD-9-CM diagnosis code - fifth' DX6 = 'ICD-9-CM diagnosis code - sixth' DX7 = 'ICD-9-CM diagnosis code - seventh' PD1 = 'ICD-9-CM procedure code - first' PD2 = 'ICD-9-CM procedure code - second' PD3 = 'ICD-9-CM procedure code - third' PD4 = 'ICD-9-CM procedure code - fourth' ESOP1 = 'Principal expected source of payment' ESOP2 = 'Secondary expected source of payment' DRG = 'Diagnosis-related group' ADM_TYPE = 'Type of admission' ASOURCE = 'Source of admission' DX0 = 'Admitting diagnosis' ;