Dear CSPro users,
I have one rooster which contain a list of family members then I have INDIVIDUAL_FRM that asking more detail of each individual. INDIVIDUAL_FRM will be asked depending on some conditional that is used in rooster list of family member.
for example, asking household member who is in age between 18-40; this will check all members in the list. May you help me ; how can I do this?
Please be noted that: each rooster is record in different household ID, and INDIVIDUAL_FRM is in sub of household which contain different ID. Please let me know if my problem description is not clear.
Best regards,
Vanndy
sub_dictionnary
Forum rules
New release: CSPro 8.0
New release: CSPro 8.0
-
- Posts: 571
- Joined: July 9th, 2012, 11:32 am
- Location: Islamabad, Pakistan
Re: sub_dictionnary
use Seek option
example you have a roster and after that you are going to enter individual informtion ;
Proc Individual_ID
Numeric Getpid=seek(Rpid where Rpid=$ and age in 18:40);
\\RPID RPID=PID(Personal identification Number) from roster
\\Over here we are asking find data from roster where the Individual_ID = RPID and age willbe between 18:40 years
if getpid>=1 then
else
errmsg ("Your individual Id is not correct");
$=reenter;
endif:
example you have a roster and after that you are going to enter individual informtion ;
Proc Individual_ID
Numeric Getpid=seek(Rpid where Rpid=$ and age in 18:40);
\\RPID RPID=PID(Personal identification Number) from roster
\\Over here we are asking find data from roster where the Individual_ID = RPID and age willbe between 18:40 years
if getpid>=1 then
else
errmsg ("Your individual Id is not correct");
$=reenter;
endif:
-
- Posts: 1777
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: sub_dictionnary
As Arshad mentioned, the seek function may be useful to you. You can use that, or simply a do/while loop, to search for the eligible people in the household for which you want to enter data.
You can either have a one-to-one correspondence for INDIVIDUAL_FRM and the household roster, in which case you'll leave some rows blank, or you can store the household roster occurrence number in INDIVIDUAL_FRM so that you can link the two records later.
You could use logic like this to find out whether there are additional people to interview in the second model of linking the two rosters together. Let's assume that LINK is the first field of INDIVIDUAL_FRM.
You can either have a one-to-one correspondence for INDIVIDUAL_FRM and the household roster, in which case you'll leave some rows blank, or you can store the household roster occurrence number in INDIVIDUAL_FRM so that you can link the two records later.
You could use logic like this to find out whether there are additional people to interview in the second model of linking the two rosters together. Let's assume that LINK is the first field of INDIVIDUAL_FRM.
PROC LINK
preproc
numeric thisOcc = curocc();
numeric ptrHouseholdRoster = seek(AGE in 18:40,@thisOcc);
if ptrHouseholdRoster then
LINK = ptrHouseholdRoster;
else // we have entered data on all 18-40 year-olds on the household roster
endgroup;
endif;
preproc
numeric thisOcc = curocc();
numeric ptrHouseholdRoster = seek(AGE in 18:40,@thisOcc);
if ptrHouseholdRoster then
LINK = ptrHouseholdRoster;
else // we have entered data on all 18-40 year-olds on the household roster
endgroup;
endif;
Re: sub_dictionnary
Thanks you all, It works well.