NIPO ODIN Version 5.17
Scenario 2: Interview Numbers Based on Household Interview Number
This scenario applies the following directives:
- We start the survey with household records (each household a separate record).
- In the questionnaire the family size and the names of all family members are asked.
- The first respondent supplies his personal data in the household record.
- For each extra respondent a new family member record is created.
- The interview numbers are based on the household number. In our example, the last 4 digits of all household numbers are 0000 - a 1 is added for each family member).
- When interviewing the second, third, et cetera family member, the screening questions about family composition are skipped.
- For each extra family member a new record is created in the data file.
Example Sample table for scenario 2
InterviewNumber
|
DisplayField1
|
DisplayField2
|
AskHousehold
|
FamilySize
|
Int
|
Varchar(45)
|
Varchar(35)
|
Int
|
Int
|
10010000
|
New household record
|
Family #1
|
1
|
0
|
10020000
|
New household record
|
Family #2
|
1
|
0
|
10030000
|
New household record
|
Family #3
|
1
|
0
|
Example NIPO ODIN questionnaire for *NEXTRECORD : scenario 2
*SAMPLEDATA TTDisplayField1, TTDisplayField2 *SAMPLEDATA AskHousehold, FamilySize, TTInterviewNumber *TEXTVARS Name[9],NewNumber, TempNumber
*TAB 30 *IF [AskHousehold <> 1] *GOTO 3
*QUESTION 1 *NUMBER 61L1 *SAVE FamilySize How many family members are there in this household?
*QUESTION 1001 *CODES 62L9 *MULTI *DUMMY *REPEAT 9 *IF [?R <= Q1] *INCLUDE Q1001 [?R] *ENDREP
*QUESTION 2 *FORM *CONTROL Q1001 W What are the names of your family members?
1: 1st person *ALPHA 71L35 *SAVE Name[1] 2: 2nd person *ALPHA 106L35 *SAVE Name[2] 3: 3rd person *ALPHA 141L35 *SAVE Name[3] 4: 4th person *ALPHA 176L35 *SAVE Name[4] 5: 5th person *ALPHA 211L35 *SAVE Name[5] 6: 6th person *ALPHA 246L35 *SAVE Name[6] 7: 7th person *ALPHA 281L35 *SAVE Name[7] 8: 8th person *ALPHA 316L35 *SAVE Name[8] 9: 9th person *ALPHA 351L35 *SAVE Name[9]
*PUT TTDisplayField1 '*?Name[1]' *PUT AskHousehold [0] *PUT NewNumber [TTInterviewNumber]
*REPEAT 9 *CONTROL Q1001 W *IF [?R > 1] *PUT NewNumber [ NewNumber + 1 ] \ *PUT TempNumber [ NewNumber ] \ *NEXTRECORD TempNumber "TTDisplayField1=*?Name[?R], \ FamilySize=*?FamilySize, AskHousehold=*?AskHousehold" *ENDREP
*QUESTION 3 *CODES 386L1 Does *?TTDisplayField1 have his/her own mobile telephone?
1: Yes 2: No
*QUESTION 4 *OPEN 387L1 *IF [Q3,1] Who is the provider of that mobile telephone?
*QUESTION 9999 That's all questions for *?TTDisplayField1.
The next person in this household will be interviewed now. *END
The field AskHouseHold is used to skip the screening questions if further household members are interviewed.
If the value of NewNumber is set to 0, the *NEXTRECORD command creates a record and automatically assigns an unused InterviewerNumber value. For any value in the range 1-99999999, it attempts to create a record with that InterviewNumber value. Make sure that the NewNumber variable is initialized in the *REPEAT loop every time. If you forget to initialize it with zero, it would attempt to either create or update consecutive records with the given value, which results in a runtime error message "Error in *NEXTRECORD: Sample record [n] is not valid for interviewing" . A failed attempt to create or update a record returns the value -1 for NewNumber .
Make sure unique InterviewNumber values are created using NewNumber , which are not yet used in the Sample table. If the record number already exists, the system will attempt to update the existing record.
Example Sample table after scenario 2
InterviewNumber
|
DisplayField1
|
DisplayField2
|
AskHousehold
|
FamilySize
|
Int
|
Varchar(45)
|
Varchar(35)
|
Int
|
Int
|
10010000
|
John
|
Family #1
|
0
|
4
|
10020000
|
Mick
|
Family #2
|
0
|
3
|
10030000
|
Bruce
|
Family #3
|
0
|
1
|
10010001
|
Paul
|
Family #1
|
0
|
4
|
10010002
|
George
|
Family #1
|
0
|
4
|
10010003
|
Ringo
|
Family #1
|
0
|
4
|
10020001
|
Keith
|
Family #2
|
0
|
3
|
10020002
|
Charlie
|
Family #2
|
0
|
3
|
|