Roster row is showing empty

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
mgkavisan
Posts: 9
Joined: July 10th, 2019, 1:27 am

Roster row is showing empty

Post 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
Attachments
roster1.JPG
roster1.JPG (126.17 KiB) Viewed 2200 times
roster 2.JPG
roster 2.JPG (70.89 KiB) Viewed 2200 times
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Roster row is showing empty

Post 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;
mgkavisan
Posts: 9
Joined: July 10th, 2019, 1:27 am

Re: Roster row is showing empty

Post 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
Attachments
roster2.JPG
roster2.JPG (122.33 KiB) Viewed 2158 times
roster1.JPG
roster1.JPG (209.92 KiB) Viewed 2158 times
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: Roster row is showing empty

Post 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);
Post Reply