REXX has many ways to implement loops using the keywords DO and END. DO indicates the start of the loop, and is placed before the first instruction in the loop. END indicates the end of the loop, and is placed after the last instruction in the loop.

If you use the SIGNAL instruction within a loop, be sure to read the potential problem with SIGNAL inside a loop.