*options obs=100 ; options nocenter ; /*------------------------------------------------ by Jean Roth Thu Feb 8 15:01:15 EST 2007 This program reads the 1997 NCHS Multiple Cause of Death Data Data File Report errors to jroth@nber.org This program is distributed under the GNU GPL. See end of this file and http://www.gnu.org/licenses/ for details. ----------------------------------------------- */ * The following line should contain the directory where the SAS file is to be stored ; libname library "./"; * The following line should contain the complete path and name of the raw data file. On a PC, use backslashes in paths as in C:\ ; FILENAME datafile pipe "unzip -p /homes/data/mortality/1997/data/mort1997.zip "; * The following line should contain the name of the SAS dataset ; %let dataset = mort1997 ; DATA library.&dataset ; INFILE datafile LRECL = 20000 ; attrib rectype length=3 label="Record Type"; attrib restatus length=3 label="Resident Status"; attrib stateoc length=3 label="State of Occurrence"; attrib countyoc length=3 label="County of Occurrence"; attrib region length=3 label="Region"; attrib divstoc length=3 label="Division and State Subcode of Occurrence"; attrib exstatoc length=3 label="Expanded State of Occurrence Code"; attrib staters length=3 label="State of Residence"; attrib countyrs length=$3 label="County of Residence"; attrib cityrs length=$3 label="City of Residence"; attrib popsize length=$1 label="Population Size of City of Residence"; attrib metro length=$1 label="Metropolitan - Nonmetropolitan County of Residence"; attrib regnres length=3 label="Region"; attrib divstres length=3 label="Division and State Subcode of Residence"; attrib exstares length=3 label="Expanded State of Residence Code"; attrib pmsares length=$3 label="NCHS PMSA/MSA of Residence"; attrib popsizoc length=3 label="Population Size of County of Occurrence"; attrib popsizrs length=$1 label="Population Size of County of Residence"; attrib popmsa length=$1 label="PMSA/MSA Population Size"; attrib educ length=3 label="Education"; attrib educr length=3 label="Education recode"; attrib monthdth length=3 label="Month of Death"; attrib sex length=3 label="Sex"; attrib race length=3 label="Detail Race"; attrib racer3 length=3 label="Race Recode 3"; attrib racer2 length=3 label="Race Recode 2"; attrib age length=3 label="Detail Age"; attrib ager52 length=3 label="Age Recode 52"; attrib ager27 length=3 label="Age Recode 27"; attrib ager12 length=3 label="Age Recode 12"; attrib ager22 length=3 label="Infant Age Recode 22"; attrib placdth length=3 label="Place of Death and Decedent’s Status"; attrib marstat length=3 label="Marital Status"; attrib statbth length=3 label="State of Birth"; attrib hispanic length=3 label="Hispanic Origin"; attrib hspanicr length=3 label="Hispanic Origin/Race Recode"; attrib weekday length=3 label="Day of Week of Death"; attrib industry length=3 label="Kind of Business or Industry"; attrib occup length=3 label="Usual Occupation"; attrib ucr52 length=3 label="52 Cause Recode"; attrib fipscity length=4 label="Place (city) of Residence (FIPS)"; attrib year length=4 label="Current Data Year"; attrib fipssto length=3 label="State of Occurrence (FIPS)"; attrib fipscty length=3 label="County of Occurrence (FIPS)"; attrib fipsstr length=3 label="State of Residence (FIPS)"; attrib fipsctyr length=3 label="County of Residence (FIPS)"; attrib fipspmsa length=4 label="PMSA/MSA of Residence (FIPS)"; attrib fipscmsa length=3 label="CMSA of Residence (FIPS)"; attrib injwork length=3 label="Injury at Work"; attrib raceimp length=3 label="Race Imputation Flag"; attrib ageflag length=3 label="Age Substitution Flag"; attrib accident length=3 label="Place of Accident for Causes E850-E869 and E880-E928"; attrib ucod length=$4 label="ICD Code (9th Revision)"; attrib ucr282 length=4 label="282 Cause Recode"; attrib ucr72 length=3 label="72 Cause Recode"; attrib ucr61 length=3 label="61 Cause Recode"; attrib ucr34 length=3 label="34 Cause Recode"; attrib eanum length=3 label="Number of Entity-Axis Conditions"; attrib econdp_1 length=3 label=""; attrib econds_1 length=$1 label=""; attrib enicon_1 length=$4 label=""; attrib enifla_1 length=$1 label=""; attrib econdp_2 length=3 label=""; attrib econds_2 length=$1 label=""; attrib enifla_2 length=$1 label=""; attrib enicon_2 length=$4 label=""; attrib econdp_3 length=3 label=""; attrib econds_3 length=$1 label=""; attrib enifla_3 length=$1 label=""; attrib enicon_3 length=$4 label=""; attrib econdp_4 length=3 label=""; attrib econds_4 length=$1 label=""; attrib enicon_4 length=$4 label=""; attrib enifla_4 length=$1 label=""; attrib econdp_5 length=3 label=""; attrib econds_5 length=$1 label=""; attrib enicon_5 length=$4 label=""; attrib enifla_5 length=$1 label=""; attrib econdp_6 length=3 label=""; attrib econds_6 length=$1 label=""; attrib enifla_6 length=$1 label=""; attrib enicon_6 length=$4 label=""; attrib econdp_7 length=3 label=""; attrib econds_7 length=$1 label=""; attrib enicon_7 length=$4 label=""; attrib enifla_7 length=$1 label=""; attrib econdp_8 length=3 label=""; attrib econds_8 length=$1 label=""; attrib enifla_8 length=$1 label=""; attrib enicon_8 length=$4 label=""; attrib econdp_9 length=3 label=""; attrib econds_9 length=$1 label=""; attrib enicon_9 length=$4 label=""; attrib enifla_9 length=$1 label=""; attrib econdp_10 length=3 label=""; attrib econds_10 length=$1 label=""; attrib enicon_10 length=$4 label=""; attrib enifla_10 length=$1 label=""; attrib econdp_11 length=3 label=""; attrib econds_11 length=$1 label=""; attrib enicon_11 length=$4 label=""; attrib enifla_11 length=$1 label=""; attrib econdp_12 length=3 label=""; attrib econds_12 length=$1 label=""; attrib enicon_12 length=$4 label=""; attrib enifla_12 length=$1 label=""; attrib econdp_13 length=3 label=""; attrib econds_13 length=$1 label=""; attrib enifla_13 length=$1 label=""; attrib enicon_13 length=$4 label=""; attrib econdp_14 length=3 label=""; attrib econds_14 length=$1 label=""; attrib enicon_14 length=$4 label=""; attrib enifla_14 length=$1 label=""; attrib econdp_15 length=3 label=""; attrib econds_15 length=$1 label=""; attrib enicon_15 length=$4 label=""; attrib enifla_15 length=$1 label=""; attrib econdp_16 length=3 label=""; attrib econds_16 length=$1 label=""; attrib enicon_16 length=$4 label=""; attrib enifla_16 length=$1 label=""; attrib econdp_17 length=3 label=""; attrib econds_17 length=$1 label=""; attrib enicon_17 length=$4 label=""; attrib enifla_17 length=$1 label=""; attrib econdp_18 length=3 label=""; attrib econds_18 length=$1 label=""; attrib enicon_18 length=$4 label=""; attrib enifla_18 length=$1 label=""; attrib econdp_19 length=3 label=""; attrib econds_19 length=$1 label=""; attrib enifla_19 length=$1 label=""; attrib enicon_19 length=$4 label=""; attrib econdp_20 length=3 label=""; attrib econds_20 length=$1 label=""; attrib enicon_20 length=$4 label=""; attrib enifla_20 length=$1 label=""; attrib ranum length=3 label="Number of Record-Axis Conditions"; attrib record_1 length=$4 label="Condition"; attrib rnifla_1 length=3 label="Nature of Injury Flag and Condition"; attrib record_2 length=$4 label="Condition"; attrib rnifla_2 length=3 label="Nature of Injury Flag and Condition"; attrib record_3 length=$4 label="Condition"; attrib rnifla_3 length=3 label="Nature of Injury Flag and Condition"; attrib record_4 length=$4 label="Condition"; attrib rnifla_4 length=3 label="Nature of Injury Flag and Condition"; attrib record_5 length=$4 label="Condition"; attrib rnifla_5 length=3 label="Nature of Injury Flag and Condition"; attrib record_6 length=$4 label="Condition"; attrib rnifla_6 length=3 label="Nature of Injury Flag and Condition"; attrib record_7 length=$4 label="Condition"; attrib rnifla_7 length=3 label="Nature of Injury Flag and Condition"; attrib record_8 length=$4 label="Condition"; attrib rnifla_8 length=3 label="Nature of Injury Flag and Condition"; attrib record_9 length=$4 label="Condition"; attrib rnifla_9 length=3 label="Nature of Injury Flag and Condition"; attrib record_10 length=$4 label="Condition"; attrib rnifla_10 length=3 label="Nature of Injury Flag and Condition"; attrib record_11 length=$4 label="Condition"; attrib rnifla_11 length=3 label="Nature of Injury Flag and Condition"; attrib record_12 length=$4 label="Condition"; attrib rnifla_12 length=3 label="Nature of Injury Flag and Condition"; attrib record_13 length=$4 label="Condition"; attrib rnifla_13 length=3 label="Nature of Injury Flag and Condition"; attrib record_14 length=$4 label="Condition"; attrib rnifla_14 length=3 label="Nature of Injury Flag and Condition"; attrib record_15 length=$4 label="Condition"; attrib rnifla_15 length=3 label="Nature of Injury Flag and Condition"; attrib record_16 length=$4 label="Condition"; attrib rnifla_16 length=3 label="Nature of Injury Flag and Condition"; attrib record_17 length=$4 label="Condition"; attrib rnifla_17 length=3 label="Nature of Injury Flag and Condition"; attrib record_18 length=$4 label="Condition"; attrib rnifla_18 length=3 label="Nature of Injury Flag and Condition"; attrib record_19 length=$4 label="Condition"; attrib rnifla_19 length=3 label="Nature of Injury Flag and Condition"; attrib record_20 length=$4 label="Condition"; attrib rnifla_20 length=3 label="Nature of Injury Flag and Condition"; INPUT @19 rectype 1. @20 restatus 1. @21 stateoc 2. @23 countyoc 3. @26 region 1. @27 divstoc 2. @29 exstatoc 2. @31 staters 2. @33 countyrs $3. @36 cityrs $3. @39 popsize $1. @40 metro $1. @41 regnres 1. @42 divstres 2. @44 exstares 2. @46 pmsares $3. @49 popsizoc 1. @50 popsizrs $1. @51 popmsa $1. @52 educ 2. @54 educr 1. @55 monthdth 2. @59 sex 1. @60 race 2. @62 racer3 1. @63 racer2 1. @64 age 3. @67 ager52 2. @69 ager27 2. @71 ager12 2. @73 ager22 2. @75 placdth 1. @77 marstat 1. @78 statbth 2. @80 hispanic 2. @82 hspanicr 1. @83 weekday 1. @85 industry 3. @88 occup 3. @91 ucr52 3. @97 fipscity 5. @115 year 4. @119 fipssto 2. @121 fipscty 3. @124 fipsstr 2. @126 fipsctyr 3. @129 fipspmsa 4. @134 fipscmsa 2. @136 injwork 1. @137 raceimp 1. @138 ageflag 1. @141 accident 1. @142 ucod $4. @146 ucr282 5. @151 ucr72 3. @154 ucr61 3. @157 ucr34 3. @160 eanum 2. @162 econdp_1 1. @163 econds_1 $1. @164 enicon_1 $4. @168 enifla_1 $1. @169 econdp_2 1. @170 econds_2 $1. @175 enifla_2 $1. @171 enicon_2 $4. @176 econdp_3 1. @177 econds_3 $1. @182 enifla_3 $1. @178 enicon_3 $4. @183 econdp_4 1. @184 econds_4 $1. @185 enicon_4 $4. @189 enifla_4 $1. @190 econdp_5 1. @191 econds_5 $1. @192 enicon_5 $4. @196 enifla_5 $1. @197 econdp_6 1. @198 econds_6 $1. @203 enifla_6 $1. @199 enicon_6 $4. @204 econdp_7 1. @205 econds_7 $1. @206 enicon_7 $4. @210 enifla_7 $1. @211 econdp_8 1. @212 econds_8 $1. @217 enifla_8 $1. @213 enicon_8 $4. @218 econdp_9 1. @219 econds_9 $1. @220 enicon_9 $4. @224 enifla_9 $1. @225 econdp_10 1. @226 econds_10 $1. @227 enicon_10 $4. @231 enifla_10 $1. @232 econdp_11 1. @233 econds_11 $1. @234 enicon_11 $4. @238 enifla_11 $1. @239 econdp_12 1. @240 econds_12 $1. @241 enicon_12 $4. @245 enifla_12 $1. @246 econdp_13 1. @247 econds_13 $1. @252 enifla_13 $1. @248 enicon_13 $4. @253 econdp_14 1. @254 econds_14 $1. @255 enicon_14 $4. @259 enifla_14 $1. @260 econdp_15 1. @261 econds_15 $1. @262 enicon_15 $4. @266 enifla_15 $1. @267 econdp_16 1. @268 econds_16 $1. @269 enicon_16 $4. @273 enifla_16 $1. @274 econdp_17 1. @275 econds_17 $1. @276 enicon_17 $4. @280 enifla_17 $1. @281 econdp_18 1. @282 econds_18 $1. @283 enicon_18 $4. @287 enifla_18 $1. @288 econdp_19 1. @289 econds_19 $1. @294 enifla_19 $1. @290 enicon_19 $4. @295 econdp_20 1. @296 econds_20 $1. @297 enicon_20 $4. @301 enifla_20 $1. @338 ranum 2. @341 record_1 $4. @345 rnifla_1 1. @346 record_2 $4. @350 rnifla_2 1. @351 record_3 $4. @355 rnifla_3 1. @356 record_4 $4. @360 rnifla_4 1. @361 record_5 $4. @365 rnifla_5 1. @366 record_6 $4. @370 rnifla_6 1. @371 record_7 $4. @375 rnifla_7 1. @376 record_8 $4. @380 rnifla_8 1. @381 record_9 $4. @385 rnifla_9 1. @386 record_10 $4. @390 rnifla_10 1. @391 record_11 $4. @395 rnifla_11 1. @396 record_12 $4. @400 rnifla_12 1. @401 record_13 $4. @405 rnifla_13 1. @406 record_14 $4. @410 rnifla_14 1. @411 record_15 $4. @415 rnifla_15 1. @416 record_16 $4. @420 rnifla_16 1. @421 record_17 $4. @425 rnifla_17 1. @426 record_18 $4. @430 rnifla_18 1. @431 record_19 $4. @435 rnifla_19 1. @436 record_20 $4. @440 rnifla_20 1. ; proc print data=library.mort1997 (obs=6); proc contents data=library.mort1997; /* Copyright 2007 shared by the National Bureau of Economic Research and Jean Roth National Bureau of Economic Research. 1050 Massachusetts Avenue Cambridge, MA 02138 jroth@nber.org This program and all programs referenced in it are free software. You can redistribute the program or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */