/******************************************************************* * SASload_NIS_2000_HOSPITAL.SAS: * THE SAS CODE SHOWN BELOW WILL LOAD THE ASCII NIS * HOSPITAL 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 N5PF '-9999' = . '-8888' = .A '-6666' = .C OTHER = (|5.|) ; 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 N10PF '-999999999' = . '-888888888' = .A '-666666666' = .C OTHER = (|10.|) ; INVALUE N10P4F '-9999.9999' = . '-8888.8888' = .A '-6666.6666' = .C OTHER = (|10.4|) ; INVALUE DATE10F '-999999999' = . '-888888888' = .A '-666666666' = .C OTHER = (|MMDDYY10.|) ; INVALUE N12P2F '-99999999.99' = . '-88888888.88' = .A '-66666666.66' = .C OTHER = (|12.2|) ; INVALUE N15P2F '-99999999999.99' = . '-88888888888.88' = .A '-66666666666.66' = .C OTHER = (|15.2|) ; RUN; *******************************; * Data Step *; *******************************; DATA NIS_2000_HOSPITAL; INFILE 'NIS_2000_HOSPITAL.ASC' LRECL = 183; *** Variable attribute ***; ATTRIB AHAID LENGTH=$7 LABEL="AHA hospital identifier with the leading 6" DISCWT LENGTH=8 LABEL= "Weight to discharges in AHA universe for estimates other than total charges" DISCWTcharge LENGTH=8 LABEL="Weight to discharges in AHA universe for total charge estimates" HOSPADDR LENGTH=$30 LABEL="Hospital address from AHA Survey (Z011)" HOSPCITY LENGTH=$20 LABEL="Hospital city from AHA Survey (Z012)" HOSPID LENGTH=4 FORMAT=Z5. LABEL="HCUP hospital identification number" HOSPNAME LENGTH=$30 LABEL="Hospital name from AHA Survey (Z000)" HOSPST LENGTH=$2 LABEL="Hospital state postal code" HOSPWT LENGTH=8 LABEL="Weight to hospitals in AHA universe" HOSPZIP LENGTH=$5 LABEL="Hospital ZIP Code from AHA Survey (Z014)" HOSP_BEDSIZE LENGTH=3 FORMAT=1. LABEL="Bed size of hospital" HOSP_CONTROL LENGTH=3 FORMAT=1. LABEL="Control/ownership of hospital" HOSP_LOCATION LENGTH=3 FORMAT=1. LABEL="Location (urban/rural) of hospital" HOSP_LOCTEACH LENGTH=3 FORMAT=1. LABEL="Location/teaching status of hospital" HOSP_REGION LENGTH=3 FORMAT=1. LABEL="Region of hospital" HOSP_TEACH LENGTH=3 FORMAT=1. LABEL="Teaching status of hospital" IDNUMBER LENGTH=$6 LABEL="AHA hospital identifier without the leading 6" NIS_STRATUM LENGTH=3 FORMAT=4. LABEL="Stratum used to sample hospital" N_DISC_U LENGTH=4 LABEL="Number of AHA universe discharges in NIS_STRATUM" N_HOSP_U LENGTH=3 LABEL="Number of AHA universe hospitals in NIS_STRATUM" S_DISC_U LENGTH=4 LABEL="Number of sample discharges in NIS_STRATUM" S_HOSP_U LENGTH=3 LABEL="Number of sample hospitals in NIS_STRATUM" TOTAL_DISC LENGTH=4 LABEL="Total number of discharges from this hospital in the NIS" YEAR LENGTH=3 LABEL="Calendar Year" ; *** Input the variables from the ASCII file ***; INPUT @1 AHAID $CHAR7. @8 DISCWT N10P4F. @18 DISCWTcharge N10P4F. @28 HOSPADDR $CHAR30. @58 HOSPCITY $CHAR20. @78 HOSPID 5. @83 HOSPNAME $CHAR30. @113 HOSPST $CHAR2. @115 HOSPWT N10P4F. @125 HOSPZIP $CHAR5. @130 HOSP_BEDSIZE N2PF. @132 HOSP_CONTROL N2PF. @134 HOSP_LOCATION N2PF. @136 HOSP_LOCTEACH N2PF. @138 HOSP_REGION N2PF. @140 HOSP_TEACH N2PF. @142 IDNUMBER $CHAR6. @148 NIS_STRATUM N4PF. @152 N_DISC_U N8PF. @160 N_HOSP_U N4PF. @164 S_DISC_U N6PF. @170 S_HOSP_U N4PF. @174 TOTAL_DISC N6PF. @180 YEAR N4PF. ; RUN;