. capture set mem 10g . . /*------------------------------------------------ > This program reads the 2004 NCHS Natality Detail Data File > by Jean Roth Tue Apr 1 14:35:40 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 natl2004 > ----------------------------------------------- */ . . /* 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/natl2004.dat" . . /* The following line should contain the path to your output '.dta' file */ . . local dta_name "./natl2004" . . /* The following line should contain the path to the data dictionary file */ . . local dct_name "./natl2004.dct" . . /* The following line should contain the complete path and name of the compressed data file. */ . . local compressed "/homes/data/natality/2004/data/natl2004.dat.Z" . . ** 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 . ! zcat `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 2004 NCHS Natality Detail Data File *by Jean Roth Tue Apr 1 14:35:40 EDT 2008 *Please report errors to jroth@nber.org *See the .do file for directions and run with do natl2004 *NOTE: This program is distributed under the GNU GPL. *See end of this file and http://www.gnu.org/licenses/ for details. _column(7 ) str1 revision %1s "Revision U;R" _column(8 ) byte recwt %1f "Record Weight U;R" _column(15 ) int dob_yy %4f "Birth Year U;R" _column(19 ) byte dob_mm %2f "Birth Month U;R" _column(29 ) byte dob_wk %1f "Weekday U;R" _column(30 ) str2 ostate %2s "Occurrence State U;R" _column(32 ) str2 xostate %2s "Expanded Occurrence State U;R" _column(37 ) int ocntyfips %3f "Occurrence FIPS County U;R" _column(40 ) byte ocntypop %1f "Occurence County Population U;R" _column(42 ) byte ubfacil %1f "Birth Place U;R" _column(59 ) byte bfacil3 %1f "Birth Place Recode U;R" _column(87 ) byte mage_impflg %1f "Mother's Age Imputated Flag U;R" _column(88 ) byte mage_repflg %1f "Reported Age of Mother Flag U;R" _column(89 ) byte mager %2f "Mother's Single Year of Age U;R" _column(91 ) byte mager14 %2f "Mother's Age Recode 14 U;R" _column(93 ) byte mager9 %1f "Mother's Age Recode 9 U;R" _column(96 ) str2 umbstate %2s "Mother's Birth State U;R" _column(100 ) byte mbstate_rec %1f "Mother's Birth State Recode U;R" _column(107 ) str2 xmrstate %2s "Expanded State of Residence of Mother U;R" _column(109 ) str2 mrstate %2s "Mother's Residence State U;R" _column(114 ) int mrcntyfips %3f "Mother's County of Residence (FIPS) U;R" _column(120 ) long mrcityfips %5f "Mother's Place of Residence (FIPS) U;R" _column(125 ) byte cmsa %2f "Consolidated Metropolitan Statistical Area U;R " _column(127 ) int msa %4f "Metropolitan Statistical Area U;R " _column(131 ) str1 msa_pop %1s "Population of Statistical Area U;R " _column(132 ) str1 rcnty_pop %1s "Population of Residence County U;R " _column(133 ) str1 rcity_pop %1s "Population of Residence City U;R " _column(135 ) str1 metrores %1s "Metropolitan Residence County U;R" _column(137 ) byte rectype %1f "Record Type U;R" _column(138 ) byte restatus %1f "Resident Status U;R" _column(139 ) byte mbrace %2f "Mother's Bridged Race R " _column(141 ) byte mrace %2f "Mother's Race U " _column(143 ) byte mracerec %1f "Mother's Race Recode U;R" _column(144 ) str1 mraceimp %1s "Mother's Race Imputed Flag U;R " _column(148 ) byte umhisp %1f "Mother's Hispanic Origin U;R " _column(149 ) byte mracehisp %1f "Mother's Race/Hispanic Origin U;R " _column(153 ) byte mar %1f "Mother's Marital Status U;R" _column(154 ) byte mar_imp %1f "Mother's Marital Status Imputed Flag U;R" _column(155 ) byte meduc %1f "Mother's Education R " _column(156 ) byte dmeduc %2f "Mother's Education U " _column(158 ) byte meduc_rec %1f "Mother's Education Recode U " _column(175 ) byte fagerpt_flg %1f "Father's Reported Age Used U;R" _column(176 ) byte fagerpt %2f "Father's Reported Age U;R" _column(182 ) byte fagecomb %2f "Father's Combined Age (Revised) R" _column(184 ) byte ufagecomb %2f "Father's Combined Age U" _column(186 ) byte fagerec11 %2f "Father's Age Recode 11 U;R" _column(188 ) byte fbrace %2f "Father's Bridged Race R " _column(190 ) byte fraceimp %1f "Father's Race Imputed U" _column(191 ) byte fracerec %1f "Father's Race Recode U;R" _column(195 ) byte ufhisp %1f "Father's Hispanic Origin U;R " _column(196 ) byte fracehisp %1f "Father's Race/Hispanic Origin U;R " _column(199 ) byte frace %2f "Father's Race U " _column(204 ) byte priorlive %2f "Prior Births Now Living U;R" _column(206 ) byte priordead %2f "Prior Births Now Dead U;R" _column(208 ) byte priorterm %2f "Prior Other Terminations U;R" _column(210 ) byte lbo %2f "Live Birth Order U;R" _column(212 ) byte lbo_rec %1f "Live Birth Order Recode U;R" _column(215 ) byte tbo %2f "Total Birth Order U;R" _column(217 ) byte tbo_rec %1f "Total Birth Order Recode U;R" _column(220 ) byte dllb_mm %2f "Date of Last Live Birth - Month U;R" _column(222 ) int dllb_yy %4f "Date of Last Live Birth - Year U;R" _column(245 ) byte precare %2f "Month Prenatal Care Began R" _column(247 ) byte precare_rec %1f "Month Prenatal Care Began Recode R" _column(256 ) byte mpcb %2f "Month Prenatal Care Began U" _column(258 ) byte mpcb_rec6 %1f "Month Prenatal Care Began Recode 6 U" _column(259 ) byte mpcb_rec5 %1f "Month Prenatal Care Began Recode 5 U" _column(270 ) byte uprevis %2f "Number of Prenatal Visits U;R" _column(272 ) byte previs_rec %2f "Number of Prenatal Visits Recode U;R" _column(275 ) byte apncu %1f "Adequacy of Prenatal Care Utilization Index R" _column(276 ) byte wtgain %2f "Weight Gain U;R" _column(278 ) byte wtgain_rec %1f "Weight Gain Recode U;R" _column(279 ) byte u_apncu %1f "Adequacy of Prenatal Care Utilization Index U" _column(280 ) byte dfpc_imp %1f "Day of Date First Prenatal Care Imputed R " _column(284 ) byte cig_1 %2f "Cigarettes 1st Trimester R " _column(286 ) byte cig_2 %2f "Cigarettes 2nd Trimester R " _column(288 ) byte cig_3 %2f "Cigarettes 3rd Trimester R " _column(290 ) byte tobuse %1f "Tobacco Use U" _column(291 ) byte cigs %2f "Cigarettes Per Day U" _column(293 ) byte cig_rec6 %1f "Cigarettes Recode U" _column(294 ) str1 cig_rec %1s "Cigarettes Recode R" _column(295 ) byte alcohol %1f "Alcohol Use U " _column(296 ) byte drinks %2f "Drinks Per Week U" _column(298 ) byte drinks_rec %1f "Drinks Recode U " _column(328 ) byte urf_anemia %1f "Anemia U " _column(329 ) byte urf_card %1f "Cardiac U" _column(330 ) byte urf_lung %1f "Acute or Chronic Lung Disease U" _column(331 ) byte urf_diab %1f "Diabetes U;R" _column(332 ) byte urf_gen %1f "Genital Herpes U" _column(333 ) byte urf_hydra %1f "Hydramnios/Oligohydramnios U" _column(334 ) byte urf_hemo %1f "Hemoglobinopathy U" _column(335 ) byte urf_chyper %1f "Chronic Hypertension U;R" _column(336 ) byte urf_phyper %1f "Pregnancy Associated Hypertension U;R" _column(337 ) byte urf_eclam %1f "Eclampsia U;R" _column(338 ) byte urf_incerv %1f "Incompetent cervix U" _column(339 ) byte urf_pre4000 %1f "Previous infant 4000+ Grams U" _column(340 ) byte urf_preterm %1f "Previous Preterm or Small for Gestation U" _column(341 ) byte urf_renal %1f "Renal disease U" _column(342 ) byte urf_rh %1f "Rh sensitization U" _column(343 ) byte urf_uterine %1f "Uterine bleeding U" _column(344 ) byte urf_other %1f "Other Medical Risk Factors U" _column(355 ) byte uop_amnio %1f "Amniocentesis U" _column(356 ) byte uop_monit %1f "Electronic Fetal Monitoring U" _column(357 ) byte uop_induc %1f "Induction of labor U;R" _column(358 ) byte uop_stiml %1f "Stimulation of labor U" _column(359 ) byte uop_tocol %1f "Tocolysis U;R" _column(360 ) byte uop_ultra %1f "Ultrasound U" _column(361 ) byte uop_other %1f "Other Obstetric Procedures U" _column(374 ) byte uld_febr %1f "Febrile U" _column(375 ) byte uld_meco %1f "Meconium U;R" _column(376 ) byte uld_ruptr %1f "Premature Rupture of Membrane U" _column(377 ) byte uld_abrup %1f "Abruptio placenta U" _column(378 ) byte uld_prepla %1f "Placenta previa U" _column(379 ) byte uld_excbl %1f "Other Excessive Bleeding U" _column(380 ) byte uld_seiz %1f "Seizures During Labor U " _column(381 ) byte uld_precip %1f "Precipitous labor U;R" _column(382 ) byte uld_prolg %1f "Prolonged Labor U" _column(383 ) byte uld_dysfn %1f "Dysfunctional Labor U" _column(384 ) byte uld_breech %1f "Breech U;R" _column(385 ) byte uld_cephal %1f "Cephalopelvic Disproportion U" _column(386 ) byte uld_cord %1f "Cord Prolapse U" _column(387 ) byte uld_anest %1f "Anesthetic Complications U" _column(388 ) byte uld_distr %1f "Fetal Distress U" _column(389 ) byte uld_other %1f "Other Complications U" _column(395 ) byte ume_vag %1f "Vaginal U;R" _column(396 ) byte ume_vbac %1f "Vaginal after C-Section U;R" _column(397 ) byte ume_primc %1f "Primary C-Section U;R" _column(398 ) byte ume_repec %1f "Repeat C-Section U;R" _column(399 ) byte ume_forcp %1f "Forceps U;R " _column(400 ) byte ume_vac %1f "Vacuum U;R" _column(401 ) byte dmeth_rec %1f "Delivery Method Recode U;R" _column(408 ) byte attend %1f "Attendant U;R" _column(415 ) byte apgar5 %2f "Five Minute Apgar Score U;R" _column(417 ) byte apgar5r %1f "Five Minute Apgar Recode U;R" _column(423 ) byte dplural %1f "Plurality U;R" _column(425 ) byte imp_plur %1f "Plurality Imputed U;R" _column(436 ) str1 sex %1s "Sex U;R" _column(437 ) byte imp_sex %1f "Imputed Sex " _column(438 ) byte dlmp_mm %2f "Last Normal Menses - Month U;R" _column(440 ) byte dlmp_dd %2f "Last Normal Menses - Day U;R" _column(442 ) int dlmp_yy %4f "Last Normal Menses - Year U;R" _column(446 ) byte estgest %2f "Obstetric/Clinical Gestation Est. U;R " _column(451 ) byte combgest %2f "Gestation - Detail in Weeks U;R" _column(453 ) byte gestrec10 %2f "Gestation Recode 10 U;R" _column(455 ) byte gestrec3 %1f "Gestation Recode 3 U;R" _column(456 ) byte obgest_flg %1f "Clinical Estimate of Gestation Used Flag U;R " _column(457 ) byte gest_imp %1f "Gestation Imputed Flag U;R" _column(463 ) int dbwt %4f "Birth Weight - Detail in Grams U;R" _column(471 ) byte bwtr12 %2f "Birth Weight Recode 12 U;R" _column(473 ) byte bwtr4 %1f "Birth Weight Recode 4 U;R" _column(483 ) byte uab_anem %1f "Anemia U" _column(484 ) byte uab_injury %1f "Birth Injury U" _column(485 ) byte uab_alcoh %1f "Fetal Alcohol Syndrome U" _column(486 ) byte uab_hyal %1f "Hyaline Membrane Disease U" _column(487 ) byte uab_mecon %1f "Meconium Aspiration Syndrome U" _column(488 ) byte uab_venl30 %1f "Assisted Ventilation < 30 min U" _column(489 ) byte uab_ven30m %1f "Assisted Ventilation >= 30 min U" _column(490 ) byte uab_nseiz %1f "Seizures U" _column(491 ) byte uab_other %1f "Other Abnormal Conditions U" _column(504 ) byte uca_anen %1f "Anencephalus U;R" _column(505 ) byte uca_spina %1f "Spina bifida/Meningocele U;R" _column(506 ) byte uca_hydro %1f "Hydrocephalus U" _column(507 ) byte uca_micro %1f "Microcephalus U" _column(508 ) byte uca_nerv %1f "Other Central Nervous System Anomalies U" _column(509 ) byte uca_heart %1f "Heart malformations U" _column(510 ) byte uca_circ %1f "Other Circulatory/Respiratory Anomalies U" _column(511 ) byte uca_rectal %1f "Rectal Atresia/Stenosis U" _column(512 ) byte uca_trach %1f "Tracheo-Esophageal Fistula U" _column(513 ) byte uca_ompha %1f "Omphalocele/Gastroschisis U;R" _column(514 ) byte uca_gastro %1f "Other Gastrointestinal Anomalies U" _column(515 ) byte uca_genital %1f "Malformed Genitalia U " _column(516 ) byte uca_renal %1f "Renal Agenesis U" _column(517 ) byte uca_urogen %1f "Other Urogenital Anomalies U" _column(518 ) byte uca_cleftlp %1f "Cleft Lip/Palate U;R" _column(519 ) byte uca_adactyly %1f "Polydactyly/Syndactyly/Adactyly U" _column(520 ) byte uca_clubft %1f "Club Foot U" _column(521 ) byte uca_hernia %1f "Diaphragmatic Hernia U" _column(522 ) byte uca_muscu %1f "Other Musculoskeletal Anomalies U" _column(523 ) byte uca_downs %1f "Down Syndrome U;R" _column(524 ) byte uca_chromo %1f "Other Chromosomal Anomalies U" _column(525 ) byte uca_other %1f "Other Congenital Anomalies U" _column(569 ) byte f_morigin %1f "Origin of Mother U;R" _column(570 ) byte f_forigin %1f "Origin of Father U;R" _column(571 ) byte f_meduc %1f "Education of Mother R" _column(573 ) byte f_clinest %1f "Clinical Estimate of Gestation U;R" _column(574 ) byte f_apgar5 %1f "5 - minute Apgar U;R" _column(575 ) byte f_tobaco %1f "Tobacco use R" _column(647 ) byte f_med %1f "Mother's Education U" _column(648 ) byte f_wtgain %1f "Weight gain U;R" _column(649 ) byte f_alcol %1f "Alcohol use U" _column(650 ) byte f_api %1f "API codes U" _column(667 ) byte f_tobac %1f "Tobacco use U" _column(668 ) byte f_mpcb %1f "Month Prenatal Care Began R" _column(669 ) byte f_mpcb_u %1f "Month Prenatal Care Began U" _column(681 ) byte f_urf_anemia %1f "Anemia U" _column(682 ) byte f_urf_cardiac %1f "Cardiac U" _column(683 ) byte f_urf_lung %1f "Acute or Chronic Lung Disease U" _column(684 ) byte f_urf_diabetes %1f "Diabetes U" _column(685 ) byte f_urf_herpes %1f "Genital Herpes U" _column(686 ) byte f_urf_hydra %1f "Hydramnios/Oligohydramnios U" _column(687 ) byte f_urf_hemo %1f "Hemoglobinopathy U" _column(688 ) byte f_urf_chyper %1f "Chronic Hypertension U" _column(689 ) byte f_urf_phyper %1f "Pregnancy Associated Hypertension U" _column(690 ) byte f_urf_eclamp %1f "Eclampsia U" _column(691 ) byte f_urf_incervix %1f "Incompetent Cervix U" _column(692 ) byte f_urf_pre4000 %1f "Previous Infant 4000+ Grams U" _column(693 ) byte f_urf_preterm %1f "Previous Preterm Small for Gestation U" _column(694 ) byte f_urf_renal %1f "Renal Disease U" _column(695 ) byte f_urf_rh %1f "Rh Sensitization U" _column(696 ) byte f_urf_uterine %1f "Uterine Bleeding U" _column(697 ) byte f_urf_othermr %1f "Other Medical Risk Factors U" _column(701 ) byte f_uob_amnio %1f "Amniocentesis U" _column(702 ) byte f_uob_monitor %1f "Electronic Fetal Monitoring U" _column(703 ) byte f_uob_induct %1f "Induction of labor U" _column(704 ) byte f_uob_stimul %1f "Stimulation of labor U" _column(705 ) byte f_uob_tocol %1f "Tocolysis U" _column(706 ) byte f_uob_ultras %1f "Ultrasound U" _column(707 ) byte f_uob_otherob %1f "Other Obstetric Procedures U" _column(711 ) byte f_uld_febrile %1f "Febrile U" _column(712 ) byte f_uld_meconium %1f "Meconium U" _column(713 ) byte f_uld_rupture %1f "Premature Rupture of Membrane U" _column(714 ) byte f_uld_abruptio %1f "Abruptio placenta U" _column(715 ) byte f_uld_preplace %1f "Placenta previa U" _column(716 ) byte f_uld_excebld %1f "Other Excessive Bleeding U" _column(717 ) byte f_uld_seizure %1f "Seizures During Labor U " _column(718 ) byte f_uld_precip %1f "Precipitous labor U" _column(719 ) byte f_uld_prolg %1f "Prolonged Labor U" _column(720 ) byte f_uld_dysfunc %1f "Dysfunctional Labor U" _column(721 ) byte f_uld_breech %1f "Breech U" _column(722 ) byte f_uld_cephalo %1f "Cephalopelvic Disproportion U" _column(723 ) byte f_uld_cord %1f "Cord Prolapse U" _column(724 ) byte f_uld_anest %1f "Anesthetic Complications U" _column(725 ) byte f_uld_distr %1f "Fetal Distress U" _column(726 ) byte f_uld_other %1f "Other Complications U" _column(730 ) byte f_u_vag %1f "Vaginal U" _column(731 ) byte f_u_vbac %1f "Vaginal after C-Section U" _column(732 ) byte f_u_primc %1f "Primary C-Section U" _column(733 ) byte f_u_repec %1f "Repeat C-Section U" _column(734 ) byte f_u_forcp %1f "Forceps U" _column(735 ) byte f_u_vac %1f "Vacuum U" _column(740 ) byte f_uab_anemia %1f "Anemia U" _column(741 ) byte f_uab_injury %1f "Birth Injury U" _column(742 ) byte f_uab_alcosyn %1f "Fetal Alcohol Syndrome U" _column(743 ) byte f_uab_hyaline %1f "Hyaline Membrane Disease U" _column(744 ) byte f_uab_meconsyn %1f "Meconium Aspiration Syndrome U" _column(745 ) byte f_uab_venl30 %1f "Assisted Ventilation <30 min U" _column(746 ) byte f_uab_ven30m %1f "Assisted Ventilation >=30 min U" _column(747 ) byte f_uab_seiz %1f "Seizures U" _column(748 ) byte f_uab_otherab %1f "Other Abnormal Conditions U" _column(752 ) byte f_uca_anen %1f "Anencephalus U" _column(753 ) byte f_uca_spina %1f "Spina bifida/Meningocele U" _column(754 ) byte f_uca_hydro %1f "Hydrocephalus U" _column(755 ) byte f_uca_microce %1f "Microcephalus U" _column(756 ) byte f_uca_nervous %1f "Other Central Nervous System Anomalies U" _column(757 ) byte f_uca_heart %1f "Heart malformations U" _column(758 ) byte f_uca_circul %1f "Other Circulatory/Respiratory Anomalies U" _column(759 ) byte f_uca_rectal %1f "Rectal Atresia/Stenosis U" _column(760 ) byte f_uca_tracheo %1f "Tracheo-Esophageal Fistula U" _column(761 ) byte f_uca_omphalo %1f "Omphalocele/Gastroschisis U" _column(762 ) byte f_uca_gastro %1f "Other Gastrointestinal Anomalies U" _column(763 ) byte f_uca_genital %1f "Malformed Genitalia U " _column(764 ) byte f_uca_renalag %1f "Renal Agenesis U" _column(765 ) byte f_uca_urogen %1f "Other Urogenital Anomalies U" _column(766 ) byte f_uca_cleftlp %1f "Cleft Lip/Palate U" _column(767 ) byte f_uca_adactyl %1f "Polydactyly/Syndactyly/Adactyly U" _column(768 ) byte f_uca_club %1f "Club Foot U" _column(769 ) byte f_uca_hernia %1f "Diaphragmatic Hernia U" _column(770 ) byte f_uca_musculo %1f "Other Musculoskeletal Anomalies U" _column(771 ) byte f_uca_downs %1f "Down Syndrome U" _column(772 ) byte f_uca_chromo %1f "Other Chromosomal Anomalies U" _column(773 ) byte f_uca_othrcon %1f "Other Congenital Anomalies U" _column(1088) str3 mrace1e %3s "Mother's Race Edited R" _column(1091) str3 mrace2e %3s "Mother's Race Edited R" _column(1094) str3 mrace3e %3s "Mother's Race Edited R" _column(1097) str3 mrace4e %3s "Mother's Race Edited R" _column(1100) str3 mrace5e %3s "Mother's Race Edited R" _column(1103) str3 mrace6e %3s "Mother's Race Edited R" _column(1106) str3 mrace7e %3s "Mother's Race Edited R" _column(1109) str3 mrace8e %3s "Mother's Race Edited R" _column(1422) str3 frace1e %3s "Father's Race Edited R" _column(1425) str3 frace2e %3s "Father's Race Edited R" _column(1428) str3 frace3e %3s "Father's Race Edited R" _column(1431) str3 frace4e %3s "Father's Race Edited R" _column(1434) str3 frace5e %3s "Father's Race Edited R" _column(1437) str3 frace6e %3s "Father's Race Edited R" _column(1440) str3 frace7e %3s "Father's Race Edited R" _column(1443) str3 frace8e %3s "Father's Race Edited R" } (4119091 observations read) . . . ** Removing the temp file when finished . ! rm -f "`dat_name'" . . note: by Jean Roth, jroth@nber.org Tue Apr 1 14:35:40 EDT 2008 . saveold /homes/data/natality/2004/data/natl2004,replace (note: file /homes/data/natality/2004/data/natl2004.dta not found) file /homes/data/natality/2004/data/natl2004.dta saved . ** Run commands from directory with data . capture erase /homes/data/natality/2004/data/natl2004.dta.zip . ** This file exceeds Zip version 2.31's 4GB uncompressed size. . ** So, using an open source utility that will work . . *! 7z a natl2004.dta.zip natl2004.dta . ! zip natl2004.dta.zip natl2004.dta . capture erase /homes/data/natality/2004/data/natl2004.dta . . /* > Copyright 2008 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. > */ . end of do-file . exit no; data in memory would be lost r(4); . exit,clear