RPG/400 Help

ENDyy (End a Group)

*---------*---------------*-----------------*----------------*---------------*
|   CODE  |    FACTOR 1   |     FACTOR 2    |     RESULT     |  INDICATORS   |
|         |               |                 |      FIELD     |               |
*---------*---------------*-----------------*----------------*---------------*
| END     |               | Increment value |                |               |
*---------*---------------*-----------------*----------------*---------------*
| ENDCS   |               |                 |                |               |
*---------*---------------*-----------------*----------------*---------------*
| ENDDO   |               | Increment value |                |               |
*---------*---------------*-----------------*----------------*---------------*
| ENDIF   |               |                 |                |               |
*---------*---------------*-----------------*----------------*---------------*
| ENDSL   |               |                 |                |               |
*---------*---------------*-----------------*----------------*---------------*

The ENDyy operation ends a CASxx, DO, DOUxx, DOWxx, IFxx, or SELEC group of operations.

The ENDyy operations are listed below:

END
End a CASxx, DO, DOUxx, DOWxx, IFxx, or SELEC group
ENDCS
End a CASxx group
ENDDO
End a DO, DOUxx, or DOWxx group
ENDIF
End an IFxx group
ENDSL
End a SELEC group

Factor 2 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 no decimal positions, and can be one of: an array element, table name, data structure, field, named constant, or numeric literal. If factor 2 is not specified on the ENDDO, the increment defaults to 1.

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

Resulting indicators are not allowed. Factor 1, factor 2, and the result field must all be blank for ENDCS, ENDIF,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, IFxx, and SELEC operations for examples that use the ENDyy operation.


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