MXLOOPS Subcommand (SET command)
MXLOOPS
specifies
the maximum number of times that a loop that is defined by the LOOP-END LOOP
structure is executed for
a single case or input record. The default is 40.
-
MXLOOPS
prevents infinite loops, which may occur if no cutoff is specified for the loop structure (seeLOOP-END LOOP
). -
MXLOOPS
will limit the number of loops for any loop structure that doesn't have an indexing clause, including loops with conditionalIF
clauses. If a loop has an indexing clause (e.g.,LOOP #i=1 to 1000
), the indexing clause overrides theMXLOOPS
setting. - When a loop is terminated, control passes to the
command immediately following the
END LOOP
command, even if theEND LOOP
condition is not yet met.