*options obs=100 ; options nocenter ; /*------------------------------------------------ by Jean Roth Mon Jul 2 15:43:41 EDT 2007 This program reads the 2000 National Health Interview Survey 2000 househld 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/nhis/ftp.cdc.gov/pub/Health_Statistics/NCHS/Datasets/NHIS/2000/househld.exe "; * The following line should contain the name of the SAS dataset ; %let dataset = nhis2000_househld ; DATA library.&dataset ; INFILE datafile LRECL = 20000 ; attrib rectype length=3 label="Record Type"; attrib srvy_yr length=4 label="Processing Year"; attrib hhx length=$6 label="Household Serial Number"; attrib intv_qrt length=3 label="Interviewing Quarter"; attrib assignwk length=3 label="Assignment Week"; attrib int_m_p length=$2 label="Date of Interview - Month"; attrib int_y_p length=$4 label="Date of Interview - Year"; attrib livqrt length=3 label="Type of Living Quarters"; attrib non_intv length=3 label="Category of type A non-response"; attrib telenum length=3 label="Telephone number"; attrib inside length=3 label="Working phone inside home"; attrib noserv length=3 label="Without telephone service past 12 months"; attrib howlngwk length=3 label="Number of weeks w/o telephone service"; attrib nowaf_hh length=3 label="Armed Forces member in HH"; attrib acpt_fam length=3 label="Number of families responding in HH"; attrib rej_fam length=3 label="Number of families not responding in HH"; attrib acpt_per length=3 label="Number of persons responding in HH"; attrib rej_per length=3 label="Number of persons not responding in HH"; attrib acptchld length=3 label="Number of children that responded in HH*"; attrib lng_intv length=3 label="Language of interview"; attrib region length=3 label="Region"; attrib msasizep length=3 label="Geographic Distribution - MSA size"; attrib wtia_hh length=4 label="Weight - Interim Annual"; attrib wtfa_hh length=4 label="Weight - Final Annual"; attrib stratum length=3 label="Stratum for variance estimation"; attrib psu length=3 label="PSU for variance estimation"; INPUT @1 rectype 2. @3 srvy_yr 4. @7 hhx $6. @13 intv_qrt 1. @14 assignwk 2. @16 int_m_p $2. @18 int_y_p $4. @22 livqrt 2. @24 non_intv 1. @25 telenum 1. @26 inside 1. @27 noserv 1. @28 howlngwk 2. @30 nowaf_hh 1. @31 acpt_fam 2. @33 rej_fam 2. @35 acpt_per 2. @37 rej_per 2. @39 acptchld 2. @41 lng_intv 1. @42 region 1. @43 msasizep 1. @44 wtia_hh 6. @50 wtfa_hh 6. @56 stratum 3. @59 psu 1. ; /*------------------------------------------------ The PROC FORMAT statement will store the formats in a sas data set called fhous00 To use the stored formats in a subsequent program, use code like the following: proc format cntlin=library.fhous00; PROC freq; tables pesex ; format pesex P135L.; For more information, consult PROC FORMAT in the SAS Procedures Guide ----------------------------------------------- */ PROC FORMAT cntlout=library.fhous00; ; VALUE rectype (default=32) 10 = "Household" ; VALUE srvy_yr (default=32) 2000 = "2000" ; VALUE intv_qrt (default=32) 1 = "Quarter 1" 2 = "Quarter 2" 3 = "Quarter 3" 4 = "Quarter 4" ; VALUE assignwk (default=32) 01 = "Week 1" 02 = "Week 2" 03 = "Week 3" 04 = "Week 4" 05 = "Week 5" 06 = "Week 6" 07 = "Week 7" 08 = "Week 8" 09 = "Week 9" 10 = "Week 10" 11 = "Week 11" 12 = "Week 12" 13 = "Week 13" ; VALUE $int_m_p (default=32) ""01"" = "January" ""02"" = "February" ""03"" = "March" ""04"" = "April" ""05"" = "May" ""06"" = "June" ""07"" = "July" ""08"" = "August" ""09"" = "September" ""10"" = "October" ""11"" = "November" ""12"" = "December" ""98"" = "Not ascertained" ; VALUE livqrt (default=32) 01 = "House; apartment; flat; condo" 02 = "HU in nontransient hotel; motel" 03 = "HU-permanent in transient hotel; motel" 04 = "HU in rooming house" 05 = "Mobile home/trailer w/no permanent rooms added" 06 = "Mobile home/trailer w/1+ permanent rooms added" 07 = "HU not specified above" 08 = "Quarters not HU in room or board house" 09 = "Unit not permanent-transient hotel; motel" 10 = "Unoccupied site for mobile home/trailer/tent" 11 = "Student quarters in college dormitory" 12 = "Group quarter unit not specified above" 98 = "Not ascertained" ; VALUE non_intv (default=32) 1 = "Refused" 2 = "No one home - repeated calls" 3 = "Temporarily absent" 4 = "Language problem" 5 = "Other" ; VALUE telenum (default=32) 1 = "Gave a telephone number" 2 = "No telephone service" 7 = "Refused" 8 = "Not ascertained" 9 = "Don't know" ; VALUE inside (default=32) 1 = "Yes" 2 = "No" 7 = "Refused" 8 = "Not ascertained" 9 = "Don't know" ; VALUE noserv (default=32) 1 = "Yes" 2 = "No" 7 = "Refused" 8 = "Not ascertained" 9 = "Don't know" ; VALUE howlngwk (default=32) 00 = "One week or less" 01 = "More than one week; up to two weeks" 02 = "More than two weeks; up to three weeks" 97 = "Refused" 98 = "Not ascertained" 99 = "Don't know" ; VALUE nowaf_hh (default=32) 1 = "Armed Forces member in HH" 2 = "No Armed Forces member in HH*" ; VALUE lng_intv (default=32) 1 = "English" 2 = "Spanish" 3 = "English and Spanish" 4 = "Other" 8 = "Not ascertained" ; VALUE region (default=32) 1 = "Northeast" 2 = "Midwest" 3 = "South" 4 = "West" ; VALUE msasizep (default=32) 1 = "5;000;000 or more" 2 = "2;500;000 - 4;999;999" 3 = "1;000;000 - 2;499;999" 4 = "500;000 - 999;999" 5 = "250;000 - 499;999" 6 = "Under 250;000" 7 = "Non-MSA" ; proc print data=library.nhis2000_househld (obs=6); FORMAT rectype rectype. srvy_yr srvy_yr. intv_qrt intv_qrt. assignwk assignwk. int_m_p $int_m_p. livqrt livqrt. non_intv non_intv. telenum telenum. inside inside. noserv noserv. howlngwk howlngwk. nowaf_hh nowaf_hh. lng_intv lng_intv. region region. msasizep msasizep. ; proc contents data=library.nhis2000_househld; /* 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. */