*options obs=100 ; options nocenter ; /*------------------------------------------------ by Jean Roth Mon Jul 2 15:42:47 EDT 2007 This program reads the 1998 National Health Interview Survey 1998 poiepsod 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/1998/poiepsod.exe "; * The following line should contain the name of the SAS dataset ; %let dataset = nhis1998_poiepsod ; DATA library.&dataset ; INFILE datafile LRECL = 20000 ; attrib rectype length=3 label="Record Type"; attrib srvy_yr length=4 label="Survey Year"; attrib hhx length=$6 label="Household Serial Number"; attrib fmx length=$2 label="Family Serial Number"; attrib px length=$2 label=""; attrib poiepno length=$1 label="Number of poison episode"; attrib poidtem length=3 label="Month of poisoning"; attrib pday length=3 label="Day of week of poisoning"; attrib poidtey length=4 label="Year of poisoning"; attrib rpckdmp length=3 label="Time between interview and poison dates"; attrib poitpr2 length=3 label="Cause of poisoning"; attrib poicc length=3 label="Called poison control center"; attrib phosp length=3 label="Hospitalized for poisoning"; attrib phno length=3 label="Number of nights hospitalized"; attrib pwkls length=3 label="Days absent from work"; attrib pscls length=3 label="Days absent from school"; attrib wtfa length=4 label="Weight - Final Annual"; INPUT @1 rectype 2. @3 srvy_yr 4. @7 hhx $6. @13 fmx $2. @15 px $2. @17 poiepno $1. @18 poidtem 2. @20 pday 2. @22 poidtey 4. @26 rpckdmp 2. @28 poitpr2 2. @30 poicc 1. @31 phosp 1. @32 phno 2. @34 pwkls 1. @35 pscls 1. @36 wtfa 6. ; /*------------------------------------------------ The PROC FORMAT statement will store the formats in a sas data set called fpoie98 To use the stored formats in a subsequent program, use code like the following: proc format cntlin=library.fpoie98; PROC freq; tables pesex ; format pesex P135L.; For more information, consult PROC FORMAT in the SAS Procedures Guide ----------------------------------------------- */ PROC FORMAT cntlout=library.fpoie98; ; VALUE rectype (default=32) 80 = "Poison Episode" ; VALUE srvy_yr (default=32) 1998 = "1998" ; VALUE $poiepno (default=32) ""1"" = "First poisoning" ""2"" = "Second poisoning" ""3"" = "Third poisoning" ""4"" = "Fourth poisoning" ; VALUE poidtem (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" 97 = "Refused" 98 = "Not ascertained" 99 = "Don't know" ; VALUE pday (default=32) 01 = "Sunday" 02 = "Monday" 03 = "Tuesday" 04 = "Wednesday" 05 = "Thursday" 06 = "Friday" 07 = "Saturday" 97 = "Refused" 98 = "Not ascertained" 99 = "Don't know" ; VALUE poidtey (default=32) 1997 = "1997" 1998 = "1998" 1999 = "1999" 9997 = "Refused" 9998 = "Not ascertained" 9999 = "Don't know" ; VALUE rpckdmp (default=32) 92 = "92-104 days" 93 = "Same month as interview" 94 = "Month before month of interview" 95 = "2 months before month of interview" 96 = "3 or 4 months before month of interview" 98 = "Not ascertained" ; VALUE poitpr2l (default=32) 01 = "A drug or med substance used mistakenly/od" 02 = "A harmful or toxic solid or liquid substance" 03 = "Inhaling gases or vapors" 04 = "Eating poisonous plant/substance" 05 = "A venomous animal or plant" 06 = "Something else - poisoning" 07 = "Allergic/adverse reaction to med/otr substance" 08 = "Something else - NOT poisoning" 97 = "Refused" 98 = "Not ascertained" 99 = "Don't know" ; VALUE poicc (default=32) 1 = "Yes" 2 = "No" 7 = "Refused" 8 = "Not ascertained" 9 = "Don't know" ; VALUE phosp (default=32) 1 = "Yes" 2 = "No" 7 = "Refused" 8 = "Not ascertained" 9 = "Don't know" ; VALUE phno (default=32) 95 = "95+ nights" 97 = "Refused" 98 = "Not ascertained" 99 = "Don't know" ; VALUE pwkls (default=32) 0 = "None" 1 = "Less than 1 day" 2 = "One to five days" 3 = "Six or more days" 6 = "Not employed at the time of poisoning" 7 = "Refused" 8 = "Not ascertained" 9 = "Don't know" ; VALUE pscls (default=32) 0 = "None" 1 = "Less than 1 day" 2 = "One to five days" 3 = "Six or more days" 6 = "Not in school at the time of the injury" 7 = "Refused" 8 = "Not ascertained" 9 = "Don't know" ; proc print data=library.nhis1998_poiepsod (obs=6); FORMAT rectype rectype. srvy_yr srvy_yr. poiepno $poiepno. poidtem poidtem. pday pday. poidtey poidtey. rpckdmp rpckdmp. poitpr2 poitpr2l. poicc poicc. phosp phosp. phno phno. pwkls pwkls. pscls pscls. ; proc contents data=library.nhis1998_poiepsod; /* 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. */