statement executes one or more statements repeatedly within a loop for each occurrence of a multiply occurring group. The multiple_occurring_group
can be a form, roster, record, item, relation, or even a dictionary (following a selcase
function call). The multiply occurring group controls how many times the for
loop is executed.
The numeric variable counter contains the number of the current occurrence being examined. It cannot be changed inside the loop, but it can be referenced. Its starting value is 1 and its ending value is determined by the number of occurrences of the group.
If the group name is a record, item, or relation, then the appropriate keyword record
, or relation
must be used before the name.
statement should be coded outside of the group it references. In the example below, note that the code is executed in PROC QUEST
. It should not be located in PROC PERSON_REC_EDT
or in a procedure for any of the data items within the person record.