*options obs=100 ; options nocenter ; /*------------------------------------------------ by Jean Roth Thu Nov 8 16:53:58 EST 2007 This program reads the 1997 NCHS Natality Detail Data File Report errors to jroth@nber.org This program is distributed under the GNU GPL. See end of this file and http://www.gnu.org/licenses/ for details. ----------------------------------------------- */ * The following line should contain the directory where the SAS file is to be stored ; libname library "."; * 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:\ ; FILENAME datafile pipe "unzip -p /homes/data/natality/ftp.cdc.gov/pub/Health_Statistics/NCHS/Datasets/DVS/natality/Nat1997us.zip "; * The following line should contain the name of the SAS dataset ; %let dataset = library.natl1997; DATA &dataset ; INFILE datafile LRECL = 20000 ; attrib datayear length=4 label="Data year"; attrib rectype length=3 label="Record type"; attrib restatus length=3 label="Resident status"; attrib recwt length=3 label="Record Weight"; attrib pldel length=3 label="Place or Facility of Birth "; attrib pldel3 length=3 label="Place or Facility of Birth Recode"; attrib birattnd length=3 label="Attendant at birth"; attrib regnocc length=3 label="Region of Occurrence"; attrib divocc length=3 label="Division of occurrence"; attrib stsubocc length=3 label="State Subcode of occurrence"; attrib stnatexp length=3 label="Expanded State of Occurrence"; attrib statenat length=3 label="NCHS State of Occurence"; attrib cntynat length=4 label="NCHS County of Occurence"; attrib stoccfip length=3 label="State of Occurrence (FIPS)"; attrib cntocfip length=4 label="County of Occurrence (FIPS)"; attrib cntocpop length=3 label="Population Size of County of Occurrence"; attrib regnres length=3 label="Region of Residence"; attrib divres length=3 label="Division of residence"; attrib stsubres length=3 label="State Subcode of Residence"; attrib stresexp length=3 label="Expanded State of Residence"; attrib stateres length=3 label="NCHS State of Residence"; attrib cntyres length=$5 label="NCHS County of Residence"; attrib cityres length=$3 label="NCHS City of Residence"; attrib citrspop length=$1 label="Population size - place of residence"; attrib metrores length=$1 label="Met/Nonmet county of residence"; attrib stresfip length=3 label="State of Residence (FIPS)"; attrib cntyrfip length=$5 label="County of Residence (FIPS)"; attrib placefip length=4 label="Place (City) of Resdience (FIPS)"; attrib cmsa length=3 label="CMSA of Residence (FIPS)"; attrib smsarfip length=$4 label="FIPS SMSA of Residence"; attrib cntrspop length=$1 label="Population Size of County of Residence"; attrib magerflg length=3 label="Reported Age of Mother Used Flag"; attrib mageimp length=$1 label="Age of Mother Imputation Flag"; attrib dmage length=3 label="Age of Mother"; attrib mage36 length=3 label="Age of Mother recode 36"; attrib mage12 length=3 label="Age of Mother recode 12"; attrib mage8 length=3 label="Age of Mother recode 8"; attrib ormoth length=3 label="Hispanic Origin of Mother"; attrib orracem length=3 label="Hispanic Origin and Race of Mother Recode"; attrib mraceimp length=$1 label="Race of Mother Imputation Flag"; attrib mrace length=3 label="Race of Mother"; attrib mrace3 length=3 label="Race of Mother Recode"; attrib dmeduc length=3 label="Education of Mother"; attrib meduc6 length=3 label="Education of Mother Recode"; attrib dmarimp length=$1 label="Marital Status of Mother Imputation Flag"; attrib dmar length=3 label="Marital Status of Mother"; attrib mplbir length=3 label="Place of Birth of Mother"; attrib mplbirr length=3 label="Place of Birth of Mother Recode"; attrib dmagerpt length=3 label="Reported Age of Mother"; attrib adequacy length=3 label="Adequacy of Care Recode (Kessner Index)"; attrib nlbnl length=3 label="Number of Live Births"; attrib nlbnd length=3 label="Number of Live Births"; attrib noterm length=3 label="Number of Other Terminations"; attrib dlivord length=3 label="Detail Live Birth Order"; attrib livord9 length=3 label="Live Birth Order Recode"; attrib dtotord length=3 label="Detail Total Birth Order"; attrib totord9 length=3 label="Total Birth Order Recode"; attrib monpre length=3 label="Detail Month of Pregnancy Prenatal Care Began"; attrib mpre6 length=3 label="Month Prenatal Care Began Recode 6"; attrib mpre5 length=3 label="Month Prenatal Care Began Recode 5"; attrib nprevis length=3 label="Total Number of Prenatal Visits"; attrib nprev12 length=3 label="Number of Prenatal Visits Recode"; attrib lmpmon length=3 label="Month Last Normal Menses Began"; attrib lmpday length=3 label="Day Last Normal Menses Began"; attrib lmpyr length=4 label="Year Last Normal Menses Began"; attrib flgbwimp length=$1 label="Imputed Birthweight Flag"; attrib bwimp length=4 label="Imputed Birthweight"; attrib fagerflg length=3 label="Reported Age of Father Used Flag"; attrib dfage length=3 label="Age of Father"; attrib fage11 length=3 label="Age of Father Recode"; attrib orfath length=3 label="Hispanic Origin of Father"; attrib orracef length=3 label="Hispanic Origin and Race of Father Recode"; attrib frace length=3 label="Race of Father"; attrib frace4 length=3 label="Race of Father Recode"; attrib dfagerpt length=3 label="Reported Age of Father"; attrib fraceimp length=3 label="Race of Father Imputation Flag"; attrib cdobmimp length=3 label="Month of Birth of Child Imputation Flag"; attrib birmon length=3 label="Month of Birth"; attrib biryr length=4 label="Year of Birth"; attrib weekday length=3 label="Day of Week Child Born"; attrib gestestm length=3 label="Clinical Estimate of Gestation Flag"; attrib gestimp length=3 label="Gestation Imputation Flag"; attrib dgestat length=3 label="Gestation - Detail in Weeks"; attrib gestat10 length=3 label="Gestation Recode 10"; attrib gestat3 length=3 label="Gestation Recode 3"; attrib cseximp length=3 label="Sex Imputation Flag"; attrib csex length=3 label="Sex"; attrib dbirwt length=4 label="Birthweight"; attrib birwt12 length=3 label="Birthweight Recode 12"; attrib birwt4 length=3 label="Birthweight Recode 4"; attrib plurimp length=3 label="Plurality Imputation Flag"; attrib dplural length=3 label="Plurality"; attrib fmaps length=3 label="Five Minute Apgar Score"; attrib fmapsr length=3 label="Five Minute Apgar Score Recode"; attrib clingest length=3 label="Clinical Estimate of Gestation"; attrib vaginal length=3 label="Vaginal"; attrib vbac length=3 label="Vaginal Birth after previous C-section"; attrib primac length=3 label="Primary C-section"; attrib repeac length=3 label="Repeat C-section"; attrib forcep length=3 label="Forceps"; attrib vacuum length=3 label="Vacuum"; attrib delmeth5 length=3 label="Method of Delivery Recode"; attrib anemia length=3 label="Anemia "; attrib cardiac length=3 label="Cardiac disease"; attrib lung length=3 label="Acute or chronic lung disease"; attrib diabetes length=3 label="Diabetes"; attrib herpes length=3 label="Herpes"; attrib hydra length=3 label="Hydramnios/Oligohydramnios"; attrib hemo length=3 label="Hemoglobinopathy"; attrib chyper length=3 label="Hypertension - chronic"; attrib phyper length=3 label="Hypertension - pregnancy associated"; attrib eclamp length=3 label="Eclampsia"; attrib incervix length=3 label="Incompetent cervix"; attrib pre4000 length=3 label="Previous infant 4000+ grams"; attrib preterm length=3 label="Previous preterm or small-for-gestational-age infant"; attrib renal length=3 label="Renal disease"; attrib rh length=3 label="Rh sensitization"; attrib uterine length=3 label="Uterine bleeding"; attrib othermr length=3 label="Other Medical Risk Factors"; attrib tobacco length=3 label="Tobacco Use During Pregnancy"; attrib cigar length=3 label="Average Number of Cigarettes Per Day"; attrib cigar6 length=3 label="Average Number of Cigarettes Per Day Recode"; attrib alcohol length=3 label="Alcohol Use During Pregnancy"; attrib drink length=3 label="Average Number of Drinks Per Week"; attrib drink5 length=3 label="Average Number of Drinks Per Week Recode"; attrib wtgain length=3 label="Weight Gain"; attrib wtgain9 length=3 label="Weight Gain Recode"; attrib amnio length=3 label="Amniocentesis"; attrib monitor length=3 label="Electronic fetal monitoring"; attrib induct length=3 label="Induction of labor"; attrib stimula length=3 label="Stimulation of labor"; attrib tocol length=3 label="Tocolysis"; attrib ultras length=3 label="Ultrasound"; attrib otherob length=3 label="Other Obstetric Procedures"; attrib febrile length=3 label="Febrile"; attrib meconium length=3 label="Meconium - moderate/heavy"; attrib rupture length=3 label="Premature rupture of membrane"; attrib abruptio length=3 label="Abruptio placenta"; attrib preplace length=3 label="Placenta previa"; attrib excebld length=3 label="Other excessive bleeding"; attrib seizure length=3 label="Seizures during labor"; attrib precip length=3 label="Precipitous labor"; attrib prolong length=3 label="Prolonged labor"; attrib dysfunc length=3 label="Dysfunctional labor"; attrib breech length=3 label="Breech/Malpresentation"; attrib cephalo length=3 label="Cephalopelvic disproportion"; attrib cord length=3 label="Cord prolapse"; attrib anesthe length=3 label="Anesthetic complications"; attrib distress length=3 label="Fetal distress"; attrib otherlb length=3 label="Other complication of Labor and/or Delivery"; attrib nanemia length=3 label="Anemia"; attrib injury length=3 label="Injury"; attrib alcosyn length=3 label="Fetal Alcohol Syndrome"; attrib hyaline length=3 label="Hyaline membrane disease"; attrib meconsyn length=3 label="Meconium aspiration syndrome"; attrib venl30 length=3 label="Assisted ventilation - less than 30 minutes"; attrib ven30m length=3 label="Assisted ventilation - 30 minutes or more"; attrib nseiz length=3 label="Seizures"; attrib otherab length=3 label="Other Abnormal Conditions of the Newborn"; attrib anen length=3 label="Anencephalus"; attrib spina length=3 label="Spina bifida/Meningocele"; attrib hydro length=3 label="Hydrocephalus"; attrib microce length=3 label="Microcephalus"; attrib nervous length=3 label="Other central nervous system anomalies"; attrib heart length=3 label="Heart malformations"; attrib circul length=3 label="Other circulatory/respiratory anomalies"; attrib rectal length=3 label="Rectal atresia/stenosis"; attrib tracheo length=3 label="Tracheo - esophageal fistula/Esophageal atresia"; attrib omphalo length=3 label="Omphalocele/Gastroschisis"; attrib gastro length=3 label="Other gastrointestinal anomalies"; attrib genital length=3 label="Malformed genitalia"; attrib renalage length=3 label="Renal agenesis"; attrib urogen length=3 label="Other urogenital anomalies"; attrib cleftlp length=3 label="Cleft lip/palate"; attrib adactyly length=3 label="Polydactyly/Syndactyly/Adactyly"; attrib clubfoot length=3 label="Club foot"; attrib hernia length=3 label="Diaphragmatic hernia"; attrib musculo length=3 label="Other musculoskeletal/integumental anomalies"; attrib downs length=3 label="Down's syndrome"; attrib chromo length=3 label="Other chromosomal anomalies"; attrib othercon length=3 label="Other congenital anomalies"; attrib origm length=3 label="Origin of mother"; attrib origf length=3 label="Origin of father"; attrib educm length=3 label="Education of mother"; attrib educf length=3 label="Education of father"; attrib geste length=3 label="Clinical estimate of gestation"; attrib fmapsrf length=3 label="5-minute Apgar score"; attrib delmetrf length=3 label="Method of delivery"; attrib medrsk length=3 label="Medical risk factors"; attrib tobuse length=3 label="Tobacco use"; attrib alcuse length=3 label="Alcohol use"; attrib wtgn length=3 label="Weight gain"; attrib obstrc length=3 label="Obstetric procedures"; attrib clabor length=3 label="Complications of labor and/or delivery "; attrib abnml length=3 label="Abnormal conditions of newborn"; attrib congan length=3 label="Congenital anomalies"; attrib educsmsa length=3 label="Education of Mother (Based on MSA)"; attrib apiflag length=3 label="Race codes 18-68 reported (beginning with 1992 data)"; attrib smsares length=$3 label="PSMA/MSA of Residence (NCHS)"; attrib popsmas length=$1 label="PMSA/MSA Population Size"; INPUT @1 datayear 4. @5 rectype 1. @6 restatus 1. @7 recwt 1. @8 pldel 1. @9 pldel3 1. @10 birattnd 1. @11 regnocc 1. @12 divocc 1. @12 stsubocc 2. @14 stnatexp 2. @16 statenat 2. @16 cntynat 5. @21 stoccfip 2. @21 cntocfip 5. @26 cntocpop 1. @27 regnres 1. @28 divres 1. @28 stsubres 2. @30 stresexp 2. @32 stateres 2. @32 cntyres $5. @37 cityres $3. @40 citrspop $1. @41 metrores $1. @42 stresfip 2. @42 cntyrfip $5. @47 placefip 5. @52 cmsa 2. @54 smsarfip $4. @58 cntrspop $1. @68 magerflg 1. @69 mageimp $1. @70 dmage 2. @72 mage36 2. @74 mage12 2. @76 mage8 1. @77 ormoth 1. @78 orracem 1. @79 mraceimp $1. @80 mrace 2. @82 mrace3 1. @83 dmeduc 2. @85 meduc6 1. @86 dmarimp $1. @87 dmar 1. @88 mplbir 2. @90 mplbirr 1. @91 dmagerpt 2. @93 adequacy 1. @94 nlbnl 2. @96 nlbnd 2. @98 noterm 2. @100 dlivord 2. @102 livord9 1. @103 dtotord 2. @105 totord9 1. @106 monpre 2. @108 mpre6 1. @109 mpre5 1. @110 nprevis 2. @112 nprev12 2. @114 lmpmon 2. @116 lmpday 2. @118 lmpyr 4. @133 flgbwimp $1. @134 bwimp 4. @153 fagerflg 1. @154 dfage 2. @156 fage11 2. @158 orfath 1. @159 orracef 1. @160 frace 2. @162 frace4 1. @166 dfagerpt 2. @168 fraceimp 1. @170 cdobmimp 1. @172 birmon 2. @176 biryr 4. @180 weekday 1. @181 gestestm 1. @182 gestimp 1. @183 dgestat 2. @185 gestat10 2. @187 gestat3 1. @188 cseximp 1. @189 csex 1. @193 dbirwt 4. @197 birwt12 2. @199 birwt4 1. @200 plurimp 1. @201 dplural 1. @205 fmaps 2. @207 fmapsr 1. @208 clingest 2. @217 vaginal 1. @218 vbac 1. @219 primac 1. @220 repeac 1. @221 forcep 1. @222 vacuum 1. @224 delmeth5 1. @225 anemia 1. @226 cardiac 1. @227 lung 1. @228 diabetes 1. @229 herpes 1. @230 hydra 1. @231 hemo 1. @232 chyper 1. @233 phyper 1. @234 eclamp 1. @235 incervix 1. @236 pre4000 1. @237 preterm 1. @238 renal 1. @239 rh 1. @240 uterine 1. @241 othermr 1. @242 tobacco 1. @243 cigar 2. @245 cigar6 1. @246 alcohol 1. @247 drink 2. @249 drink5 1. @250 wtgain 2. @252 wtgain9 1. @253 amnio 1. @254 monitor 1. @255 induct 1. @256 stimula 1. @257 tocol 1. @258 ultras 1. @259 otherob 1. @260 febrile 1. @261 meconium 1. @262 rupture 1. @263 abruptio 1. @264 preplace 1. @265 excebld 1. @266 seizure 1. @267 precip 1. @268 prolong 1. @269 dysfunc 1. @270 breech 1. @271 cephalo 1. @272 cord 1. @273 anesthe 1. @274 distress 1. @275 otherlb 1. @276 nanemia 1. @277 injury 1. @278 alcosyn 1. @279 hyaline 1. @280 meconsyn 1. @281 venl30 1. @282 ven30m 1. @283 nseiz 1. @284 otherab 1. @285 anen 1. @286 spina 1. @287 hydro 1. @288 microce 1. @289 nervous 1. @290 heart 1. @291 circul 1. @292 rectal 1. @293 tracheo 1. @294 omphalo 1. @295 gastro 1. @296 genital 1. @297 renalage 1. @298 urogen 1. @299 cleftlp 1. @300 adactyly 1. @301 clubfoot 1. @302 hernia 1. @303 musculo 1. @304 downs 1. @305 chromo 1. @306 othercon 1. @307 origm 1. @308 origf 1. @309 educm 1. @310 educf 1. @311 geste 1. @313 fmapsrf 1. @314 delmetrf 1. @315 medrsk 1. @316 tobuse 1. @317 alcuse 1. @318 wtgn 1. @319 obstrc 1. @320 clabor 1. @321 abnml 1. @322 congan 1. @324 educsmsa 1. @325 apiflag 1. @347 smsares $3. @350 popsmas $1. ; proc print data=&dataset. (obs=6); proc contents data=&dataset.; /* Copyright 2007 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. */