ENDyy (End a Structured Group)

Free-Form Syntax
ENDDO
ENDFOR
ENDIF
ENDMON
ENDSL
(END and ENDCS not allowed)
Code Factor 1 Factor 2 Result Field Indicators
END increment-value
ENDCS
ENDDO increment-value
ENDFOR
ENDIF
ENDMON
ENDSL

The ENDyy operation ends a CASxx, DO, DOU, DOW, DOUxx, DOWxx, FOR, IF, IFxx, MONITOR, or SELECT group of operations.

The ENDyy operations are listed below:

END
End a CASxx, DO, DOU, DOUxx, DOW, DOWxx, FOR, IF, IFxx, or SELECT group
ENDCS
End a CASxx group
ENDDO
End a DO, DOU, DOUxx, DOW, or DOWxx group
ENDFOR
End a FOR group
ENDIF
End an IF or IFxx group
ENDMON
End a MONITOR group
ENDSL
End a SELECT group

The increment-value operand is allowed only on an ENDyy operation that delimits a DO group. It contains the incrementing value of the DO group. It can be positive or negative, must have zero decimal positions, and can be one of: an array element, table name, data structure, field, named constant, or numeric literal. If increment-value is not specified on the ENDDO, the increment defaults to 1. If increment-value is negative, the DO group will never end.

Conditioning indicators are optional for ENDDO or ENDFOR and not allowed for ENDCS, ENDIF, ENDMON, and ENDSL.

Resulting indicators are not allowed. No operands are allowed for ENDCS, ENDIF, ENDMON, and ENDSL.

If one ENDyy form is used with a different operation group (for example, ENDIF with a structured group), an error results at compilation time.

See the CASxx, DO, DOUxx, DOWxx, FOR, IFxx, and DOU, DOW, IF, MONITOR, and SELECT operations for examples that use the ENDyy operation.

For more information, see Error-Handling Operations or Structured Programming Operations.



[ Top of Page | Previous Page | Next Page | Contents | Index ]