Call the SOR$RETURN_REC routine to release the sorted or merged records to a program. Call this routine once for each record to be returned. SOR$RETURN_REC places the record into a record buffer that you set up in the program's data area. After SORT has successfully returned all the records to the program, it returns the status code SS$_ENDOFFILE, which indicates that there are no more records to return. Some of the following condition 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.