Stopping a sort or merge operation prematurely
To stop a sort or merge operation,
move the integer 16 into the SORT-RETURN
special register.
Move 16 into the register in either of the following ways:
- Use
MOVE
in an input or output procedure.Sort or merge processing will be stopped immediately after the next
RELEASE
orRETURN
statement is performed. - Reset the register in a declarative section entered during
processing of a
USING
orGIVING
file.Sort or merge processing will be stopped immediately after the next implicit
RELEASE
orRETURN
is performed, which will occur after a record has been read from or written to theUSING
orGIVING
file.
Control then returns to the statement following the SORT
or MERGE
statement.