1 The SAS System 15:02 Wednesday, April 29, 2009 NOTE: Copyright (c) 2002-2003 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) 9.1 (TS1M3) Licensed to HARVARD UNIV - SCHOOL OF PUBLIC HEALTH - T&R, Site 0001177014. NOTE: This session is executing on the SunOS 5.10 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.83 seconds cpu time 0.14 seconds 1 *options obs=100 ; 2 options nocenter ; 3 4 /*------------------------------------------------ 5 by Jean Roth Thu Apr 23 12:25:35 EDT 2009 6 This program reads the 2006 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 "."; NOTE: Libref LIBRARY was successfully assigned as follows: Engine: V9 Physical Name: /disk/nber10/SCCS/mortality/2006 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:\ ; 2 The SAS System 15:02 Wednesday, April 29, 2009 21 22 FILENAME datafile pipe "unzip -p /homes/data/mortality/2006/mort2006.zip "; 23 24 * The following line should contain the name of the SAS dataset ; 25 26 %let dataset = library.mort2006; 27 28 DATA &dataset ; 29 30 INFILE datafile LRECL = 20000 ; 31 attrib restatus length=3 label="Resident Status"; 32 attrib educ1989 length=3 label="Education (1989 revision)"; 33 attrib educ2003 length=3 label="Education (2003 revision)"; 34 attrib educflag length=3 label="Education reporting flag"; 35 attrib monthdth length=3 label="Month of Death"; 36 attrib sex length=$1 label="Sex"; 37 attrib age length=4 label="Detail Age"; 38 attrib ageflag length=3 label="Age Substitution Flag"; 39 attrib ager52 length=3 label="Age Recode 52"; 40 attrib ager27 length=3 label="Age Recode 27"; 41 attrib ager12 length=3 label="Age Recode 12"; 42 attrib ager22 length=3 label="Infant Age Recode 22"; 43 attrib placdth length=3 label="Place of Death and Decedent's Status"; 44 attrib marstat length=$1 label="Marital Status"; 45 attrib weekday length=3 label="Day of Week of Death"; 46 attrib year length=4 label="Current Data Year"; 47 attrib injwork length=$1 label="Injury at Work"; 48 attrib mandeath length=3 label="Manner of death"; 49 attrib methdisp length=$1 label="Method of disposition"; 50 attrib autopsy length=$1 label="Autopsy"; 51 attrib activity length=3 label="Activity code"; 52 attrib injury length=3 label="Place of Injury for Causes W00-Y34 except Y06.- and Y07.-"; 53 attrib ucod length=$4 label="ICD Code (10th Revision)"; 54 attrib ucr358 length=3 label="358 Cause Recode"; 55 attrib ucr113 length=3 label="113 Cause Recode"; 56 attrib ucr130 length=3 label="130 Cause Recode"; 57 attrib ucr39 length=3 label="39 Cause Recode"; 58 attrib eanum length=3 label="Number of Entity-Axis Conditions"; 59 attrib econdp_1 length=3 label="Part/line number on certificate"; 60 attrib econds_1 length=3 label="Sequence of condition within part/line"; 61 attrib enicon_1 length=$4 label="Condition code"; 62 attrib econdp_2 length=3 label="Part/line number on certificate"; 63 attrib econds_2 length=3 label="Sequence of condition within part/line"; 64 attrib enicon_2 length=$4 label="Condition code"; 65 attrib econdp_3 length=3 label="Part/line number on certificate"; 66 attrib econds_3 length=3 label="Sequence of condition within part/line"; 67 attrib enicon_3 length=$4 label="Condition code"; 68 attrib econdp_4 length=3 label="Part/line number on certificate"; 69 attrib econds_4 length=3 label="Sequence of condition within part/line"; 70 attrib enicon_4 length=$4 label="Condition code"; 71 attrib econdp_5 length=3 label="Part/line number on certificate"; 72 attrib econds_5 length=3 label="Sequence of condition within part/line"; 73 attrib enicon_5 length=$4 label="Condition code"; 74 attrib econdp_6 length=3 label="Part/line number on certificate"; 75 attrib econds_6 length=3 label="Sequence of condition within part/line"; 76 attrib enicon_6 length=$4 label="Condition code"; 77 attrib econdp_7 length=3 label="Part/line number on certificate"; 78 attrib econds_7 length=3 label="Sequence of condition within part/line"; 3 The SAS System 15:02 Wednesday, April 29, 2009 79 attrib enicon_7 length=$4 label="Condition code"; 80 attrib econdp_8 length=3 label="Part/line number on certificate"; 81 attrib econds_8 length=3 label="Sequence of condition within part/line"; 82 attrib enicon_8 length=$4 label="Condition code"; 83 attrib econdp_9 length=3 label="Part/line number on certificate"; 84 attrib econds_9 length=3 label="Sequence of condition within part/line"; 85 attrib enicon_9 length=$4 label="Condition code"; 86 attrib econdp_10 length=3 label="Part/line number on certificate"; 87 attrib econds_10 length=3 label="Sequence of condition within part/line"; 88 attrib enicon_10 length=$4 label="Condition code"; 89 attrib econdp_11 length=3 label="Part/line number on certificate"; 90 attrib econds_11 length=3 label="Sequence of condition within part/line"; 91 attrib enicon_11 length=$4 label="Condition code"; 92 attrib econdp_12 length=3 label="Part/line number on certificate"; 93 attrib econds_12 length=3 label="Sequence of condition within part/line"; 94 attrib enicon_12 length=$4 label="Condition code"; 95 attrib econdp_13 length=3 label="Part/line number on certificate"; 96 attrib econds_13 length=3 label="Sequence of condition within part/line"; 97 attrib enicon_13 length=$4 label="Condition code"; 98 attrib econdp_14 length=3 label="Part/line number on certificate"; 99 attrib econds_14 length=3 label="Sequence of condition within part/line"; 100 attrib enicon_14 length=$4 label="Condition code"; 101 attrib econdp_15 length=3 label="Part/line number on certificate"; 102 attrib econds_15 length=3 label="Sequence of condition within part/line"; 103 attrib enicon_15 length=$4 label="Condition code"; 104 attrib econdp_16 length=3 label="Part/line number on certificate"; 105 attrib econds_16 length=3 label="Sequence of condition within part/line"; 106 attrib enicon_16 length=$4 label="Condition code"; 107 attrib econdp_17 length=3 label="Part/line number on certificate"; 108 attrib econds_17 length=3 label="Sequence of condition within part/line"; 109 attrib enicon_17 length=$4 label="Condition code"; 110 attrib econdp_18 length=3 label="Part/line number on certificate"; 111 attrib econds_18 length=3 label="Sequence of condition within part/line"; 112 attrib enicon_18 length=$4 label="Condition code"; 113 attrib econdp_19 length=3 label="Part/line number on certificate"; 114 attrib econds_19 length=3 label="Sequence of condition within part/line"; 115 attrib enicon_19 length=$4 label="Condition code"; 116 attrib econdp_20 length=3 label="Part/line number on certificate"; 117 attrib econds_20 length=3 label="Sequence of condition within part/line"; 118 attrib enicon_20 length=$4 label="Condition code"; 119 attrib ranum length=3 label="Number of Record-Axis Conditions"; 120 attrib record_1 length=$4 label="Condition"; 121 attrib record_2 length=$4 label="Condition"; 122 attrib record_3 length=$4 label="Condition"; 123 attrib record_4 length=$4 label="Condition"; 124 attrib record_5 length=$4 label="Condition"; 125 attrib record_6 length=$4 label="Condition"; 126 attrib record_7 length=$4 label="Condition"; 127 attrib record_8 length=$4 label="Condition"; 128 attrib record_9 length=$4 label="Condition"; 129 attrib record_10 length=$4 label="Condition"; 130 attrib record_11 length=$4 label="Condition"; 131 attrib record_12 length=$4 label="Condition"; 132 attrib record_13 length=$4 label="Condition"; 133 attrib record_14 length=$4 label="Condition"; 134 attrib record_15 length=$4 label="Condition"; 135 attrib record_16 length=$4 label="Condition"; 136 attrib record_17 length=$4 label="Condition"; 4 The SAS System 15:02 Wednesday, April 29, 2009 137 attrib record_18 length=$4 label="Condition"; 138 attrib record_19 length=$4 label="Condition"; 139 attrib record_20 length=$4 label="Condition"; 140 attrib race length=3 label="Detail Race"; 141 attrib brace length=3 label="Bridged Race"; 142 attrib raceimp length=3 label="Race Imputation Flag"; 143 attrib racer3 length=3 label="Race Recode 3"; 144 attrib racer5 length=3 label="Race Recode 5"; 145 attrib hispanic length=3 label="Hispanic Origin"; 146 attrib hspanicr length=3 label="Hispanic Origin/Race Recode"; 147 148 149 INPUT 150 151 @20 restatus 1. 152 @61 educ1989 2. 153 @63 educ2003 1. 154 @64 educflag 1. 155 @65 monthdth 2. 156 @69 sex $1. 157 @70 age 4. 158 @74 ageflag 1. 159 @75 ager52 2. 160 @77 ager27 2. 161 @79 ager12 2. 162 @81 ager22 2. 163 @83 placdth 1. 164 @84 marstat $1. 165 @85 weekday 1. 166 @102 year 4. 167 @106 injwork $1. 168 @107 mandeath 1. 169 @108 methdisp $1. 170 @109 autopsy $1. 171 @144 activity 1. 172 @145 injury 1. 173 @146 ucod $4. 174 @150 ucr358 3. 175 @154 ucr113 3. 176 @157 ucr130 3. 177 @160 ucr39 2. 178 @163 eanum 2. 179 @165 econdp_1 1. 180 @166 econds_1 1. 181 @167 enicon_1 $4. 182 @172 econdp_2 1. 183 @173 econds_2 1. 184 @174 enicon_2 $4. 185 @179 econdp_3 1. 186 @180 econds_3 1. 187 @181 enicon_3 $4. 188 @186 econdp_4 1. 189 @187 econds_4 1. 190 @188 enicon_4 $4. 191 @193 econdp_5 1. 192 @194 econds_5 1. 193 @195 enicon_5 $4. 194 @200 econdp_6 1. 5 The SAS System 15:02 Wednesday, April 29, 2009 195 @201 econds_6 1. 196 @202 enicon_6 $4. 197 @207 econdp_7 1. 198 @208 econds_7 1. 199 @209 enicon_7 $4. 200 @214 econdp_8 1. 201 @215 econds_8 1. 202 @216 enicon_8 $4. 203 @221 econdp_9 1. 204 @222 econds_9 1. 205 @223 enicon_9 $4. 206 @228 econdp_10 1. 207 @229 econds_10 1. 208 @230 enicon_10 $4. 209 @235 econdp_11 1. 210 @236 econds_11 1. 211 @237 enicon_11 $4. 212 @242 econdp_12 1. 213 @243 econds_12 1. 214 @244 enicon_12 $4. 215 @249 econdp_13 1. 216 @250 econds_13 1. 217 @251 enicon_13 $4. 218 @256 econdp_14 1. 219 @257 econds_14 1. 220 @258 enicon_14 $4. 221 @263 econdp_15 1. 222 @264 econds_15 1. 223 @265 enicon_15 $4. 224 @270 econdp_16 1. 225 @271 econds_16 1. 226 @272 enicon_16 $4. 227 @277 econdp_17 1. 228 @278 econds_17 1. 229 @279 enicon_17 $4. 230 @284 econdp_18 1. 231 @285 econds_18 1. 232 @286 enicon_18 $4. 233 @291 econdp_19 1. 234 @292 econds_19 1. 235 @293 enicon_19 $4. 236 @298 econdp_20 1. 237 @299 econds_20 1. 238 @300 enicon_20 $4. 239 @341 ranum 2. 240 @344 record_1 $4. 241 @349 record_2 $4. 242 @354 record_3 $4. 243 @359 record_4 $4. 244 @364 record_5 $4. 245 @369 record_6 $4. 246 @374 record_7 $4. 247 @379 record_8 $4. 248 @384 record_9 $4. 249 @389 record_10 $4. 250 @394 record_11 $4. 251 @399 record_12 $4. 252 @404 record_13 $4. 6 The SAS System 15:02 Wednesday, April 29, 2009 253 @409 record_14 $4. 254 @414 record_15 $4. 255 @419 record_16 $4. 256 @424 record_17 $4. 257 @429 record_18 $4. 258 @434 record_19 $4. 259 @439 record_20 $4. 260 @445 race 2. 261 @447 brace 1. 262 @448 raceimp 1. 263 @449 racer3 1. 264 @450 racer5 1. 265 @484 hispanic 3. 266 @488 hspanicr 1. 267 ; 268 NOTE: The infile DATAFILE is: Pipe command="unzip -p /homes/data/mortality/2006/mort2006.zip " NOTE: 2430725 records were read from the infile DATAFILE. The minimum record length was 489. The maximum record length was 489. NOTE: The data set LIBRARY.MORT2006 has 2430725 observations and 116 variables. NOTE: DATA statement used (Total process time): real time 3:02.17 cpu time 1:18.95 269 proc print data=&dataset. (obs=6); 270 NOTE: There were 6 observations read from the data set LIBRARY.MORT2006. NOTE: The PROCEDURE PRINT printed page 1. NOTE: PROCEDURE PRINT used (Total process time): real time 0.36 seconds cpu time 0.06 seconds 271 proc contents data=&dataset.; 272 273 /* 274 Copyright 2009 shared by the National Bureau of Economic Research and Jean Roth 275 276 National Bureau of Economic Research. 277 1050 Massachusetts Avenue 278 Cambridge, MA 02138 279 jroth@nber.org 280 281 This program and all programs referenced in it are free software. You 282 can redistribute the program or modify it under the terms of the GNU 283 General Public License as published by the Free Software Foundation; 284 either version 2 of the License, or (at your option) any later version. 285 286 This program is distributed in the hope that it will be useful, 287 but WITHOUT ANY WARRANTY; without even the implied warranty of 288 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 289 GNU General Public License for more details. 7 The SAS System 15:02 Wednesday, April 29, 2009 290 291 You should have received a copy of the GNU General Public License 292 along with this program; if not, write to the Free Software 293 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 294 USA. 295 */ NOTE: The PROCEDURE CONTENTS printed pages 2-4. NOTE: PROCEDURE CONTENTS used (Total process time): real time 0.17 seconds cpu time 0.04 seconds NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 3:03.63 cpu time 1:19.20 _column(448 ) byte raceimp %1f "Race Imputation Flag" > _column(449 ) byte racer3 %1f "Race Recode 3" > _column(450 ) byte racer5 %1f "Race Recode 5" > _column(484 ) int hispanic %3f "Hispanic Origin" > _column(488 ) byte hspanicr %1f "Hispanic Origin/Race Recode" > } (2430725 observations read) . . . ** Removing the temp file when finished . ! rm -f "`dat_name'" . . note: by Jean Roth, jroth@nber.org Thu Apr 23 12:25:35 EDT 2009 . compress enicon_20 was str4 now str1 record_18 was str4 now str3 record_19 was str4 now str1 record_20 was str4 now str1 . saveold mort2006,replace (note: file mort2006.dta not found) file mort2006.dta saved . ** Run commands from directory with data . capture erase mort2006.dta.zip . ! zip mort2006.dta.zip mort2006.dta . capture erase mort2006.dta . exit end of do-file . exit,clear