. capture set mem 1000m . . /*------------------------------------------------ > This program reads the 1964 NCHS Multiple Cause of Death Data Data File > by Jean Roth Wed Oct 29 16:12:11 EDT 2008 > Please report errors to jroth@nber.org > NOTE: This program is distributed under the GNU GPL. > See end of this file and http://www.gnu.org/licenses/ for details. > Run with do mort1964 > ----------------------------------------------- */ . . /* 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:\ */ . . local dat_name "/tmp/mort1964.dat" . . /* The following line should contain the path to your output '.dta' file */ . . local dta_name "mort1964" . . /* The following line should contain the path to the data dictionary file */ . . local dct_name "mort1964.dct" . . /* The following line should contain the complete path and name of the compre > ssed data file. */ . . local compressed "/homes/data/mortality/1959-1967/mort1964.zip" . . ** Removing dat_name . capture rm `dat_name' . . ** Uncompressing the raw data file to /tmp . ** Note that /tmp must have enough space to write the uncompressed file . ! unzip -p `compressed' > "`dat_name'" . . /* The line below does NOT need to be changed */ . . infile using "`dct_name'", using("`dat_name'") clear infile dictionary { *This program reads the 1964 NCHS Multiple Cause of Death Data Data File *by Jean Roth Wed Oct 29 16:12:11 EDT 2008 *Please report errors to jroth@nber.org *See the .do file for directions and run with do mort1964 *NOTE: This program is distributed under the GNU GPL. *See end of this file and http://www.gnu.org/licenses/ for details. _column(1 ) int datayear %4f > _column(5 ) byte monthdth %2f > _column(7 ) byte daydth %2f > _column(9 ) byte rectype %1f > _column(10 ) byte restatus %1f > _column(11 ) byte cityflag %1f > _column(13 ) byte region %1f > _column(14 ) byte divstoc %2f > _column(16 ) byte exstatoc %2f > _column(18 ) byte stateoc %2f > _column(18 ) str5 countyoc %5s > _column(24 ) byte regnres %1f > _column(25 ) byte divstres %2f > _column(27 ) byte exstares %2f > _column(29 ) str2 staters %2s > _column(29 ) str5 countyrs %5s > _column(34 ) str3 cityrs %3s > _column(37 ) str1 popsize %1s > _column(38 ) str1 metro %1s > _column(39 ) str3 smsares %3s > _column(42 ) byte race %2f > _column(44 ) byte racer3 %1f > _column(45 ) byte racer2 %1f > _column(46 ) byte racer6 %1f > _column(47 ) byte sex %1f > _column(48 ) int age %3f > _column(51 ) byte ager12 %2f > _column(53 ) byte ager27 %2f > _column(55 ) byte ager22 %2f > _column(57 ) byte ager14 %2f > _column(68 ) byte citizen %1f > _column(70 ) byte sexdup %1f > _column(71 ) byte accident %1f > _column(72 ) str4 ucod %4s > _column(76 ) str1 ucod4 %1s > _column(77 ) int ccr258 %3f > _column(80 ) byte ucr258s %1f > _column(81 ) byte ccr60 %2f > _column(83 ) byte ccr55 %2f > _column(88 ) byte cdcflag %1f > _column(89 ) byte fdaflag %1f > _column(90 ) byte whoflag %1f > _column(91 ) int ucr258 %3f > _column(94 ) byte ucr60 %2f > _column(96 ) byte ucr33 %2f > _column(98 ) byte reparea %1f > _column(105 ) str2 shipno %2s > } (1798051 observations read) . . . ** Removing the temp file when finished . ! rm -f "`dat_name'" . . note: by Jean Roth, jroth@nber.org Wed Oct 29 16:12:11 EDT 2008 . compress shipno was str2 now str1 . save mort1964,replace (note: file mort1964.dta not found) file mort1964.dta saved . ** Run commands from directory with data . capture erase mort1964.dta.zip . ! zip mort1964.dta.zip mort1964.dta . capture erase mort1964.dta . exit end of do-file 1965