Roster operation

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Mahedi1991
Posts: 8
Joined: November 21st, 2021, 10:09 pm

Roster operation

Post by Mahedi1991 »

What will be the logic if present roster is asked only if age greater than 5 in previous roster?
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: Roster operation

Post by aaronw »

In the first field of the second roster add a field that skips to the next occurrence if the person is 5 or less.
preproc

if
AGE <= 5 then
    skip to next
;
endif;
Here's the helps for skips which will include information on skip to next: https://www.csprousers.org/help/CSPro/s ... ement.html
Mahedi1991
Posts: 8
Joined: November 21st, 2021, 10:09 pm

Re: Roster operation

Post by Mahedi1991 »

Thanks for your reply, but this logic does not work as shows subscript error.
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: Roster operation

Post by sherrell »

I think the original question:

>What will be the logic if present roster is asked only if age greater than 5 in previous roster?

meant to say ROW, not roster. However, even if a repeating record has been split into two rosters, with AGE being placed in the first roster, and it is evaluated in the second roster, the logic will work.

If you wish to use this logic and are encountering problems, please zip up your application and post it here so we can take a look.

Thanks,
Sherrell
Mahedi1991
Posts: 8
Joined: November 21st, 2021, 10:09 pm

Re: Roster operation

Post by Mahedi1991 »

Thanks , Please take a look in section 01 and section 02. I need to set a logic that will work as "Section 02 is asked only if age is over 5 in section 01.
Attachments
UNICEF_cspro.rar
I have uploaded the file.
(33.33 KiB) Downloaded 158 times
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: Roster operation

Post by sherrell »

Hi Mahedi,

See attached for a few revisions. A few observations too:

[1] See the postproc of IDCODE_R2 for how to handle the age skip.

[2] IDCODE_R1/R2: you don't need to define each value, just use a range (see the dcf)

[3] AGE: no range has been defined. This means someone could enter negative values or very large values. I don't think you'll have too many people age 200 and above :)

[4] AGE_MONTH: should this be asked of everyone, or only those under a (lower) age? For as people get older they often barely know their own age, let alone how many months they are past their birthday. Also, you have an error message triggering if this value is > 11, yet the dictionary is allowing 3 digits.

[5] IDCODE_R2 & SEC_NAME: I moved the assignment of these variables to the preproc of the roster. Putting this logic within a roster variable means the logic will be repeated for every person. It won't slow down this small application, but when you start developing larger apps, you'll want to eliminate this type of code duplication.

[6] Within CSPro's "Tools" menu there is a "pack application" option. This is the best way to send files, as you don't have to think about what's been included within your application (especially if you have files from other folders being used), as it knows what to pull in.

Sherrell
Attachments
Tea Garden Survey.zip
(8.7 KiB) Downloaded 148 times
Mahedi1991
Posts: 8
Joined: November 21st, 2021, 10:09 pm

Re: Roster operation

Post by Mahedi1991 »

Hi Sherrell,
Thanks for your support. It works as i need to and also thanks for your important feedback.
Mahedi
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: Roster operation

Post by sherrell »

You bet. Have a good rest of the year. Sherrell
Mahedi1991
Posts: 8
Joined: November 21st, 2021, 10:09 pm

Re: Roster operation

Post by Mahedi1991 »

Hi sherrell,
There is a problem in endgruop command. Roster doesn't end after idcode_R2>tot_pers.
Mahedi
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: Roster operation

Post by sherrell »

Hi Mahedi,

Ooops! Sorry, I was playing around with things. I'm not a fan of having empty records, so I made a last minute change to eliminate it from the 2nd roster, which then caused the endgroup to not work properly. See attached for a fix, where I keep the empty record in the 2nd roster (which at least allows it to stay in sync w/the first roster). A more controlled way to handle the # of HH members is to have a field before you drop into the HH roster that asks how many people live in the HH. If the enumerator finds out there are more/fewer during the interview, they can always go back to that field and change the value. I'm assuming you are not allowing vacant HHs? For if so, then you would definitely want a field asking about # of persons.

Sherrell
Attachments
Tea Garden Survey #2.zip
(8.69 KiB) Downloaded 156 times
Post Reply