1 The SAS System 16:50 Wednesday, May 10, 2006 NOTE: Copyright (c) 2002-2003 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) 9.1 (TS1M3) Licensed to HARVARD SCHOOL OF PUBLIC HEALTH-INSTRUCTIONAL COMP, Site 0001177014. NOTE: This session is executing on the SunOS 5.9 platform. NOTE: SAS 9.1.3 Service Pack 3 ----------------------------------------------------------------------- NBER NOTE: sas now defaults to sas9. sas8 or sas6 will invoke sas version 8 or 6 respectively. - 2005/10/21 ----------------------------------------------------------------------- You are running SAS 9. Some SAS 8 files will be automatically converted by the V9 engine; others are incompatible. Please see http://support.sas.com/rnd/migration/planning/platform/64bit.html PROC MIGRATE will preserve current SAS file attributes and is recommended for converting all your SAS libraries from any SAS 8 release to SAS 9. For details and examples, please see http://support.sas.com/rnd/migration/index.html This message is contained in the SAS news file, and is presented upon initialization. Edit the file "news" in the "misc/base" directory to display site-specific news and information in the program log. The command line option "-nonews" will prevent this display. NOTE: SAS initialization used: real time 0.33 seconds cpu time 0.27 seconds 1 options obs=100 ; 2 options nocenter ; 3 4 /*------------------------------------------------ 5 by Jean Roth Wed May 10 16:49:41 EDT 2006 6 This program reads the 1997 NCHS Multiple Cause of Death Data Data File 7 8 Report errors to jroth@nber.org 9 This program is distributed under the GNU GPL. 10 See end of this file and 11 http://www.gnu.org/licenses/ for details. 12 ----------------------------------------------- */ 13 14 * The following line should contain the directory 15 where the SAS file is to be stored ; 16 17 libname library "./"; NOTE: Libref LIBRARY was successfully assigned as follows: Engine: V9 Physical Name: /disk/homes2b/nber/jroth/text 18 19 * The following line should contain 20 the complete path and name of the raw data file. 2 The SAS System 16:50 Wednesday, May 10, 2006 21 On a PC, use backslashes in paths as in C:\ ; 22 23 FILENAME datafile pipe "unzip -p /homes/data/mortality/1997/data/Mort97.zip "; 24 25 * The following line should contain the name of the SAS dataset ; 26 27 %let dataset = mort1997 ; 28 29 DATA library.&dataset ; 30 31 INFILE datafile LRECL = 20000 ; 32 attrib rectype length=3 label="Record Type"; 33 attrib restatus length=3 label="Resident Status"; 34 attrib stateoc length=3 label="State of Occurrence"; 35 attrib countyoc length=3 label="County of Occurrence"; 36 attrib region length=3 label="Region"; 37 attrib divstoc length=3 label="Division and State Subcode of Occurrence"; 38 attrib exstatoc length=3 label="Expanded State of Occurrence Code"; 39 attrib staters length=3 label="State of Residence"; 40 attrib countyrs length=$3 label="County of Residence"; 41 attrib cityrs length=$3 label="City of Residence"; 42 attrib popsize length=$1 label="Population Size of City of Residence"; 43 attrib metro length=$1 label="Metropolitan - Nonmetropolitan County of Residence"; 44 attrib regnres length=3 label="Region"; 45 attrib divstres length=3 label="Division and State Subcode of Residence"; 46 attrib exstares length=3 label="Expanded State of Residence Code"; 47 attrib pmsares length=$3 label="NCHS PMSA/MSA of Residence"; 48 attrib popsizoc length=3 label="Population Size of County of Occurrence"; 49 attrib popsizrs length=$1 label="Population Size of County of Residence"; 50 attrib popmsa length=$1 label="PMSA/MSA Population Size"; 51 attrib educ length=3 label="Education"; 52 attrib educr length=3 label="Education recode"; 53 attrib monthdth length=3 label="Month of Death"; 54 attrib sex length=3 label="Sex"; 55 attrib race length=3 label="Detail Race"; 56 attrib racer3 length=3 label="Race Recode 3"; 57 attrib racer2 length=3 label="Race Recode 2"; 58 attrib age length=3 label="Detail Age"; 59 attrib ager52 length=3 label="Age Recode 52"; 60 attrib ager27 length=3 label="Age Recode 27"; 61 attrib ager12 length=3 label="Age Recode 12"; 62 attrib ager22 length=3 label="Infant Age Recode 22"; 63 attrib placdth length=3 label="Place of Death and Decedent’s Status"; 64 attrib marstat length=3 label="Marital Status"; 65 attrib statbth length=3 label="State of Birth"; 66 attrib hispanic length=3 label="Hispanic Origin"; 67 attrib hspanicr length=3 label="Hispanic Origin/Race Recode"; 68 attrib weekday length=3 label="Day of Week of Death"; 69 attrib industry length=3 label="Kind of Business or Industry"; 70 attrib occup length=3 label="Usual Occupation"; 71 attrib ucr52 length=3 label="52 Cause Recode"; 72 attrib fipscity length=4 label="Place (city) of Residence (FIPS)"; 73 attrib year length=4 label="Current Data Year"; 74 attrib fipssto length=3 label="State of Occurrence (FIPS)"; 75 attrib fipscty length=3 label="County of Occurrence (FIPS)"; 76 attrib fipsstr length=3 label="State of Residence (FIPS)"; 77 attrib fipsctyr length=3 label="County of Residence (FIPS)"; 78 attrib fipspmsa length=4 label="PMSA/MSA of Residence (FIPS)"; 3 The SAS System 16:50 Wednesday, May 10, 2006 79 attrib fipscmsa length=3 label="CMSA of Residence (FIPS)"; 80 attrib injwork length=3 label="Injury at Work"; 81 attrib raceimp length=3 label="Race Imputation Flag"; 82 attrib ageflag length=3 label="Age Substitution Flag"; 83 attrib accident length=3 label="Place of Accident for Causes E850-E869 and E880-E928"; 84 attrib ucod length=$4 label="ICD Code (9th Revision)"; 85 attrib ucr282 length=4 label="282 Cause Recode"; 86 attrib ucr72 length=3 label="72 Cause Recode"; 87 attrib ucr61 length=3 label="61 Cause Recode"; 88 attrib ucr34 length=3 label="34 Cause Recode"; 89 attrib eanum length=3 label="Number of Entity-Axis Conditions"; 90 attrib econdp_1 length=3 label="Part/line number on certificate"; 91 attrib econds_1 length=3 label="Sequence of condition within part/line"; 92 attrib enicon_1 length=$4 label="Condition code"; 93 attrib enifla_1 length=3 label="Nature of Injury Flag"; 94 attrib econdp_2 length=3 label="Part/line number on certificate"; 95 attrib econds_2 length=3 label="Sequence of condition within part/line"; 96 attrib enicon_2 length=$4 label="Condition code"; 97 attrib enifla_2 length=3 label="Nature of Injury Flag"; 98 attrib econdp_3 length=3 label="Part/line number on certificate"; 99 attrib econds_3 length=3 label="Sequence of condition within part/line"; 100 attrib enicon_3 length=$4 label="Condition code"; 101 attrib enifla_3 length=3 label="Nature of Injury Flag"; 102 attrib econdp_4 length=3 label="Part/line number on certificate"; 103 attrib econds_4 length=3 label="Sequence of condition within part/line"; 104 attrib enicon_4 length=$4 label="Condition code"; 105 attrib enifla_4 length=3 label="Nature of Injury Flag"; 106 attrib econdp_5 length=3 label="Part/line number on certificate"; 107 attrib econds_5 length=3 label="Sequence of condition within part/line"; 108 attrib enicon_5 length=$4 label="Condition code"; 109 attrib enifla_5 length=3 label="Nature of Injury Flag"; 110 attrib econdp_6 length=3 label="Part/line number on certificate"; 111 attrib econds_6 length=3 label="Sequence of condition within part/line"; 112 attrib enicon_6 length=$4 label="Condition code"; 113 attrib enifla_6 length=3 label="Nature of Injury Flag"; 114 attrib econdp_7 length=3 label="Part/line number on certificate"; 115 attrib econds_7 length=3 label="Sequence of condition within part/line"; 116 attrib enicon_7 length=$4 label="Condition code"; 117 attrib enifla_7 length=3 label="Nature of Injury Flag"; 118 attrib econdp_8 length=3 label="Part/line number on certificate"; 119 attrib econds_8 length=3 label="Sequence of condition within part/line"; 120 attrib enicon_8 length=$4 label="Condition code"; 121 attrib enifla_8 length=3 label="Nature of Injury Flag"; 122 attrib econdp_9 length=3 label="Part/line number on certificate"; 123 attrib econds_9 length=3 label="Sequence of condition within part/line"; 124 attrib enicon_9 length=$4 label="Condition code"; 125 attrib enifla_9 length=3 label="Nature of Injury Flag"; 126 attrib econdp_10 length=3 label="Part/line number on certificate"; 127 attrib econds_10 length=3 label="Sequence of condition within part/line"; 128 attrib enicon_10 length=$4 label="Condition code"; 129 attrib enifla_10 length=3 label="Nature of Injury Flag"; 130 attrib econdp_11 length=3 label="Part/line number on certificate"; 131 attrib econds_11 length=3 label="Sequence of condition within part/line"; 132 attrib enicon_11 length=$4 label="Condition code"; 133 attrib enifla_11 length=3 label="Nature of Injury Flag"; 134 attrib econdp_12 length=3 label="Part/line number on certificate"; 135 attrib econds_12 length=3 label="Sequence of condition within part/line"; 136 attrib enicon_12 length=$4 label="Condition code"; 4 The SAS System 16:50 Wednesday, May 10, 2006 137 attrib enifla_12 length=3 label="Nature of Injury Flag"; 138 attrib econdp_13 length=3 label="Part/line number on certificate"; 139 attrib econds_13 length=3 label="Sequence of condition within part/line"; 140 attrib enicon_13 length=$4 label="Condition code"; 141 attrib enifla_13 length=3 label="Nature of Injury Flag"; 142 attrib econdp_14 length=3 label="Part/line number on certificate"; 143 attrib econds_14 length=3 label="Sequence of condition within part/line"; 144 attrib enicon_14 length=$4 label="Condition code"; 145 attrib enifla_14 length=3 label="Nature of Injury Flag"; 146 attrib econdp_15 length=3 label="Part/line number on certificate"; 147 attrib econds_15 length=3 label="Sequence of condition within part/line"; 148 attrib enicon_15 length=$4 label="Condition code"; 149 attrib enifla_15 length=3 label="Nature of Injury Flag"; 150 attrib econdp_16 length=3 label="Part/line number on certificate"; 151 attrib econds_16 length=3 label="Sequence of condition within part/line"; 152 attrib enicon_16 length=$4 label="Condition code"; 153 attrib enifla_16 length=3 label="Nature of Injury Flag"; 154 attrib econdp_17 length=3 label="Part/line number on certificate"; 155 attrib econds_17 length=3 label="Sequence of condition within part/line"; 156 attrib enicon_17 length=$4 label="Condition code"; 157 attrib enifla_17 length=3 label="Nature of Injury Flag"; 158 attrib econdp_18 length=3 label="Part/line number on certificate"; 159 attrib econds_18 length=3 label="Sequence of condition within part/line"; 160 attrib enicon_18 length=$4 label="Condition code"; 161 attrib enifla_18 length=3 label="Nature of Injury Flag"; 162 attrib econdp_19 length=3 label="Part/line number on certificate"; 163 attrib econds_19 length=3 label="Sequence of condition within part/line"; 164 attrib enicon_19 length=$4 label="Condition code"; 165 attrib enifla_19 length=3 label="Nature of Injury Flag"; 166 attrib econdp_20 length=3 label="Part/line number on certificate"; 167 attrib econds_20 length=3 label="Sequence of condition within part/line"; 168 attrib enicon_20 length=$4 label="Condition code"; 169 attrib enifla_20 length=3 label="Nature of Injury Flag"; 170 attrib ranum length=3 label="Number of Record-Axis Conditions"; 171 attrib record_1 length=$4 label="Condition"; 172 attrib rnifla_1 length=3 label="Nature of Injury Flag and Condition"; 173 attrib record_2 length=$4 label="Condition"; 174 attrib rnifla_2 length=3 label="Nature of Injury Flag and Condition"; 175 attrib record_3 length=$4 label="Condition"; 176 attrib rnifla_3 length=3 label="Nature of Injury Flag and Condition"; 177 attrib record_4 length=$4 label="Condition"; 178 attrib rnifla_4 length=3 label="Nature of Injury Flag and Condition"; 179 attrib record_5 length=$4 label="Condition"; 180 attrib rnifla_5 length=3 label="Nature of Injury Flag and Condition"; 181 attrib record_6 length=$4 label="Condition"; 182 attrib rnifla_6 length=3 label="Nature of Injury Flag and Condition"; 183 attrib record_7 length=$4 label="Condition"; 184 attrib rnifla_7 length=3 label="Nature of Injury Flag and Condition"; 185 attrib record_8 length=$4 label="Condition"; 186 attrib rnifla_8 length=3 label="Nature of Injury Flag and Condition"; 187 attrib record_9 length=$4 label="Condition"; 188 attrib rnifla_9 length=3 label="Nature of Injury Flag and Condition"; 189 attrib record_10 length=$4 label="Condition"; 190 attrib rnifla_10 length=3 label="Nature of Injury Flag and Condition"; 191 attrib record_11 length=$4 label="Condition"; 192 attrib rnifla_11 length=3 label="Nature of Injury Flag and Condition"; 193 attrib record_12 length=$4 label="Condition"; 194 attrib rnifla_12 length=3 label="Nature of Injury Flag and Condition"; 5 The SAS System 16:50 Wednesday, May 10, 2006 195 attrib record_13 length=$4 label="Condition"; 196 attrib rnifla_13 length=3 label="Nature of Injury Flag and Condition"; 197 attrib record_14 length=$4 label="Condition"; 198 attrib rnifla_14 length=3 label="Nature of Injury Flag and Condition"; 199 attrib record_15 length=$4 label="Condition"; 200 attrib rnifla_15 length=3 label="Nature of Injury Flag and Condition"; 201 attrib record_16 length=$4 label="Condition"; 202 attrib rnifla_16 length=3 label="Nature of Injury Flag and Condition"; 203 attrib record_17 length=$4 label="Condition"; 204 attrib rnifla_17 length=3 label="Nature of Injury Flag and Condition"; 205 attrib record_18 length=$4 label="Condition"; 206 attrib rnifla_18 length=3 label="Nature of Injury Flag and Condition"; 207 attrib record_19 length=$4 label="Condition"; 208 attrib rnifla_19 length=3 label="Nature of Injury Flag and Condition"; 209 attrib record_20 length=$4 label="Condition"; 210 attrib rnifla_20 length=3 label="Nature of Injury Flag and Condition"; 211 212 213 INPUT 214 215 @19 rectype 1. 216 @20 restatus 1. 217 @21 stateoc 2. 218 @23 countyoc 3. 219 @26 region 1. 220 @27 divstoc 2. 221 @29 exstatoc 2. 222 @31 staters 2. 223 @33 countyrs $3. 224 @36 cityrs $3. 225 @39 popsize $1. 226 @40 metro $1. 227 @41 regnres 1. 228 @42 divstres 2. 229 @44 exstares 2. 230 @46 pmsares $3. 231 @49 popsizoc 1. 232 @50 popsizrs $1. 233 @51 popmsa $1. 234 @52 educ 2. 235 @54 educr 1. 236 @55 monthdth 2. 237 @59 sex 1. 238 @60 race 2. 239 @62 racer3 1. 240 @63 racer2 1. 241 @64 age 3. 242 @67 ager52 2. 243 @69 ager27 2. 244 @71 ager12 2. 245 @73 ager22 2. 246 @75 placdth 1. 247 @77 marstat 1. 248 @78 statbth 2. 249 @80 hispanic 2. 250 @82 hspanicr 1. 251 @83 weekday 1. 252 @85 industry 3. 6 The SAS System 16:50 Wednesday, May 10, 2006 253 @88 occup 3. 254 @91 ucr52 3. 255 @97 fipscity 5. 256 @115 year 4. 257 @119 fipssto 2. 258 @121 fipscty 3. 259 @124 fipsstr 2. 260 @126 fipsctyr 3. 261 @129 fipspmsa 4. 262 @134 fipscmsa 2. 263 @136 injwork 1. 264 @137 raceimp 1. 265 @138 ageflag 1. 266 @141 accident 1. 267 @142 ucod $4. 268 @146 ucr282 5. 269 @151 ucr72 3. 270 @154 ucr61 3. 271 @157 ucr34 3. 272 @160 eanum 2. 273 @162 econdp_1 1. 274 @163 econds_1 1. 275 @164 enicon_1 $4. 276 @168 enifla_1 1. 277 @169 econdp_2 1. 278 @170 econds_2 1. 279 @174 enicon_2 $4. 280 @175 enifla_2 1. 281 @176 econdp_3 1. 282 @177 econds_3 1. 283 @181 enicon_3 $4. 284 @182 enifla_3 1. 285 @183 econdp_4 1. 286 @184 econds_4 1. 287 @188 enicon_4 $4. 288 @189 enifla_4 1. 289 @190 econdp_5 1. 290 @191 econds_5 1. 291 @195 enicon_5 $4. 292 @196 enifla_5 1. 293 @197 econdp_6 1. 294 @198 econds_6 1. 295 @202 enicon_6 $4. 296 @203 enifla_6 1. 297 @204 econdp_7 1. 298 @205 econds_7 1. 299 @209 enicon_7 $4. 300 @210 enifla_7 1. 301 @211 econdp_8 1. 302 @212 econds_8 1. 303 @216 enicon_8 $4. 304 @217 enifla_8 1. 305 @218 econdp_9 1. 306 @219 econds_9 1. 307 @223 enicon_9 $4. 308 @224 enifla_9 1. 309 @225 econdp_10 1. 310 @226 econds_10 1. 7 The SAS System 16:50 Wednesday, May 10, 2006 311 @230 enicon_10 $4. 312 @231 enifla_10 1. 313 @232 econdp_11 1. 314 @233 econds_11 1. 315 @237 enicon_11 $4. 316 @238 enifla_11 1. 317 @239 econdp_12 1. 318 @240 econds_12 1. 319 @244 enicon_12 $4. 320 @245 enifla_12 1. 321 @246 econdp_13 1. 322 @247 econds_13 1. 323 @251 enicon_13 $4. 324 @252 enifla_13 1. 325 @253 econdp_14 1. 326 @254 econds_14 1. 327 @258 enicon_14 $4. 328 @259 enifla_14 1. 329 @260 econdp_15 1. 330 @261 econds_15 1. 331 @265 enicon_15 $4. 332 @266 enifla_15 1. 333 @267 econdp_16 1. 334 @268 econds_16 1. 335 @272 enicon_16 $4. 336 @273 enifla_16 1. 337 @274 econdp_17 1. 338 @275 econds_17 1. 339 @279 enicon_17 $4. 340 @280 enifla_17 1. 341 @281 econdp_18 1. 342 @282 econds_18 1. 343 @286 enicon_18 $4. 344 @287 enifla_18 1. 345 @288 econdp_19 1. 346 @289 econds_19 1. 347 @293 enicon_19 $4. 348 @294 enifla_19 1. 349 @295 econdp_20 1. 350 @296 econds_20 1. 351 @300 enicon_20 $4. 352 @301 enifla_20 1. 353 @338 ranum 2. 354 @341 record_1 $4. 355 @345 rnifla_1 1. 356 @346 record_2 $4. 357 @350 rnifla_2 1. 358 @351 record_3 $4. 359 @355 rnifla_3 1. 360 @356 record_4 $4. 361 @360 rnifla_4 1. 362 @361 record_5 $4. 363 @365 rnifla_5 1. 364 @366 record_6 $4. 365 @370 rnifla_6 1. 366 @371 record_7 $4. 367 @375 rnifla_7 1. 368 @376 record_8 $4. 8 The SAS System 16:50 Wednesday, May 10, 2006 369 @380 rnifla_8 1. 370 @381 record_9 $4. 371 @385 rnifla_9 1. 372 @386 record_10 $4. 373 @390 rnifla_10 1. 374 @391 record_11 $4. 375 @395 rnifla_11 1. 376 @396 record_12 $4. 377 @400 rnifla_12 1. 378 @401 record_13 $4. 379 @405 rnifla_13 1. 380 @406 record_14 $4. 381 @410 rnifla_14 1. 382 @411 record_15 $4. 383 @415 rnifla_15 1. 384 @416 record_16 $4. 385 @420 rnifla_16 1. 386 @421 record_17 $4. 387 @425 rnifla_17 1. 388 @426 record_18 $4. 389 @430 rnifla_18 1. 390 @431 record_19 $4. 391 @435 rnifla_19 1. 392 @436 record_20 $4. 393 @440 rnifla_20 1. 394 ; 395 NOTE: The infile DATAFILE is: Pipe command="unzip -p /homes/data/mortality/1997/data/Mort97.zip " NOTE: 100 records were read from the infile DATAFILE. The minimum record length was 441. The maximum record length was 441. NOTE: The data set LIBRARY.MORT1997 has 100 observations and 179 variables. NOTE: DATA statement used (Total process time): real time 0.56 seconds cpu time 0.26 seconds 396 proc print data=library.mort1997 (obs=6); 397 NOTE: There were 6 observations read from the data set LIBRARY.MORT1997. NOTE: The PROCEDURE PRINT printed pages 1-2. NOTE: PROCEDURE PRINT used (Total process time): real time 0.16 seconds cpu time 0.11 seconds 398 proc contents data=library.mort1997; 399 400 /* 401 Copyright 2006 shared by the National Bureau of Economic Research and Jean Roth 402 403 National Bureau of Economic Research. 404 1050 Massachusetts Avenue 405 Cambridge, MA 02138 9 The SAS System 16:50 Wednesday, May 10, 2006 406 jroth@nber.org 407 408 This program and all programs referenced in it are free software. You 409 can redistribute the program or modify it under the terms of the GNU 410 General Public License as published by the Free Software Foundation; 411 either version 2 of the License, or (at your option) any later version. 412 413 This program is distributed in the hope that it will be useful, 414 but WITHOUT ANY WARRANTY; without even the implied warranty of 415 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 416 GNU General Public License for more details. 417 418 You should have received a copy of the GNU General Public License 419 along with this program; if not, write to the Free Software 420 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 421 USA. 422 */ NOTE: The PROCEDURE CONTENTS printed pages 3-6. NOTE: PROCEDURE CONTENTS used (Total process time): real time 0.12 seconds cpu time 0.09 seconds NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 1.31 seconds cpu time 0.81 seconds