DO n... (EXIT)... ENDDO loops 

To repeat CATT functions, you can put them in a loop.

Enter the DO function in the Funct. field, and the desired number of loop iterations in the Object field in the function maintenance screen. You can enter a number between 1 and 999.

Enter the CATT functions which are to be repeated.

End the loop with ENDDO.

The special variable &LPC contains the current loop counter.

DO 5

REF K1100001

ENDDO

The test module K1100001 runs five times.

You can nest DO...ENDDO loops and IF…ENDIF blocks.

EXIT

If a loop is to be conditionally ended, you can enter the EXIT <condition> function between DO and ENDDO (see EXIT - Conditional termination). The condition is checked in each loop iteration. If the condition is satisfied, the loop is immediately ended, and the statement after ENDDO is executed.
This makes loop constructs very flexible.