*options obs=100 ; options nocenter ; **------------------------------------------------ ; ** by Jean Roth Thu Dec 13 15:46:14 EST 2012 ** This program reads the 2008 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/2008/mort2008.zip "; * The following line should contain the name of the SAS dataset ; %let dataset = library.mort2008; DATA &dataset ; INFILE datafile LRECL = 20000 ; attrib restatus length=3 label="Resident Status"; attrib educ1989 length=3 label="Education (1989 revision)"; attrib educ2003 length=3 label="Education (2003 revision)"; attrib educflag length=3 label="Education reporting flag"; attrib monthdth length=3 label="Month of Death"; attrib sex length=$1 label="Sex"; attrib age length=4 label="Detail Age"; attrib ageflag length=3 label="Age Substitution Flag"; 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=$1 label="Marital Status"; attrib weekday length=3 label="Day of Week of Death"; attrib year length=4 label="Current Data Year"; attrib injwork length=$1 label="Injury at Work"; attrib mandeath length=3 label="Manner of death"; attrib methdisp length=$1 label="Method of disposition"; attrib autopsy length=$1 label="Autopsy"; attrib activity length=3 label="Activity code"; attrib injury length=3 label="Place of Injury for Causes W00-Y34 except Y06.- and Y07.-"; attrib ucod length=$4 label="ICD Code (10th Revision)"; attrib ucr358 length=3 label="358 Cause Recode"; attrib ucr113 length=3 label="113 Cause Recode"; attrib ucr130 length=3 label="130 Cause Recode"; attrib ucr39 length=3 label="39 Cause Recode"; attrib eanum length=3 label="Number of Entity-Axis Conditions"; attrib econdp_1 length=3 label="Part/line number on certificate 1"; attrib econds_1 length=3 label="Sequence of condition within part/line 1"; attrib enicon_1 length=$4 label="Condition code 1"; attrib econdp_2 length=3 label="Part/line number on certificate 2"; attrib econds_2 length=3 label="Sequence of condition within part/line 2"; attrib enicon_2 length=$4 label="Condition code 2"; attrib econdp_3 length=3 label="Part/line number on certificate 3"; attrib econds_3 length=3 label="Sequence of condition within part/line 3"; attrib enicon_3 length=$4 label="Condition code 3"; attrib econdp_4 length=3 label="Part/line number on certificate 4"; attrib econds_4 length=3 label="Sequence of condition within part/line 4"; attrib enicon_4 length=$4 label="Condition code 4"; attrib econdp_5 length=3 label="Part/line number on certificate 5"; attrib econds_5 length=3 label="Sequence of condition within part/line 5"; attrib enicon_5 length=$4 label="Condition code 5"; attrib econdp_6 length=3 label="Part/line number on certificate 6"; attrib econds_6 length=3 label="Sequence of condition within part/line 6"; attrib enicon_6 length=$4 label="Condition code 6"; attrib econdp_7 length=3 label="Part/line number on certificate 7"; attrib econds_7 length=3 label="Sequence of condition within part/line 7"; attrib enicon_7 length=$4 label="Condition code 7"; attrib econdp_8 length=3 label="Part/line number on certificate 8"; attrib econds_8 length=3 label="Sequence of condition within part/line 8 "; attrib enicon_8 length=$4 label="Condition code 8"; attrib econdp_9 length=3 label="Part/line number on certificate 9"; attrib econds_9 length=3 label="Sequence of condition within part/line 9"; attrib enicon_9 length=$4 label="Condition code 9"; attrib econdp_10 length=3 label="Part/line number on certificate 10"; attrib econds_10 length=3 label="Sequence of condition within part/line 10"; attrib enicon_10 length=$4 label="Condition code 10"; attrib econdp_11 length=3 label="Part/line number on certificate 11"; attrib econds_11 length=3 label="Sequence of condition within part/line 11"; attrib enicon_11 length=$4 label="Condition code 11"; attrib econdp_12 length=3 label="Part/line number on certificate 12"; attrib econds_12 length=3 label="Sequence of condition within part/line 12"; attrib enicon_12 length=$4 label="Condition code 12"; attrib econdp_13 length=3 label="Part/line number on certificate 13"; attrib econds_13 length=3 label="Sequence of condition within part/line 13"; attrib enicon_13 length=$4 label="Condition code 13"; attrib econdp_14 length=3 label="Part/line number on certificate 14"; attrib econds_14 length=3 label="Sequence of condition within part/line 14"; attrib enicon_14 length=$4 label="Condition code 14"; attrib econdp_15 length=3 label="Part/line number on certificate 15"; attrib econds_15 length=3 label="Sequence of condition within part/line 15"; attrib enicon_15 length=$4 label="Condition code 15"; attrib econdp_16 length=3 label="Part/line number on certificate 16"; attrib econds_16 length=3 label="Sequence of condition within part/line 16"; attrib enicon_16 length=$4 label="Condition code 16"; attrib econdp_17 length=3 label="Part/line number on certificate 17"; attrib econds_17 length=3 label="Sequence of condition within part/line 17"; attrib enicon_17 length=$4 label="Condition code 17"; attrib econdp_18 length=3 label="Part/line number on certificate 18"; attrib econds_18 length=3 label="Sequence of condition within part/line 18"; attrib enicon_18 length=$4 label="Condition code 18"; attrib econdp_19 length=3 label="Part/line number on certificate 19"; attrib econds_19 length=3 label="Sequence of condition within part/line 19"; attrib enicon_19 length=$4 label="Condition code 19"; attrib econdp_20 length=3 label="Part/line number on certificate 20"; attrib econds_20 length=3 label="Sequence of condition within part/line 20"; attrib enicon_20 length=$4 label="Condition code 20"; attrib ranum length=3 label="Number of Record-Axis Conditions"; attrib record_1 length=$4 label="Condition 1"; attrib record_2 length=$4 label="Condition 2"; attrib record_3 length=$4 label="Condition 3"; attrib record_4 length=$4 label="Condition 4"; attrib record_5 length=$4 label="Condition 5"; attrib record_6 length=$4 label="Condition 6"; attrib record_7 length=$4 label="Condition 7"; attrib record_8 length=$4 label="Condition 8"; attrib record_9 length=$4 label="Condition 9"; attrib record_10 length=$4 label="Condition 10"; attrib record_11 length=$4 label="Condition 11"; attrib record_12 length=$4 label="Condition 12"; attrib record_13 length=$4 label="Condition 13"; attrib record_14 length=$4 label="Condition 14"; attrib record_15 length=$4 label="Condition 15"; attrib record_16 length=$4 label="Condition 16"; attrib record_17 length=$4 label="Condition 17"; attrib record_18 length=$4 label="Condition 18"; attrib record_19 length=$4 label="Condition 19"; attrib record_20 length=$4 label="Condition 20"; attrib race length=3 label="Detail Race"; attrib brace length=3 label="Bridged Race Flag"; attrib raceimp length=3 label="Race Imputation Flag"; attrib racer3 length=3 label="Race Recode 3"; attrib racer5 length=3 label="Race Recode 5"; attrib hispanic length=3 label="Hispanic Origin"; attrib hspanicr length=3 label="Hispanic Origin/Race Recode"; INPUT @20 restatus 1. @61 educ1989 2. @63 educ2003 1. @64 educflag 1. @65 monthdth 2. @69 sex $1. @70 age 4. @74 ageflag 1. @75 ager52 2. @77 ager27 2. @79 ager12 2. @81 ager22 2. @83 placdth 1. @84 marstat $1. @85 weekday 1. @102 year 4. @106 injwork $1. @107 mandeath 1. @108 methdisp $1. @109 autopsy $1. @144 activity 1. @145 injury 1. @146 ucod $4. @150 ucr358 3. @154 ucr113 3. @157 ucr130 3. @160 ucr39 2. @163 eanum 2. @165 econdp_1 1. @166 econds_1 1. @167 enicon_1 $4. @172 econdp_2 1. @173 econds_2 1. @174 enicon_2 $4. @179 econdp_3 1. @180 econds_3 1. @181 enicon_3 $4. @186 econdp_4 1. @187 econds_4 1. @188 enicon_4 $4. @193 econdp_5 1. @194 econds_5 1. @195 enicon_5 $4. @200 econdp_6 1. @201 econds_6 1. @202 enicon_6 $4. @207 econdp_7 1. @208 econds_7 1. @209 enicon_7 $4. @214 econdp_8 1. @215 econds_8 1. @216 enicon_8 $4. @221 econdp_9 1. @222 econds_9 1. @223 enicon_9 $4. @228 econdp_10 1. @229 econds_10 1. @230 enicon_10 $4. @235 econdp_11 1. @236 econds_11 1. @237 enicon_11 $4. @242 econdp_12 1. @243 econds_12 1. @244 enicon_12 $4. @249 econdp_13 1. @250 econds_13 1. @251 enicon_13 $4. @256 econdp_14 1. @257 econds_14 1. @258 enicon_14 $4. @263 econdp_15 1. @264 econds_15 1. @265 enicon_15 $4. @270 econdp_16 1. @271 econds_16 1. @272 enicon_16 $4. @277 econdp_17 1. @278 econds_17 1. @279 enicon_17 $4. @284 econdp_18 1. @285 econds_18 1. @286 enicon_18 $4. @291 econdp_19 1. @292 econds_19 1. @293 enicon_19 $4. @298 econdp_20 1. @299 econds_20 1. @300 enicon_20 $4. @341 ranum 2. @344 record_1 $4. @349 record_2 $4. @354 record_3 $4. @359 record_4 $4. @364 record_5 $4. @369 record_6 $4. @374 record_7 $4. @379 record_8 $4. @384 record_9 $4. @389 record_10 $4. @394 record_11 $4. @399 record_12 $4. @404 record_13 $4. @409 record_14 $4. @414 record_15 $4. @419 record_16 $4. @424 record_17 $4. @429 record_18 $4. @434 record_19 $4. @439 record_20 $4. @445 race 2. @447 brace 1. @448 raceimp 1. @449 racer3 1. @450 racer5 1. @484 hispanic 3. @488 hspanicr 1. ; proc print data=&dataset. (obs=6); proc contents data=&dataset.; ** Copyright 2012 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. ;