1 The SAS System 11:30 Tuesday, November 25, 2014 NOTE: Copyright (c) 2002-2010 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) Proprietary Software 9.3 (TS1M0) Licensed to NATIONAL BUREAU OF ECONOMIC RESEARCH, Site 70111351. NOTE: This session is executing on the Linux 2.6.32-431.29.2.el6.x86_64 (LIN X64) platform. 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 7.42 seconds cpu time 0.07 seconds 1 *options obs=100 ; 2 options nocenter ; 3 4 **------------------------------------------------ ; 5 ** by Jean Roth Mon Jul 14 16:29:14 EDT 2014 6 ** This program reads the 1994 NCHS Multiple Cause of Death Data Data File ; 7 ** Report errors to jroth@nber.org ; 8 ** This program is distributed under the GNU GPL. ; 9 ** See end of this file and 10 ** http://www.gnu.org/licenses/ for details. ; 11 ** ----------------------------------------------- ; 12 13 * The following line should contain the directory 14 where the SAS file is to be stored ; 15 16 libname library "/homes/data/mortality/1994/"; NOTE: Libref LIBRARY was successfully assigned as follows: Engine: V9 Physical Name: /homes/data/mortality/1994 17 18 * The following line should contain 19 the complete path and name of the raw data file. 20 On a PC, use backslashes in paths as in C:\ ; 21 22 FILENAME datafile pipe "unzip -p /homes/data/mortality/1994/mort1994us.zip "; 23 24 * The following line should contain the name of the SAS dataset ; 25 26 %let dataset = library.mort1994; 2 The SAS System 11:30 Tuesday, November 25, 2014 27 28 DATA &dataset ; 29 30 INFILE datafile LRECL = 20000 ; 31 attrib datayear length=3 label=""; 32 attrib rectype length=3 label=""; 33 attrib restatus length=3 label=""; 34 attrib countyoc length=$5 label=""; 35 attrib stateoc length=$2 label=""; 36 attrib region length=3 label=""; 37 attrib divstoc length=$2 label=""; 38 attrib exstatoc length=$2 label=""; 39 attrib countyrs length=$5 label=""; 40 attrib staters length=$2 label=""; 41 attrib cityrs length=$5 label=""; 42 attrib popsize length=$1 label=""; 43 attrib metro length=$1 label=""; 44 attrib regnres length=3 label=""; 45 attrib divstres length=3 label=""; 46 attrib exstares length=$2 label=""; 47 attrib pmsares length=$3 label=""; 48 attrib popsizoc length=3 label=""; 49 attrib popsizrs length=$1 label=""; 50 attrib popmsa length=$1 label=""; 51 attrib educ length=3 label=""; 52 attrib educr length=3 label=""; 53 attrib monthdth length=3 label=""; 54 attrib sex length=3 label=""; 55 attrib race length=3 label=""; 56 attrib racer3 length=3 label=""; 57 attrib racer2 length=3 label=""; 58 attrib age length=3 label=""; 59 attrib ager52 length=3 label=""; 60 attrib ager27 length=3 label=""; 61 attrib ager12 length=3 label=""; 62 attrib ager22 length=3 label=""; 63 attrib placdth length=3 label=""; 64 attrib marstat length=3 label=""; 65 attrib statebth length=3 label=""; 66 attrib hispanic length=3 label=""; 67 attrib hspanicr length=3 label=""; 68 attrib weekday length=3 label=""; 69 attrib autopsy length=3 label=""; 70 attrib industry length=3 label=""; 71 attrib occup length=3 label=""; 72 attrib ucr52 length=3 label=""; 73 attrib fipscity length=$5 label=""; 74 attrib fipsctyo length=$5 label=""; 75 attrib fipssto length=$2 label=""; 76 attrib fipsctyr length=$5 label=""; 77 attrib fipsstr length=$2 label=""; 78 attrib fipspmsa length=$4 label=""; 79 attrib fipscmsa length=$2 label=""; 80 attrib injwork length=3 label=""; 81 attrib raceimp length=3 label=""; 82 attrib ageflag length=3 label=""; 83 attrib accident length=3 label=""; 84 attrib ucod length=$4 label=""; 3 The SAS System 11:30 Tuesday, November 25, 2014 85 attrib ucr282 length=4 label=""; 86 attrib ucr72 length=3 label=""; 87 attrib ucr61 length=3 label=""; 88 attrib ucr34 length=3 label=""; 89 attrib eanum length=3 label=""; 90 attrib econdp_1 length=3 label="Part/line number on certificate 1"; 91 attrib econds_1 length=$1 label="Sequence of condition within part/line 1"; 92 attrib enicon_1 length=$4 label="Condition code 1 (ICD 9th Revision)"; 93 attrib eniflag_1 length=3 label="Nature of Injury Flag 1"; 94 attrib econdp_2 length=3 label="Part/line number on certificate 2"; 95 attrib econds_2 length=$1 label="Sequence of condition within part/line 2"; 96 attrib enicon_2 length=$4 label="Condition code 2 (ICD 9th Revision)"; 97 attrib eniflag_2 length=3 label="Nature of Injury Flag 2"; 98 attrib econdp_3 length=3 label="Part/line number on certificate 3"; 99 attrib econds_3 length=$1 label="Sequence of condition within part/line 3"; 100 attrib enicon_3 length=$4 label="Condition code 3 (ICD 9th Revision)"; 101 attrib eniflag_3 length=3 label="Nature of Injury Flag 3"; 102 attrib econdp_4 length=3 label="Part/line number on certificate 4"; 103 attrib econds_4 length=$1 label="Sequence of condition within part/line 4"; 104 attrib enicon_4 length=$4 label="Condition code 4 (ICD 9th Revision)"; 105 attrib eniflag_4 length=3 label="Nature of Injury Flag 4"; 106 attrib econdp_5 length=3 label="Part/line number on certificate 5"; 107 attrib econds_5 length=$1 label="Sequence of condition within part/line 5"; 108 attrib enicon_5 length=$4 label="Condition code 5 (ICD 9th Revision)"; 109 attrib eniflag_5 length=3 label="Nature of Injury Flag 5"; 110 attrib econdp_6 length=3 label="Part/line number on certificate 6"; 111 attrib econds_6 length=$1 label="Sequence of condition within part/line 6"; 112 attrib enicon_6 length=$4 label="Condition code 6 (ICD 9th Revision)"; 113 attrib eniflag_6 length=3 label="Nature of Injury Flag 6"; 114 attrib econdp_7 length=3 label="Part/line number on certificate 7"; 115 attrib econds_7 length=$1 label="Sequence of condition within part/line 7"; 116 attrib enicon_7 length=$4 label="Condition code 7 (ICD 9th Revision)"; 117 attrib eniflag_7 length=3 label="Nature of Injury Flag 7"; 118 attrib econdp_8 length=3 label="Part/line number on certificate 8"; 119 attrib econds_8 length=$1 label="Sequence of condition within part/line 8"; 120 attrib enicon_8 length=$4 label="Condition code 8 (ICD 9th Revision)"; 121 attrib eniflag_8 length=3 label="Nature of Injury Flag 8"; 122 attrib econdp_9 length=3 label="Part/line number on certificate 9"; 123 attrib econds_9 length=$1 label="Sequence of condition within part/line 9"; 124 attrib enicon_9 length=$4 label="Condition code 9 (ICD 9th Revision)"; 125 attrib eniflag_9 length=3 label="Nature of Injury Flag 9"; 126 attrib econdp_10 length=3 label="Part/line number on certificate 10"; 127 attrib econds_10 length=$1 label="Sequence of condition within part/line 10"; 128 attrib enicon_10 length=$4 label="Condition code 10 (ICD 9th Revision)"; 129 attrib eniflag_10 length=3 label="Nature of Injury Flag 10"; 130 attrib econdp_11 length=3 label="Part/line number on certificate 11"; 131 attrib econds_11 length=$1 label="Sequence of condition within part/line 11"; 132 attrib enicon_11 length=$4 label="Condition code 11 (ICD 9th Revision)"; 133 attrib eniflag_11 length=3 label="Nature of Injury Flag 11"; 134 attrib econdp_12 length=3 label="Part/line number on certificate 12"; 135 attrib econds_12 length=$1 label="Sequence of condition within part/line 12"; 136 attrib enicon_12 length=$4 label="Condition code 12 (ICD 9th Revision)"; 137 attrib eniflag_12 length=3 label="Nature of Injury Flag 12"; 138 attrib econdp_13 length=3 label="Part/line number on certificate 13"; 139 attrib econds_13 length=$1 label="Sequence of condition within part/line 13"; 140 attrib enicon_13 length=$4 label="Condition code 13 (ICD 9th Revision)"; 141 attrib eniflag_13 length=3 label="Nature of Injury Flag 13"; 142 attrib econdp_14 length=3 label="Part/line number on certificate 14"; 4 The SAS System 11:30 Tuesday, November 25, 2014 143 attrib econds_14 length=$1 label="Sequence of condition within part/line 14"; 144 attrib enicon_14 length=$4 label="Condition code 14 (ICD 9th Revision)"; 145 attrib eniflag_14 length=3 label="Nature of Injury Flag 14"; 146 attrib econdp_15 length=3 label="Part/line number on certificate 15"; 147 attrib econds_15 length=$1 label="Sequence of condition within part/line 15"; 148 attrib enicon_15 length=$4 label="Condition code 15 (ICD 9th Revision)"; 149 attrib eniflag_15 length=3 label="Nature of Injury Flag 15"; 150 attrib econdp_16 length=3 label="Part/line number on certificate 16"; 151 attrib econds_16 length=$1 label="Sequence of condition within part/line 16"; 152 attrib enicon_16 length=$4 label="Condition code 16 (ICD 9th Revision)"; 153 attrib eniflag_16 length=3 label="Nature of Injury Flag 16"; 154 attrib econdp_17 length=3 label="Part/line number on certificate 17"; 155 attrib econds_17 length=$1 label="Sequence of condition within part/line 17"; 156 attrib enicon_17 length=$4 label="Condition code 17 (ICD 9th Revision)"; 157 attrib eniflag_17 length=3 label="Nature of Injury Flag 17"; 158 attrib econdp_18 length=3 label="Part/line number on certificate 18"; 159 attrib econds_18 length=$1 label="Sequence of condition within part/line 18"; 160 attrib enicon_18 length=$4 label="Condition code 18 (ICD 9th Revision)"; 161 attrib eniflag_18 length=3 label="Nature of Injury Flag 18"; 162 attrib econdp_19 length=3 label="Part/line number on certificate 19"; 163 attrib econds_19 length=$1 label="Sequence of condition within part/line 19"; 164 attrib enicon_19 length=$4 label="Condition code 19 (ICD 9th Revision)"; 165 attrib eniflag_19 length=3 label="Nature of Injury Flag 19"; 166 attrib econdp_20 length=3 label="Part/line number on certificate 20"; 167 attrib econds_20 length=$1 label="Sequence of condition within part/line 20"; 168 attrib enicon_20 length=$4 label="Condition code 20 (ICD 9th Revision)"; 169 attrib eniflag_20 length=3 label="Nature of Injury Flag 20"; 170 attrib ranum length=3 label=""; 171 attrib record_1 length=$4 label="Record-Axis Condition Code 1 (ICD 9th Revision)"; 172 attrib rniflag_1 length=3 label="Nature of Injury Flag 1"; 173 attrib record_2 length=$4 label="Record-Axis Condition Code 2 (ICD 9th Revision)"; 174 attrib rniflag_2 length=3 label="Nature of Injury Flag 2"; 175 attrib record_3 length=$4 label="Record-Axis Condition Code 3 (ICD 9th Revision)"; 176 attrib rniflag_3 length=3 label="Nature of Injury Flag 3"; 177 attrib record_4 length=$4 label="Record-Axis Condition Code 4 (ICD 9th Revision)"; 178 attrib rniflag_4 length=3 label="Nature of Injury Flag 4"; 179 attrib record_5 length=$4 label="Record-Axis Condition Code 5 (ICD 9th Revision)"; 180 attrib rniflag_5 length=3 label="Nature of Injury Flag 5"; 181 attrib record_6 length=$4 label="Record-Axis Condition Code 6 (ICD 9th Revision)"; 182 attrib rniflag_6 length=3 label="Nature of Injury Flag 6"; 183 attrib record_7 length=$4 label="Record-Axis Condition Code 7 (ICD 9th Revision)"; 184 attrib rniflag_7 length=3 label="Nature of Injury Flag 7"; 185 attrib record_8 length=$4 label="Record-Axis Condition Code 8 (ICD 9th Revision)"; 186 attrib rniflag_8 length=3 label="Nature of Injury Flag 8"; 187 attrib record_9 length=$4 label="Record-Axis Condition Code 9 (ICD 9th Revision)"; 188 attrib rniflag_9 length=3 label="Nature of Injury Flag 9"; 189 attrib record_10 length=$4 label="Record-Axis Condition Code 10 (ICD 9th Revision)"; 190 attrib rniflag_10 length=3 label="Nature of Injury Flag 10"; 191 attrib record_11 length=$4 label="Record-Axis Condition Code 11 (ICD 9th Revision)"; 192 attrib rniflag_11 length=3 label="Nature of Injury Flag 11"; 193 attrib record_12 length=$4 label="Record-Axis Condition Code 12 (ICD 9th Revision)"; 194 attrib rniflag_12 length=3 label="Nature of Injury Flag 12"; 195 attrib record_13 length=$4 label="Record-Axis Condition Code 13 (ICD 9th Revision)"; 196 attrib rniflag_13 length=3 label="Nature of Injury Flag 13"; 197 attrib record_14 length=$4 label="Record-Axis Condition Code 14 (ICD 9th Revision)"; 198 attrib rniflag_14 length=3 label="Nature of Injury Flag 14"; 199 attrib record_15 length=$4 label="Record-Axis Condition Code 15 (ICD 9th Revision)"; 200 attrib rniflag_15 length=3 label="Nature of Injury Flag 15"; 5 The SAS System 11:30 Tuesday, November 25, 2014 201 attrib record_16 length=$4 label="Record-Axis Condition Code 16 (ICD 9th Revision)"; 202 attrib rniflag_16 length=3 label="Nature of Injury Flag 16"; 203 attrib record_17 length=$4 label="Record-Axis Condition Code 17 (ICD 9th Revision)"; 204 attrib rniflag_17 length=3 label="Nature of Injury Flag 17"; 205 attrib record_18 length=$4 label="Record-Axis Condition Code 18 (ICD 9th Revision)"; 206 attrib rniflag_18 length=3 label="Nature of Injury Flag 18"; 207 attrib record_19 length=$4 label="Record-Axis Condition Code 19 (ICD 9th Revision)"; 208 attrib rniflag_19 length=3 label="Nature of Injury Flag 19"; 209 attrib record_20 length=$4 label="Record-Axis Condition Code 20 (ICD 9th Revision)"; 210 attrib rniflag_20 length=3 label="Nature of Injury Flag 20"; 211 212 213 INPUT 214 215 @1 datayear 2. 216 @19 rectype 1. 217 @20 restatus 1. 218 @21 countyoc $5. 219 @21 stateoc $2. 220 @26 region 1. 221 @27 divstoc $2. 222 @29 exstatoc $2. 223 @31 countyrs $5. 224 @31 staters $2. 225 @36 cityrs $5. 226 @39 popsize $1. 227 @40 metro $1. 228 @41 regnres 1. 229 @42 divstres 2. 230 @44 exstares $2. 231 @46 pmsares $3. 232 @49 popsizoc 1. 233 @50 popsizrs $1. 234 @51 popmsa $1. 235 @52 educ 2. 236 @54 educr 1. 237 @55 monthdth 2. 238 @59 sex 1. 239 @60 race 2. 240 @62 racer3 1. 241 @63 racer2 1. 242 @64 age 3. 243 @67 ager52 2. 244 @69 ager27 2. 245 @71 ager12 2. 246 @73 ager22 2. 247 @75 placdth 1. 248 @77 marstat 1. 249 @78 statebth 2. 250 @80 hispanic 2. 251 @82 hspanicr 1. 252 @83 weekday 1. 253 @84 autopsy 1. 254 @85 industry 3. 255 @88 occup 3. 256 @91 ucr52 3. 257 @97 fipscity $5. 258 @119 fipsctyo $5. 6 The SAS System 11:30 Tuesday, November 25, 2014 259 @119 fipssto $2. 260 @124 fipsctyr $5. 261 @124 fipsstr $2. 262 @129 fipspmsa $4. 263 @134 fipscmsa $2. 264 @136 injwork 1. 265 @137 raceimp 1. 266 @138 ageflag 1. 267 @141 accident 1. 268 @142 ucod $4. 269 @146 ucr282 5. 270 @151 ucr72 3. 271 @154 ucr61 3. 272 @157 ucr34 3. 273 @160 eanum 2. 274 @162 econdp_1 1. 275 @163 econds_1 $1. 276 @164 enicon_1 $4. 277 @168 eniflag_1 1. 278 @169 econdp_2 1. 279 @170 econds_2 $1. 280 @171 enicon_2 $4. 281 @175 eniflag_2 1. 282 @176 econdp_3 1. 283 @177 econds_3 $1. 284 @178 enicon_3 $4. 285 @182 eniflag_3 1. 286 @183 econdp_4 1. 287 @184 econds_4 $1. 288 @185 enicon_4 $4. 289 @189 eniflag_4 1. 290 @190 econdp_5 1. 291 @191 econds_5 $1. 292 @192 enicon_5 $4. 293 @196 eniflag_5 1. 294 @197 econdp_6 1. 295 @198 econds_6 $1. 296 @199 enicon_6 $4. 297 @203 eniflag_6 1. 298 @204 econdp_7 1. 299 @205 econds_7 $1. 300 @206 enicon_7 $4. 301 @210 eniflag_7 1. 302 @211 econdp_8 1. 303 @212 econds_8 $1. 304 @213 enicon_8 $4. 305 @217 eniflag_8 1. 306 @218 econdp_9 1. 307 @219 econds_9 $1. 308 @220 enicon_9 $4. 309 @224 eniflag_9 1. 310 @225 econdp_10 1. 311 @226 econds_10 $1. 312 @227 enicon_10 $4. 313 @231 eniflag_10 1. 314 @232 econdp_11 1. 315 @233 econds_11 $1. 316 @234 enicon_11 $4. 7 The SAS System 11:30 Tuesday, November 25, 2014 317 @238 eniflag_11 1. 318 @239 econdp_12 1. 319 @240 econds_12 $1. 320 @241 enicon_12 $4. 321 @245 eniflag_12 1. 322 @246 econdp_13 1. 323 @247 econds_13 $1. 324 @248 enicon_13 $4. 325 @252 eniflag_13 1. 326 @253 econdp_14 1. 327 @254 econds_14 $1. 328 @255 enicon_14 $4. 329 @259 eniflag_14 1. 330 @260 econdp_15 1. 331 @261 econds_15 $1. 332 @262 enicon_15 $4. 333 @266 eniflag_15 1. 334 @267 econdp_16 1. 335 @268 econds_16 $1. 336 @269 enicon_16 $4. 337 @273 eniflag_16 1. 338 @274 econdp_17 1. 339 @275 econds_17 $1. 340 @276 enicon_17 $4. 341 @280 eniflag_17 1. 342 @281 econdp_18 1. 343 @282 econds_18 $1. 344 @283 enicon_18 $4. 345 @287 eniflag_18 1. 346 @288 econdp_19 1. 347 @289 econds_19 $1. 348 @290 enicon_19 $4. 349 @294 eniflag_19 1. 350 @295 econdp_20 1. 351 @296 econds_20 $1. 352 @297 enicon_20 $4. 353 @301 eniflag_20 1. 354 @338 ranum 2. 355 @341 record_1 $4. 356 @345 rniflag_1 1. 357 @346 record_2 $4. 358 @350 rniflag_2 1. 359 @351 record_3 $4. 360 @355 rniflag_3 1. 361 @356 record_4 $4. 362 @360 rniflag_4 1. 363 @361 record_5 $4. 364 @365 rniflag_5 1. 365 @366 record_6 $4. 366 @370 rniflag_6 1. 367 @371 record_7 $4. 368 @375 rniflag_7 1. 369 @376 record_8 $4. 370 @380 rniflag_8 1. 371 @381 record_9 $4. 372 @385 rniflag_9 1. 373 @386 record_10 $4. 374 @390 rniflag_10 1. 8 The SAS System 11:30 Tuesday, November 25, 2014 375 @391 record_11 $4. 376 @395 rniflag_11 1. 377 @396 record_12 $4. 378 @400 rniflag_12 1. 379 @401 record_13 $4. 380 @405 rniflag_13 1. 381 @406 record_14 $4. 382 @410 rniflag_14 1. 383 @411 record_15 $4. 384 @415 rniflag_15 1. 385 @416 record_16 $4. 386 @420 rniflag_16 1. 387 @421 record_17 $4. 388 @425 rniflag_17 1. 389 @426 record_18 $4. 390 @430 rniflag_18 1. 391 @431 record_19 $4. 392 @435 rniflag_19 1. 393 @436 record_20 $4. 394 @440 rniflag_20 1. 395 ; 396 NOTE: The infile DATAFILE is: Pipe command="unzip -p /homes/data/mortality/1994/mort1994us.zip " NOTE: 2282288 records were read from the infile DATAFILE. The minimum record length was 441. The maximum record length was 441. NOTE: The data set LIBRARY.MORT1994 has 2282288 observations and 180 variables. NOTE: DATA statement used (Total process time): real time 34.57 seconds cpu time 16.47 seconds 397 proc print data=&dataset. (obs=6); 398 NOTE: There were 6 observations read from the data set LIBRARY.MORT1994. NOTE: The PROCEDURE PRINT printed pages 1-2. NOTE: PROCEDURE PRINT used (Total process time): real time 1.01 seconds cpu time 0.02 seconds 399 proc contents data=&dataset.; 400 401 402 ** Copyright 2014 shared by the National Bureau of Economic Research and Jean Roth ; 403 ** 404 ** National Bureau of Economic Research. ; 405 ** 1050 Massachusetts Avenue ; 406 ** Cambridge, MA 02138 ; 407 ** jroth@nber.org ; 408 ** 409 ** This program and all programs referenced in it are free software. You ; 410 ** can redistribute the program or modify it under the terms of the GNU ; 411 ** General Public License as published by the Free Software Foundation; ; 9 The SAS System 11:30 Tuesday, November 25, 2014 412 ** either version 2 of the License, or (at your option) any later version. ; 413 ** 414 ** This program is distributed in the hope that it will be useful, ; 415 ** but WITHOUT ANY WARRANTY -- without even the implied warranty of ; 416 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; 417 ** GNU General Public License for more details. ; 418 ** 419 ** You should have received a copy of the GNU General Public License ; 420 ** along with this program -- if not, write to the Free Software ; 421 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 ; 422 ** USA. ; 423 NOTE: The PROCEDURE CONTENTS printed pages 3-7. NOTE: PROCEDURE CONTENTS used (Total process time): real time 3.55 seconds cpu time 0.01 seconds NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 47.64 seconds cpu time 16.57 seconds