COBOL Manual for TNS and TNS/R Programs
Libraries and Utility Routines
HP COBOL Manual for TNS and TNS/R Programs—522555-006
13-48
COBOL85^RETURN^SORT^ERRORS and
COBOL_RETURN_SORT_ERRORS_
Usage Considerations:
•
Error Detection and Reporting
If the process calls COBOL85^RETURN^SORT^ERRORS or
COBOL_RETURN_SORT_ERRORS_ before it executes a SORT or MERGE
statement, the HP COBOL run-time library returns the appropriate values in
error-info after execution of a a RELEASE, RETURN, SORT, or MERGE
statement.
If the sort/merge routines do not detect errors during the execution of one of the
above statements, sort-code is set to 0 and the contents of the other data items
is undefined (unpredictable).
If the sort/merge routines do detect an error, the HP COBOL run-time routines
terminate execution of the sort process and return to the program with the fields of
error-info set to the values returned by the sort/merge routines. The
HP COBOL run-time routines do not produce error messages of their own (they
typically go to the home terminal), and no recovery is possible.
It is your responsibility to determine whether the operation is successful, and to
determine how to proceed. If the error happened during execution of a RELEASE
or RETURN statement, execution should proceed to the end of the input or output
procedure, at which point it continues after the SORT or MERGE statement.
If an error occurs without the process ever having made a call to
COBOL85^RETURN^SORT^ERRORS or COBOL_RETURN_SORT_ERRORS_
(or if the error-report parameter was omitted, cancelling further error reporting), the
HP COBOL run-time library processes sort errors, prints a message on the error
file (normally the home terminal) that has all of the above information, and
abnormally terminates the run unit.
•
Calling COBOL85^RETURN^SORT^ERRORS or
COBOL_RETURN_SORT_ERRORS_ From the CRE in the Guardian Environment
In the Guardian environment, a CRE HP COBOL program can call either
COBOL85^RETURN^SORT^ERRORS (the COBOL-environment routine) or
COBOL_RETURN_SORT_ERRORS_ (the equivalent CRE routine). If it calls
COBOL85^RETURN^SORT^ERRORS, it actually calls
COBOL_RETURN_SORT_ERRORS_ indirectly.