Page 1 of 1

Roster row is showing empty

Posted: July 30th, 2020, 5:01 am
by mgkavisan
hi members

i m new member for cs pro

actually geting error in roster part

in my case i need to preload last wave data in roster 1 then if the persons are not present then those are present in the household members need to show in roster 2 i tried that

preproc

// Prefill in names in names roster from enumerator data file
numeric numPreloadIndividuals = count(HH_IDMSIZEROSTER000);

do numeric x = 1 while x <= numPreloadIndividuals
if ID005(x)= 1 then


HH_LINEID(x)=x;
HH_OLDLINE(x) =ID(x);
CV002A(x) = F_NAME(x);
CV002B(x) = L_NAME(x);

endif
enddo;

i need remove the empty row from the list whose are not present

pls help me frnds

Re: Roster row is showing empty

Posted: July 30th, 2020, 9:40 am
by Gregory Martin
Use two counters: one for the data from which you're copying, and one for the destination rows:
// Prefill in names in names roster from enumerator data file
numeric numPreloadIndividuals = count(HH_IDMSIZEROSTER000);
numeric destinationRow = 0;

do numeric x = 1 while x <= numPreloadIndividuals

   
if ID005(x)= 1 then

        inc
(destinationRow);

        HH_LINEID(destinationRow) = x;
        HH_OLDLINE(destinationRow) = ID(x);
        CV002A(destinationRow) = F_NAME(x);
        CV002B(destinationRow) = L_NAME(x);

   
endif;

enddo;

Re: Roster row is showing empty

Posted: July 31st, 2020, 7:24 am
by mgkavisan
thank you Gregory Martin
its working

one more help is need

ID008a question i choosed other members is the current household head
i need to put the member in first row in the household roster 2 what i choosed in ID008A

Re: Roster row is showing empty

Posted: July 31st, 2020, 3:18 pm
by aaronw
You'll use the response from ID008A as an index into roster 1's name variables. Assign them to the 1st occurrence of roster 2's name variables. Will look similar to this:
CV002A(1) = F_NAME(ID008A);
CV002B(
1) = L_NAME(ID008A);