After you have passed either the file names or the records to
SORT, call the SOR$SORT_MERGE routine to sort the records. For
file interface on input, the input files are opened and the
records are released to the sort. For the record interface on
input, the record must have already been released (by calls
to SOR$RELEASE_REC). For file interface on output, the output
records are reformatted and directed to the output file. For the
record interface on output, SOR$RETURN_REC must be called to get
the sorted records.
Some of the return values are used with different severities
depending on whether SORT/MERGE can recover. Thus, if you want to
check for a specific status, you should use LIB$MATCH_COND.