Skipping to the Beginning of a Roster


With a roster on a form, it is quite common that you want to skip to the first field of the next occurrence. For example, a population roster might include a set of questions only asked of women aged 15-49. In the past, you might write something like:

PROC CHILDREN_EVER_BORN

preproc

   
if not ( SEX = 2 and AGE in 15:49 ) then
       
skip to next RELATIONSHIP;
   
endif;

This approach worked fine but could be annoying in cases when you added new fields to the beginning of the roster. For example, if before asking the relationship you now want to ask the name, then you would have to view the logic, find all the appropriate references to relationship, and change them to name. In CSPro 5 you can write:

PROC CHILDREN_EVER_BORN

preproc

   
if not ( SEX = 2 and AGE in 15:49 ) then
       
skip to next;
   
endif;

Writing skip to next without a field name will always go to the first field of the next occurrence in a repeating group.