/******************************************************************* * SASload_KID_2000_HOSPITAL.SAS: * THE SAS CODE SHOWN BELOW WILL LOAD THE ASCII * 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 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 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 KID_2000_HOSPITAL; INFILE 'KID_2000_HOSPITAL.ASC' LRECL = 310; *** Variable attribute ***; ATTRIB AHAID LENGTH=$7 LABEL="AHA hospital identifier" CHLDWT LENGTH=8 LABEL="Weight to pediatric non-births in universe for estimates other than total charges" CHLDWTCHARGE LENGTH=8 LABEL="Weight to pediatric non-births in universe for total charge estimates" CMPBWT LENGTH=8 LABEL="Weight to complicated births in universe for estimates other than total charges" CMPBWTCHARGE LENGTH=8 LABEL="Weight to complicated births in 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" HOSPZIP LENGTH=$5 LABEL="Hospital ZIP Code from AHA Survey (Z014)" HOSP_BEDSIZE LENGTH=3 LABEL="Bedsize of hospital" HOSP_CONTROL LENGTH=3 LABEL="Control/ownership of hospital" HOSP_LOCATION LENGTH=3 LABEL="Location (urban/rural) of hospital" HOSP_LOCTEACH LENGTH=3 LABEL="Location/teaching status of hospital" HOSP_REGION LENGTH=3 LABEL="Region of hospital" HOSP_TEACH LENGTH=3 LABEL="Teaching status of hospital" H_BRTH_F LENGTH=8 LABEL="Number of frame HCUP births in KID_STRATUM" H_CHLD_F LENGTH=8 LABEL="Number of frame HCUP pediatric non-births in KID_STRATUM" H_CMPB_F LENGTH=8 LABEL="Number of frame HCUP complicated births in KID_STRATUM" H_DISC_F LENGTH=8 LABEL="Number of frame HCUP discharges in KID_STRATUM" H_UNCB_F LENGTH=8 LABEL="Number of frame HCUP uncomplicated births in KID_STRATUM" H_HOSP_F LENGTH=8 LABEL="Number of frame HCUP hospitals in KID_STRATUM" IDNUMBER LENGTH=$6 LABEL="AHA hospital identifier without the leading 6" KID_STRATUM LENGTH=4 LABEL="Hospital stratum used for weights" N_BRTH_U LENGTH=8 LABEL="Number of universe births in KID_STRATUM" N_DISC_U LENGTH=8 LABEL="Number of universe discharges in KID_STRATUM" N_HOSP_U LENGTH=8 LABEL="Number of universe hospitals in KID_STRATUM" NACHTYPE LENGTH=3 LABEL="NACHRI hospital type" PEDS_DISC LENGTH=4 LABEL="Number of discharges, 20 years old or younger, from this hospital in the SID" PEDS_PCT LENGTH=8 LABEL="Percentage of hospital discharges, 20 years old or younger" S_BRTH_U LENGTH=8 LABEL="Number of sample births in KID_STRATUM" S_CHLD LENGTH=4 LABEL="Pediatric non-births sampled" S_CHLD_U LENGTH=8 LABEL="Number of sample pediatric non-births in KID_STRATUM" S_CMPB LENGTH=4 LABEL="Complicated births sampled" S_CMPB_U LENGTH=8 LABEL="Number of sample complicated births in KID_STRATUM" S_DISC_U LENGTH=8 LABEL="Number of sample births and children in KID_STRATUM" S_HOSP_U LENGTH=8 LABEL="Number of sample hospitals in KID_STRATUM" S_UNCB LENGTH=4 LABEL="Uncomplicated births sampled" S_UNCB_U LENGTH=8 LABEL="Number of sample uncomplicated births in KID_STRATUM" TOTAL_DISC LENGTH=4 LABEL="Total number of discharges from this hospital in the SID" UNCBWT LENGTH=8 LABEL="Weight to uncomplicated births in universe for estimates other than total charges" UNCBWTCHARGE LENGTH=8 LABEL="Weight to uncomplicated births in universe for total charge estimates" YEAR LENGTH=3 LABEL="Calendar year" ; *** Input the variables from the ASCII file ***; INPUT @1 AHAID $CHAR7. @8 CHLDWT N10P4F. @18 CHLDWTCHARGE N10P4F. @28 CMPBWT N10P4F. @38 CMPBWTCHARGE N10P4F. @48 HOSPADDR $CHAR30. @78 HOSPCITY $CHAR20. @98 HOSPID 5. @103 HOSPNAME $CHAR30. @133 HOSPST $CHAR2. @135 HOSPZIP $CHAR5. @140 HOSP_BEDSIZE N2PF. @142 HOSP_CONTROL N2PF. @144 HOSP_LOCATION N2PF. @146 HOSP_LOCTEACH N2PF. @148 HOSP_REGION N2PF. @150 HOSP_TEACH N2PF. @152 H_BRTH_F N6PF. @158 H_CHLD_F N6PF. @164 H_CMPB_F N6PF. @170 H_DISC_F N8PF. @178 H_UNCB_F N6PF. @184 H_HOSP_F N4PF. @188 IDNUMBER $CHAR6. @194 KID_STRATUM N4PF. @198 N_BRTH_U N6PF. @204 N_DISC_U N8PF. @212 N_HOSP_U N4PF. @216 NACHTYPE N2PF. @218 PEDS_DISC N6PF. @224 PEDS_PCT N8P4F. @232 S_BRTH_U N6PF. @238 S_CHLD N5PF. @243 S_CHLD_U N6PF. @249 S_CMPB N5PF. @254 S_CMPB_U N6PF. @260 S_DISC_U N6PF. @266 S_HOSP_U N4PF. @270 S_UNCB N5PF. @275 S_UNCB_U N6PF. @281 TOTAL_DISC N6PF. @287 UNCBWT N10P4F. @297 UNCBWTCHARGE N10P4F. @307 YEAR N4PF. ; RUN;