The Perform iteration directive is used to cause the JSM_BINDSCRIPT activity to perform an iteration.  This causes the Processing Sequence directives nested beneath the JSM_BINDSCRIPT activity (if any) to be executed.  This affords the Processing Sequence an opportunity to:

Line label

You can assign a label to this JSM binding script line that can be used to branch to this line:

- from a Branch to label directive, or

- from the On OK, On error or On nil result actions of another directive, or

- as a result of the Processing Sequence setting the value of the ITERATIONBRANCHTO parameter of the JSM_BINDSCRIPT activity during iteration processing.

More importantly, however, the label specified on the Perform iteration directive is available to the Processing Sequence through the ITERATIONLABEL parameter of the JSM_BINDSCRIPT activity.  This permits the Processing Sequence to perform different actions for each Perform iteration directive, if more than one is specified.

If you specify a line label, it should be unique within this JSM binding script.

On nil

This value determines the next JSM binding script line that will be executed following the iteration, if the Processing Sequence sets the ITERATIONPROCEED parameter value to 'N' (no), when further iterations are not required.

You may specify one of the following special values:
   *END indicates that the JSM binding script ends

   *NEXT indicates that the JSM binding script continues with the next line

   *ERROR indicates that the JSM binding script ends in error

Otherwise, you must specify the Line label of another line to which the JSM binding script will branch.

If the Processing Sequence does not set the ITERATIONPROCEED parameter value, then, by default, the JSM Binding Script execution continues with the next line.

However the Processing Sequence can set the ITERATIONBRANCHTO parameter value to specify the Line label of another line to which the JSM binding script will branch.

Refer to the description of the JSM_BINDSCRIPT activity for more information on the use of the ITERATIONPROCEED and ITERATIONBRANCHTO parameters in connection with iteration processing.

The following illustrates a portion of the example Processing Sequence EXAMPLE_JSONRW that handles iterations triggered by the Perform iteration directive and takes different actions according to the value of the ITERATIONLABEL parameter: