Interpreting the status-code returned by CBL_COPY_FILE
Using CBL_COPY_FILE returning status-code. 0 = successful non-0 = not successful
Is there a way to interpret the value of status-code to determine the reason for the failure similar to the file status and extended file status?
Actually, the value returned for status-code if used or in the RETURN-CODE special register is a file status code.
You can check the success of the call by examining RETURN-CODE.
Interpreting the return code as a file status code If any of the routines
fails, the RETURN-CODE register contains a file status value indicating the failure.
This file status is always the standard ANSI'74 file status value.
If no ANSI'74 file status is defined for the error, an extended file status is returned (9/nnn where nnn is the run-time system error number).
You should, therefore, use RETURN-CODE and not a RETURNING clause.
If RETURN-CODE is non-zero after calling one of these routines, you must process it as a file status, for example:
01 file-status pic xx comp-x.
01 redefines file-status.
03 fs-byte-1 pic x.
03 fs-byte-2 cblt-x1-compx . . .
call "CBL_xxx_xxx" using parameters
if return-code not = 0
move return-code to file-status
. . . At this point fs-byte-1 contains "9" and fs-byte-2 contains the run-time system error number.