Slightly quirky syntax, but I believe that if you do:
move 16 to sort-return
...before exiting the input/output procedure, it will cause the sort to terminate immediately.
The SORT-RETURN special register was added to Micro Focus COBOL for IBM compatibility.