/***************************************************************************** * SASload_NEDS_2008_Core.SAS * This program will load the 2008 NEDS csv Core File into SAS. *****************************************************************************/ /* Create SAS informats for missing values */ PROC FORMAT; INVALUE N2PF '-9' = . '-8' = .A '-6' = .C '-5' = .N OTHER = (|2.|) ; INVALUE N3PF '-99' = . '-88' = .A '-66' = .C OTHER = (|3.|) ; INVALUE N4PF '-999' = . '-888' = .A '-666' = .C OTHER = (|4.|) ; INVALUE N4P1F '-9.9' = . '-8.8' = .A '-6.6' = .C OTHER = (|4.1|) ; INVALUE N5PF '-9999' = . '-8888' = .A '-6666' = .C OTHER = (|5.|) ; INVALUE N5P2F '-9.99' = . '-8.88' = .A '-6.66' = .C OTHER = (|5.2|) ; INVALUE N6PF '-99999' = . '-88888' = .A '-66666' = .C OTHER = (|6.|) ; INVALUE N6P2F '-99.99' = . '-88.88' = .A '-66.66' = .C OTHER = (|6.2|) ; INVALUE N7P2F '-999.99' = . '-888.88' = .A '-666.66' = .C OTHER = (|7.2|) ; INVALUE N8PF '-9999999' = . '-8888888' = .A '-6666666' = .C OTHER = (|8.|) ; INVALUE N8P2F '-9999.99' = . '-8888.88' = .A '-6666.66' = .C OTHER = (|8.2|) ; INVALUE N8P4F '-99.9999' = . '-88.8888' = .A '-66.6666' = .C OTHER = (|8.4|) ; INVALUE N10PF '-999999999' = . '-888888888' = .A '-666666666' = .C OTHER = (|10.|) ; INVALUE N10P4F '-9999.9999' = . '-8888.8888' = .A '-6666.6666' = .C OTHER = (|10.4|) ; INVALUE N10P5F '-999.99999' = . '-888.88888' = .A '-666.66666' = .C OTHER = (|10.5|) ; INVALUE DATE10F '-999999999' = . '-888888888' = .A '-666666666' = .C OTHER = (|MMDDYY10.|) ; INVALUE N11P7F '-99.9999999' = . '-88.8888888' = .A '-66.6666666' = .C OTHER = (|11.7|) ; INVALUE N12P2F '-99999999.99' = . '-88888888.88' = .A '-66666666.66' = .C OTHER = (|12.2|) ; INVALUE N12P5F '-99999.99999' = . '-88888.88888' = .A '-66666.66666' = .C OTHER = (|12.5|) ; INVALUE N13PF '-999999999999' = . '-888888888888' = .A '-666666666666' = .C OTHER = (|13.|) ; INVALUE N15P2F '-99999999999.99' = . '-88888888888.88' = .A '-66666666666.66' = .C OTHER = (|15.2|) ; RUN; /* Data Step to load the file */ DATA NEDS_2008_Core; INFILE 'NEDS_2008_Core.csv' dsd dlm=',' LRECL = 385; /* Define data element attributes */ ATTRIB AGE LENGTH=3 LABEL="Age in years at admission" AMONTH LENGTH=3 LABEL="Admission month" AWEEKEND LENGTH=3 LABEL="Admission day is a weekend" CHRON1 LENGTH=3 LABEL="Chronic condition indicator 1" CHRON2 LENGTH=3 LABEL="Chronic condition indicator 2" CHRON3 LENGTH=3 LABEL="Chronic condition indicator 3" CHRON4 LENGTH=3 LABEL="Chronic condition indicator 4" CHRON5 LENGTH=3 LABEL="Chronic condition indicator 5" CHRON6 LENGTH=3 LABEL="Chronic condition indicator 6" CHRON7 LENGTH=3 LABEL="Chronic condition indicator 7" CHRON8 LENGTH=3 LABEL="Chronic condition indicator 8" CHRON9 LENGTH=3 LABEL="Chronic condition indicator 9" CHRON10 LENGTH=3 LABEL="Chronic condition indicator 10" CHRON11 LENGTH=3 LABEL="Chronic condition indicator 11" CHRON12 LENGTH=3 LABEL="Chronic condition indicator 12" CHRON13 LENGTH=3 LABEL="Chronic condition indicator 13" CHRON14 LENGTH=3 LABEL="Chronic condition indicator 14" CHRON15 LENGTH=3 LABEL="Chronic condition indicator 15" DIED_VISIT LENGTH=3 LABEL="Died in the ED (1), Died in the hospital (2), did not die (0)" DISCWT LENGTH=8 LABEL="Weight to ED Visits in AHA universe" DISP_ED LENGTH=3 LABEL="Disposition of patient (uniform) from ED" DQTR LENGTH=3 LABEL="Discharge quarter" DX1 LENGTH=$5 LABEL="Diagnosis 1" DX2 LENGTH=$5 LABEL="Diagnosis 2" DX3 LENGTH=$5 LABEL="Diagnosis 3" DX4 LENGTH=$5 LABEL="Diagnosis 4" DX5 LENGTH=$5 LABEL="Diagnosis 5" DX6 LENGTH=$5 LABEL="Diagnosis 6" DX7 LENGTH=$5 LABEL="Diagnosis 7" DX8 LENGTH=$5 LABEL="Diagnosis 8" DX9 LENGTH=$5 LABEL="Diagnosis 9" DX10 LENGTH=$5 LABEL="Diagnosis 10" DX11 LENGTH=$5 LABEL="Diagnosis 11" DX12 LENGTH=$5 LABEL="Diagnosis 12" DX13 LENGTH=$5 LABEL="Diagnosis 13" DX14 LENGTH=$5 LABEL="Diagnosis 14" DX15 LENGTH=$5 LABEL="Diagnosis 15" DXCCS1 LENGTH=4 LABEL="CCS: diagnosis 1" DXCCS2 LENGTH=4 LABEL="CCS: diagnosis 2" DXCCS3 LENGTH=4 LABEL="CCS: diagnosis 3" DXCCS4 LENGTH=4 LABEL="CCS: diagnosis 4" DXCCS5 LENGTH=4 LABEL="CCS: diagnosis 5" DXCCS6 LENGTH=4 LABEL="CCS: diagnosis 6" DXCCS7 LENGTH=4 LABEL="CCS: diagnosis 7" DXCCS8 LENGTH=4 LABEL="CCS: diagnosis 8" DXCCS9 LENGTH=4 LABEL="CCS: diagnosis 9" DXCCS10 LENGTH=4 LABEL="CCS: diagnosis 10" DXCCS11 LENGTH=4 LABEL="CCS: diagnosis 11" DXCCS12 LENGTH=4 LABEL="CCS: diagnosis 12" DXCCS13 LENGTH=4 LABEL="CCS: diagnosis 13" DXCCS14 LENGTH=4 LABEL="CCS: diagnosis 14" DXCCS15 LENGTH=4 LABEL="CCS: diagnosis 15" ECODE1 LENGTH=$5 LABEL="E code 1" ECODE2 LENGTH=$5 LABEL="E code 2" ECODE3 LENGTH=$5 LABEL="E code 3" ECODE4 LENGTH=$5 LABEL="E code 4" EDEVENT LENGTH=3 LABEL="Type of ED Event" E_CCS1 LENGTH=3 LABEL="CCS: E Code 1" E_CCS2 LENGTH=3 LABEL="CCS: E Code 2" E_CCS3 LENGTH=3 LABEL="CCS: E Code 3" E_CCS4 LENGTH=3 LABEL="CCS: E Code 4" FEMALE LENGTH=3 LABEL="Indicator of sex" HCUPFILE LENGTH=$4 LABEL="Source of HCUP Record (SID or SEDD)" HOSP_ED LENGTH=4 FORMAT=Z5. LABEL="HCUP ED hospital identifier" HOSP_REGION LENGTH=3 FORMAT=1. LABEL="Region of hospital" INTENT_SELF_HARM LENGTH=3 LABEL="Intentional self harm indicated on the record (by diagnosis and/or E codes)" KEY_ED LENGTH=8 FORMAT=Z14. LABEL="HCUP NEDS record identifier" NDX LENGTH=3 LABEL="Number of diagnoses on this record" NECODE LENGTH=3 LABEL="Number of E codes on this record" NEDS_STRATUM LENGTH=4 FORMAT=5. LABEL="Stratum used to sample hospital" PAY1 LENGTH=3 LABEL="Primary expected payer (uniform)" PAY2 LENGTH=3 LABEL="Secondary expected payer (uniform)" PL_NCHS2006 LENGTH=3 LABEL="Patient Location: NCHS Urban-Rural Code (V2006)" TOTCHG_ED LENGTH=6 LABEL="Total charge for ED services" YEAR LENGTH=3 LABEL="Calendar year" ZIPINC_QRTL LENGTH=3 LABEL="Median household income national quartile for patient ZIP Code" ; /* Read data elements from the CSV file */ INPUT AGE :N3PF. AMONTH :N2PF. AWEEKEND :N2PF. CHRON1 :N3PF. CHRON2 :N3PF. CHRON3 :N3PF. CHRON4 :N3PF. CHRON5 :N3PF. CHRON6 :N3PF. CHRON7 :N3PF. CHRON8 :N3PF. CHRON9 :N3PF. CHRON10 :N3PF. CHRON11 :N3PF. CHRON12 :N3PF. CHRON13 :N3PF. CHRON14 :N3PF. CHRON15 :N3PF. DIED_VISIT :N2PF. DISCWT :N11P7F. DISP_ED :N2PF. DQTR :N2PF. DX1 :$CHAR5. DX2 :$CHAR5. DX3 :$CHAR5. DX4 :$CHAR5. DX5 :$CHAR5. DX6 :$CHAR5. DX7 :$CHAR5. DX8 :$CHAR5. DX9 :$CHAR5. DX10 :$CHAR5. DX11 :$CHAR5. DX12 :$CHAR5. DX13 :$CHAR5. DX14 :$CHAR5. DX15 :$CHAR5. DXCCS1 :N4PF. DXCCS2 :N4PF. DXCCS3 :N4PF. DXCCS4 :N4PF. DXCCS5 :N4PF. DXCCS6 :N4PF. DXCCS7 :N4PF. DXCCS8 :N4PF. DXCCS9 :N4PF. DXCCS10 :N4PF. DXCCS11 :N4PF. DXCCS12 :N4PF. DXCCS13 :N4PF. DXCCS14 :N4PF. DXCCS15 :N4PF. ECODE1 :$CHAR5. ECODE2 :$CHAR5. ECODE3 :$CHAR5. ECODE4 :$CHAR5. EDEVENT :N2PF. E_CCS1 :N4PF. E_CCS2 :N4PF. E_CCS3 :N4PF. E_CCS4 :N4PF. FEMALE :N2PF. HCUPFILE :$CHAR4. HOSP_ED :5. HOSP_REGION :N2PF. INTENT_SELF_HARM :N2PF. KEY_ED :16. NDX :N3PF. NECODE :N3PF. NEDS_STRATUM :N5PF. PAY1 :N2PF. PAY2 :N2PF. PL_NCHS2006 :N3PF. TOTCHG_ED :N12P2F. YEAR :N4PF. ZIPINC_QRTL :N2PF. ; RUN;