CHECK - loop

Syntax

CHECK log_exp.

Effect

If the statement CHECK is executed in a loop and log_exp is incorrect, the statement CHECK immediately terminates the current loop pass and the program continues with the next loop pass. For log_exp, you can specify any logical expression.

Note

Outside a loop, the statement CHECK exits the current processing block (see CHECK Processing Block).

Example

Termination of the loop pass using CHECK when the loop index sy-index is odd-numbered.

DATA remainder TYPE i.
DO 20 TIMES.
  remainder = sy-index MOD 2.
  CHECK remainder = 0.
  WRITE / sy-index.
ENDDO.