sub_dictionnary

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
vanndy
Posts: 30
Joined: May 10th, 2012, 10:45 pm

sub_dictionnary

Post by vanndy »

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
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: sub_dictionnary

Post by khurshid.arshad »

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:
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: sub_dictionnary

Post by Gregory Martin »

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.
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;
vanndy
Posts: 30
Joined: May 10th, 2012, 10:45 pm

Re: sub_dictionnary

Post by vanndy »

Thanks you all, It works well.
Post Reply