The RETURN
statement controls when data is sent to the internal COBOL sort algorithm writer, as part of an OUTPUT PROCEDURE
. Post sort data can be transformed under programmer control before being returned and written to the output file by the sort algorithm.