********************************************************************* APRIL 13, 2018 6:48 AM This is an example of a SAS program that creates a SAS file from the 2017 NHIS Public Use PARADATA.DAT ASCII file This is stored in PARADATA.SAS *********************************************************************; * USER NOTE: PLACE NEXT STATEMENT IN SUBSEQUENT PROGRAMS; LIBNAME NHIS "C:\NHIS2017"; * USER NOTE: PLACE NEXT STATEMENT IN SUBSEQUENT PROGRAMS IF YOU ALLOW PROGRAM TO PERMANENTLY STORE FORMATS; LIBNAME LIBRARY "C:\NHIS2017"; FILENAME ASCIIDAT 'C:\NHIS2017\PARADATA.dat'; * DEFINE VARIABLE VALUES FOR REPORTS; * USE THE STATEMENT "PROC FORMAT LIBRARY=LIBRARY" TO PERMANENTLY STORE THE FORMAT DEFINITIONS; * USE THE STATEMENT "PROC FORMAT" IF YOU DO NOT WISH TO PERMANENTLY STORE THE FORMATS; PROC FORMAT LIBRARY=LIBRARY; *PROC FORMAT; VALUE $GROUPC ' '< - HIGH = "Range of Values" ; VALUE GROUPN LOW - HIGH = "Range of Values" ; VALUE PAP001X 10 = "10 Household" 20 = "20 Person" 25 = "25 Income Imputation" 30 = "30 Sample Adult" 38 = "38 Functioning and Disability" 40 = "40 Sample Child" 60 = "60 Family" 63 = "63 Family Disability Questions" 65 = "65 Paradata" 70 = "70 Injury/Poisoning Episode" 75 = "75 Injury/Poisoning Verbatim" ; VALUE PAP002X . = '.' OTHER = "Survey Year" ; VALUE PAP004X 1 = "1 Quarter 1" 2 = "2 Quarter 2" 3 = "3 Quarter 3" 4 = "4 Quarter 4" ; VALUE PAP005X 01 = "01 January" 02 = "02 February" 03 = "03 March" 04 = "04 April" 05 = "05 May" 06 = "06 June" 07 = "07 July" 08 = "08 August" 09 = "09 September" 10 = "10 October" 11 = "11 November" 12 = "12 December" ; VALUE PAP007X 201 = "201 Completed interview" 203 = "203 Sufficient partial interview, no follow-up" 213 = "213 Language problem" 215 = "215 Insufficient partial" 216 = "216 No one home, repeated calls" 217 = "217 Temporarily absent, no follow-up" 218 = "218 Refused" 219 = "219 Other Type A" 299 = "299 Occupied entirely by Armed Forces members or by persons with usual residenc e elsewhere, Screened out by Race/Ethnicity" ; VALUE PAP009X 1 = "1 No Sample Adult record in a family due to quality reasons" 2 = "2 No Sample Child record in a family due to quality reasons" 3 = "3 No Sample Adult and Sample Child records in a family due to quality reasons" ; VALUE PAP010X 1 = "1 Family record removed due to quality reasons" ; VALUE PAP017X 0 = "0 None" 1 = "1 1 or more times" ; VALUE PAP055X 0 = "0 None" ; VALUE PAP072X 0 = "0 Case not reassigned" 1 = "1 Case reassigned" ; VALUE PAP073X 1 = "1 English" 2 = "2 Spanish" 3 = "3 English and Spanish" 4 = "4 Other" 8 = "8 Not ascertained" ; VALUE PAP074X 1 = "1 Yes" 2 = "2 No" ; VALUE PAP076X 1 = "1 Relative" 2 = "2 Neighbor" 3 = "3 Nurse" 4 = "4 Other health care worker" 5 = "5 Other" ; VALUE PAP078X 1 = "1 Definitely agree" 2 = "2 Probably agree" 3 = "3 Probably refuse" 4 = "4 Definitely refuse" ; VALUE PAP079X 1 = "1 Very good" 2 = "2 Good" 3 = "3 Fair" 4 = "4 Poor" 5 = "5 Very poor" 8 = "8 Not ascertained" ; VALUE PAP080X 1 = "1 Interview stopped in progress/Break-off" 2 = "2 Completion before closeout not possible (Other than Break-off)" 8 = "8 Not ascertained" ; VALUE PAP081X 1 = "1 Household Composition Section" 2 = "2 Family Section" 3 = "3 Sample Child Section" 4 = "4 Sample Adult Section" 8 = "8 Not ascertained" ; VALUE PAP082X 01 = "01 Respondent too busy" 02 = "02 Respondent had to leave" 03 = "03 Respondent felt questions were too personal" 04 = "04 Respondent felt interview was too long" 05 = "05 Respondent physically/mentally unable to participate" 06 = "06 Respondent does not like/trust government" 07 = "07 Respondent's relative (spouse/child) did not want him/her to participate" 08 = "08 Language problem" 09 = "09 Computer error" 10 = "10 Phone technology issues (battery died, lost signal, etc.)" 11 = "11 Other" 98 = "98 Not ascertained" ; VALUE PAP083X 01 = "01 Respondent out of town" 02 = "02 Unable to contact Respondent before closeout" 03 = "03 Respondent too busy" 04 = "04 Respondent had to leave" 05 = "05 Respondent felt questions were too personal" 06 = "06 Respondent felt interview was too long" 07 = "07 Respondent physically/mentally unable to participate" 08 = "08 Respondent does not like/trust government" 09 = "09 Respondent's relative (spouse/child) did not want him/her to participate" 10 = "10 Language problem" 11 = "11 Computer error" 12 = "12 Other" ; VALUE PAP084X 1 = "1 Type A" 2 = "2 Type B" 3 = "3 Type C" ; VALUE PAP085X 1 = "1 Refused" 2 = "2 No one home, repeated calls" 3 = "3 Temporarily absent" 4 = "4 Language problem" 5 = "5 Other" 8 = "8 Not ascertained" ; VALUE PAP086X 1 = "1 Yes" 2 = "2 No" 8 = "8 Not ascertained" ; VALUE PAP087X 1 = "1 Gave telephone number" 2 = "2 No telephone" 7 = "7 Refused" 8 = "8 Not ascertained" 9 = "9 Don't know" ; VALUE PAP088X 1 = "1 Yes" 2 = "2 No" 7 = "7 Refused" 8 = "8 Not ascertained" 9 = "9 Don't know" ; VALUE PAP090X 97 = "97 Refused" 98 = "98 Not ascertained" 99 = "99 Don't know" ; VALUE PAP091X 1 = "1 All or almost all calls received on cell phones" 2 = "2 Some received on cell phones and some on regular phones" 3 = "3 Very few or none on cell phones" 7 = "7 Refused" 8 = "8 Not ascertained" 9 = "9 Don't know" ; VALUE PAP092X 1 = "1 Early" 2 = "2 Middle" 3 = "3 Late" ; VALUE PAP094X 1 = "1 Morning" 2 = "2 Afternoon" 3 = "3 Evening" ; VALUE PAP103X 1 = "1 Northeast" 2 = "2 Midwest" 3 = "3 South" 4 = "4 West" ; DATA NHIS.PARADATA; * CREATE A SAS DATA SET; INFILE ASCIIDAT PAD LRECL=136; * DEFINE LENGTH OF ALL VARIABLES; LENGTH /* IDN LENGTHS */ RECTYPE 3 SRVY_YR 4 HHX $ 6 INTV_QRT 3 INTV_MON 3 FMX $ 2 OUTCOME1 4 WTIA_PD 8 QCSASCFM 3 QCFAM 3 /* CHI LENGTHS */ TOTCOUNT 3 MODE_P 3 MODE_T 3 CTSTAT1 3 CTSTAT2 3 CTSTAT3 3 UNABLE1R 3 UNABLE2R 3 UNABLE3R 3 UNABLE4R 3 UNABLE5R 3 UNABL99R 3 LANG1R 3 LANG2R 3 LANG3R 3 LANG4R 3 LANG5R 3 NCTP01R 3 NCTPR03R 3 NCTPR04R 3 NCTP05R 3 NCTPR07R 3 NCTPR08R 3 NCTPR09R 3 NCTPR10R 3 NCTPR11R 3 NCTP12R 3 NCTPR99R 3 NCTL01R 3 NCTL02R 3 NCTEL03R 3 NCTEL04R 3 NCTEL05R 3 NCTL06R 3 NCTL07R 3 NCTEL99R 3 RELC01R 3 RELUC02R 3 RELUC03R 3 RELUC05R 3 RELUC06R 3 RELUC07R 3 RELC08R 3 RELC09R 3 RELUC11R 3 RELUC12R 3 RELC15R 3 RELUC98R 3 RELUC99R 3 STRAT01R 3 STRAT02R 3 STRAT03R 3 STRAT04R 3 STRAT05R 3 STRAT06R 3 STRT11R 3 STRAT12R 3 STRAT13R 3 STRT14R 3 STRAT98R 3 STRAT99R 3 REASSIGN 3 /* BCK LENGTHS */ FLNGINTV 3 INTRPT 3 NONRES 3 NONRES2 3 INTMODE 3 RESPOND 3 COOPFAM 3 PARWHY 3 BRKWHER 3 BRKRES1 3 NCOMRES 3 /* FRT LENGTHS */ TYPEABC 3 TYPEA1 3 TYPEB2 3 /* COV LENGTHS */ TELN_FLG 3 CURWRKN 3 TELCELN 3 WRKCELN 3 PHONEUSE 3 /* HHC LENGTHS */ ENDPNT 3 STRTPNT 3 HHC_TOD 3 /* FHS LENGTHS */ FMSTRPNT 3 FAM_TOD 3 /* AID LENGTHS */ SASTRPNT 3 SA_TOD 3 /* CID LENGTHS */ SCSTRPNT 3 SC_TOD 3 /* UCF LENGTHS */ PSTRAT 4 PPSU 4 CENREG 3 ; * INPUT ALL VARIABLES; INPUT /* IDN LOCATIONS */ RECTYPE 1 - 2 SRVY_YR 3 - 6 HHX $ 7 - 12 INTV_QRT 13 - 13 INTV_MON 14 - 15 FMX $ 16 - 17 OUTCOME1 18 - 20 WTIA_PD 21 - 28 .1 QCSASCFM 29 - 29 QCFAM 30 - 30 /* CHI LOCATIONS */ TOTCOUNT 31 - 32 MODE_P 33 - 34 MODE_T 35 - 36 CTSTAT1 37 - 38 CTSTAT2 39 - 40 CTSTAT3 41 - 42 UNABLE1R 43 - 43 UNABLE2R 44 - 44 UNABLE3R 45 - 45 UNABLE4R 46 - 46 UNABLE5R 47 - 47 UNABL99R 48 - 48 LANG1R 49 - 49 LANG2R 50 - 50 LANG3R 51 - 51 LANG4R 52 - 52 LANG5R 53 - 53 NCTP01R 54 - 54 NCTPR03R 55 - 55 NCTPR04R 56 - 56 NCTP05R 57 - 57 NCTPR07R 58 - 58 NCTPR08R 59 - 59 NCTPR09R 60 - 60 NCTPR10R 61 - 61 NCTPR11R 62 - 62 NCTP12R 63 - 63 NCTPR99R 64 - 64 NCTL01R 65 - 65 NCTL02R 66 - 66 NCTEL03R 67 - 67 NCTEL04R 68 - 68 NCTEL05R 69 - 69 NCTL06R 70 - 70 NCTL07R 71 - 71 NCTEL99R 72 - 72 RELC01R 73 - 73 RELUC02R 74 - 74 RELUC03R 75 - 75 RELUC05R 76 - 76 RELUC06R 77 - 77 RELUC07R 78 - 78 RELC08R 79 - 79 RELC09R 80 - 80 RELUC11R 81 - 81 RELUC12R 82 - 82 RELC15R 83 - 83 RELUC98R 84 - 84 RELUC99R 85 - 85 STRAT01R 86 - 86 STRAT02R 87 - 87 STRAT03R 88 - 88 STRAT04R 89 - 89 STRAT05R 90 - 90 STRAT06R 91 - 91 STRT11R 92 - 92 STRAT12R 93 - 93 STRAT13R 94 - 94 STRT14R 95 - 95 STRAT98R 96 - 96 STRAT99R 97 - 97 REASSIGN 98 - 98 /* BCK LOCATIONS */ FLNGINTV 99 - 99 INTRPT 100 - 100 NONRES 101 - 101 NONRES2 102 - 102 INTMODE 103 - 103 RESPOND 104 - 104 COOPFAM 105 - 105 PARWHY 106 - 106 BRKWHER 107 - 107 BRKRES1 108 - 109 NCOMRES 110 - 111 /* FRT LOCATIONS */ TYPEABC 112 - 112 TYPEA1 113 - 113 TYPEB2 114 - 114 /* COV LOCATIONS */ TELN_FLG 115 - 115 CURWRKN 116 - 116 TELCELN 117 - 117 WRKCELN 118 - 119 PHONEUSE 120 - 120 /* HHC LOCATIONS */ ENDPNT 121 - 121 STRTPNT 122 - 122 HHC_TOD 123 - 123 /* FHS LOCATIONS */ FMSTRPNT 124 - 124 FAM_TOD 125 - 125 /* AID LOCATIONS */ SASTRPNT 126 - 126 SA_TOD 127 - 127 /* CID LOCATIONS */ SCSTRPNT 128 - 128 SC_TOD 129 - 129 /* UCF LOCATIONS */ PSTRAT 130 - 132 PPSU 133 - 135 CENREG 136 - 136; * DEFINE VARIABLE LABELS; LABEL /* IDN LABELS */ RECTYPE ="File type identifier" SRVY_YR ="Year of National Health Interview Survey" HHX ="Household identifier" INTV_QRT ="Interview Quarter" INTV_MON ="Assignment/Interview Month" FMX ="Family number" OUTCOME1 = "Outcome code--restricted to 201, 203, Type A, select Type B codes" WTIA_PD ="Paradata file weight" QCSASCFM = "Sample Adult/Sample Child record removal due to quality reasons" QCFAM ="Family record removed for quality reasons" /* CHI LABELS */ TOTCOUNT ="Total count of CHI records for this case" MODE_P ="Number of personal visit attempts for this case" MODE_T ="Number of telephone attempts for this case" CTSTAT1 ="Number of contacts with sample unit members" CTSTAT2 ="Number of contacts with non-sample unit members" CTSTAT3 ="Number of noncontacts" UNABLE1R ='Number of times "Eligible person not available" was entered' UNABLE2R ='Number of times "Inconvenient time" was entered' UNABLE3R ='Number of times "Respondent is reluctant" was entered' UNABLE4R ='Number of times "Language problem--specify" was entered' UNABLE5R ='Number of times "Health problem" was entered' UNABL99R ='Number of times "Other--specify" was entered' LANG1R ='Number of times "Specify language or dialect" was entered' LANG2R = 'Number of times "No household member able to translate" was entered' LANG3R = 'Number of times "Contact RO about language problem" was entered' LANG4R ='Number of times "Unable to find translator" was entered' LANG5R ='Number of times "No time left to find translator" was entered ' NCTP01R = 'Number of times "No one home/No eligible person home" was entered' NCTPR03R = 'Number of times "No one home--previous note/letter taken" was entered' NCTPR04R = 'Number of times "Household does not answer door--someone is home" entered' NCTP05R ='Number of times "Observed HH from vehicle" was entered' NCTPR07R = 'Number of times "Unable to reach/locked gate/buzzer entry" was entered' NCTPR08R = 'Number of times "Address does not exist/unable to locate" was entered' NCTPR09R = 'Number of times "On vacation, away from home/at second home" was entered' NCTPR10R ='Number of times "Spoke with neighbor" was entered' NCTPR11R = 'Number of times "Building management/doorman contact" was entered' NCTP12R = 'Number of times "Completed case (Type B or C or Vacant interview)" entered' NCTPR99R ='Number of times "Other--specify" was entered' NCTL01R ='Number of times "Got answering machine" was entered' NCTL02R ='Number of times "Ring, no answer" was entered' NCTEL03R ='Number of times "Busy signal" was entered' NCTEL04R ='Number of times "Disconnected" was entered' NCTEL05R ='Number of times "Wrong number" was entered' NCTL06R ='Number of times "Spoke with ineligible person" was entered' NCTL07R ='Number of times "Respondent left message" was entered' NCTEL99R ='Number of times "Other-specify" was entered' RELC01R ='Number of times "Not interested" was entered' RELUC02R ='Number of times "Too busy" was entered' RELUC03R ='Number of times "Interview takes too much time" was entered' RELUC05R ='Number of times "Scheduling difficulties" was entered' RELUC06R ='Number of times "Survey is voluntary" was entered' RELUC07R ='Number of times "Privacy concerns" was entered' RELC08R ='Number of times "Local/State/Fed. Govt. concerns" was entered ' RELC09R ='Number of times "Asks questions about the survey" was entered ' RELUC11R ='Number of times "Hang-up/slams door on FR" was entered' RELUC12R ='Number of times "Hostile or threatens FR" was entered' RELC15R = 'Number of times "Family Issues (death, illness, etc.)" entered' RELUC98R ='Number of times "No concerns" was entered' RELUC99R ='Number of times "Other-specify" was entered' STRAT01R ='Number of times "Advance letter given" was entered' STRAT02R ='Number of times "Scheduled appointment" was entered' STRAT03R ='Number of times "Left note/appointment card" was entered' STRAT04R = 'Number of times "Left promotional packet/informational brochure" was entered' STRAT05R ='Number of times "Called household" was entered' STRAT06R = 'Number of times "Left message on answering machine" was entered' STRT11R ='Number of times "Waited for respondent" was entered' STRAT12R ='Number of times "Checked with neighbors" was entered' STRAT13R ='Number of times "Contacted other family members" was entered' STRT14R = 'Number of times "Contacted property manager/doorman" was entered' STRAT98R ='Number of times "No strategies" was entered' STRAT99R ='Number of times "Other--specify" was entered' REASSIGN ="Case reassignment to another interviewer (FR)" /* BCK LABELS */ FLNGINTV ="Language of interview" INTRPT ="Interpreter used" NONRES ="Non-household member respondent" NONRES2 ="Non-household member relationship" INTMODE ="Any sections conducted primarily by telephone" RESPOND ="How likely to respond to later linked survey" COOPFAM ="Assessment of household cooperativeness" PARWHY ="Reason interview not complete" BRKWHER ="Section where break-off occurred" BRKRES1 ="Main reason interview terminated" NCOMRES ="Main reason case not complete" /* FRT LABELS */ TYPEABC ="Type of non-interview initiated from the front section" TYPEA1 ="All Type A non-interviews" TYPEB2 ="Determined to be Type B non-interview by observation only." /* COV LABELS */ TELN_FLG ="Supplied telephone number" CURWRKN ="Working phone inside home" TELCELN ="Working cell phone in family" WRKCELN ="Number of working cell phones" PHONEUSE ="Received calls cell/landline/both" /* HHC LABELS */ ENDPNT ="Point in the interview period when the case was finished" STRTPNT = "Point in the interview period when the Household Composition section was starte d" HHC_TOD = "Time of day that the Household Composition section was started" /* FHS LABELS */ FMSTRPNT = "Point in the interview period when the Family section was started" FAM_TOD ="Time of day that the Family section was started" /* AID LABELS */ SASTRPNT = "Point in the interview period when the Sample Adult section was started" SA_TOD ="Time of day that the Sample Adult section was started" /* CID LABELS */ SCSTRPNT = "Point in the interview period when the Sample Child section was started" SC_TOD ="Time of day that the Sample Child section was started" /* UCF LABELS */ PSTRAT ="Pseudo-stratum for public-use file variance estimation" PPSU ="Pseudo-PSU for public-use file variance estimation" CENREG ="Census region of residence" ; * ASSOCIATE VARIABLES WITH FORMAT VALUES; * (PUT ASTERISK (*) BEFORE WORD "FORMAT" IN NEXT STATEMENT TO PREVENT FORMAT ASSOCIATIONS BEING STORED WITH DATA SET); FORMAT /* IDN FORMAT ASSOCIATIONS */ RECTYPE PAP001X. SRVY_YR PAP002X. HHX $GROUPC. INTV_QRT PAP004X. INTV_MON PAP005X. OUTCOME1 PAP007X. WTIA_PD GROUPN. QCSASCFM PAP009X. QCFAM PAP010X. /* CHI FORMAT ASSOCIATIONS */ UNABLE1R PAP017X. UNABLE2R PAP017X. UNABLE3R PAP017X. UNABLE4R PAP017X. UNABLE5R PAP017X. UNABL99R PAP017X. LANG1R PAP017X. LANG2R PAP017X. LANG3R PAP017X. LANG4R PAP017X. LANG5R PAP017X. NCTP01R PAP017X. NCTPR03R PAP017X. NCTPR04R PAP017X. NCTP05R PAP017X. NCTPR07R PAP017X. NCTPR08R PAP017X. NCTPR09R PAP017X. NCTPR10R PAP017X. NCTPR11R PAP017X. NCTP12R PAP017X. NCTPR99R PAP017X. NCTL01R PAP017X. NCTL02R PAP017X. NCTEL03R PAP017X. NCTEL04R PAP017X. NCTEL05R PAP017X. NCTL06R PAP017X. NCTL07R PAP017X. NCTEL99R PAP017X. RELC01R PAP017X. RELUC02R PAP017X. RELUC03R PAP017X. RELUC05R PAP017X. RELUC06R PAP017X. RELUC07R PAP017X. RELC08R PAP017X. RELC09R PAP017X. RELUC11R PAP055X. RELUC12R PAP017X. RELC15R PAP017X. RELUC98R PAP017X. RELUC99R PAP017X. STRAT01R PAP017X. STRAT02R PAP017X. STRAT03R PAP017X. STRAT04R PAP017X. STRAT05R PAP017X. STRAT06R PAP017X. STRT11R PAP017X. STRAT12R PAP017X. STRAT13R PAP017X. STRT14R PAP017X. STRAT98R PAP017X. STRAT99R PAP017X. REASSIGN PAP072X. /* BCK FORMAT ASSOCIATIONS */ FLNGINTV PAP073X. INTRPT PAP074X. NONRES PAP074X. NONRES2 PAP076X. INTMODE PAP074X. RESPOND PAP078X. COOPFAM PAP079X. PARWHY PAP080X. BRKWHER PAP081X. BRKRES1 PAP082X. NCOMRES PAP083X. /* FRT FORMAT ASSOCIATIONS */ TYPEABC PAP084X. TYPEA1 PAP085X. TYPEB2 PAP086X. /* COV FORMAT ASSOCIATIONS */ TELN_FLG PAP087X. CURWRKN PAP088X. TELCELN PAP088X. WRKCELN PAP090X. PHONEUSE PAP091X. /* HHC FORMAT ASSOCIATIONS */ ENDPNT PAP092X. STRTPNT PAP092X. HHC_TOD PAP094X. /* FHS FORMAT ASSOCIATIONS */ FMSTRPNT PAP092X. FAM_TOD PAP094X. /* AID FORMAT ASSOCIATIONS */ SASTRPNT PAP092X. SA_TOD PAP094X. /* CID FORMAT ASSOCIATIONS */ SCSTRPNT PAP092X. SC_TOD PAP094X. /* UCF FORMAT ASSOCIATIONS */ CENREG PAP103X.; RUN; PROC CONTENTS DATA=NHIS.PARADATA; TITLE1 'CONTENTS OF THE 2017 NHIS PARADATA FILE'; PROC FREQ DATA=NHIS.PARADATA NOTITLE; TABLES RECTYPE/LIST MISSING; TITLE1 'FREQUENCY REPORT FOR 2017 NHIS PARADATA FILE'; TITLE2 '(UNWEIGHTED)'; * USER NOTE: TO SEE UNFORMATTED VALUES IN PROCEDURES, ADD THE STATEMENT: FORMAT _ALL_; RUN;