COBOL Manual for TNS/E Programs (H06.03+)

Libraries and Utility Routines
HP COBOL Manual for TNS/E Programs520347-003
13-29
COBOL_RETURN_SORT_ERRORS_
sd-name
is the COBOL name of a file defined in an SD entry. The specification of the
remaining parameter is applied to any subsequent SORT or MERGE statements
that refer to this file name. If a subsequent call to the same routine refers to the
same sd-name, that call resets the specifications for any subsequent SORT or
MERGE statements that refer to the same file name.
error-report
is an 01 level item with this structure:
01 error-info
02 error-message-text PIC X(64).
02 error-message-length NATIVE-2.
02 error-code.
03 file-system-code NATIVE-2.
03 input-file-index NATIVE-2.
03 sort-code NATIVE-2.
02 error-source NATIVE-2.
02 subsort-index NATIVE-2.
02 subsort-id NATIVE-2
For the meaning of these fields, see the FastSort Manual discussion of
SORTERRORSUM. The input-file-index and sort-code are partial word
fields in that section, but are full word fields in the above record. If this parameter is
omitted, any previously set error reporting is cleared.
return-code
is an identifier of a numeric data item in which an error value will be returned. The
expected values and their respective meanings are:
Usage Considerations:
Error Detection and Reporting
If the process calls 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).
Value Meaning
0 The call was correct.
1 file-name does not name a sort-merge file.
2 error-report is not the correct length.
5 Space for the options block cannot be allocated.