call "CBL_GET_ERROR_INFO" using by value flags by reference symbol-info by reference module-info by reference file-info returning status-code.
01 flags cblt-os-flags.
01 symbol-info 03 symbol-offset cblt-os-size. 03 symbol-name-size cblt-os-size. 03 symbol-name cblt-x1. *> pic x(n) occurs n times *> depending on symbol-name-size.
01 module-info 03 module-offset cblt-os-size. 03 module-name-size cblt-os-size. 03 module-name cblt-x1. *> pic x(n) occurs n times *> depending on module-name-size.
01 file-info 03 line-number cblt-os-size. 03 file-name-size cblt-os-size. 03 file-name cblt-x1. *> pic x(n) occurs n times *> depending on file-name-size.
Size n of the file-name pic x(n) provided. If this is too small for the information being returned, the routine fails.
If CBL_GET_ERROR_INFO fails because on entry symbol-name-size specified a buffer that was too small, symbol-name-size will be set to the minimum buffer size that was required.
If CBL_GET_ERROR_INFO fails because on entry module-name-size specified a buffer that was too small, module-name-size will be set to the minimum buffer size that was required.
If CBL_GET_ERROR_INFO fails because on entry file-name-size specified a buffer that was too small, file-name-size will be set to the minimum buffer size that was required.
Value | Status |
---|---|
0 | Success |
1006 | Routine unsupported on this platform or environment. |
1011 | No fault or error was active when the routine was called. |
1017 | Buffer too small for information to be returned. |
In the typical scenario, CBL_GET_ERROR_INFO is used in an error proc or a synchronous signal handler and provides information about the location of the last fault or error.
CBL_GET_ERROR_INFO offers similar functionality to the CEE3GRN and CEE3GRO routines, and is expected to be used in similar circumstances. Similarly to these two mainframe calls, when an error occurs, and CBL_GET_ERROR_INFO is subsequently called, it provides, for the location of the error, the symbol name and the offset from the symbol start. Additionally, CBL_GET_ERROR_INFO provides the name of the module, the file name and line number. This additional information makes it easier to identify the location of a fault/error.
CBL_GET_ERROR_INFO cannot be called from an exit proc.
CBL_GET_ERROR_INFO does not provide information about asynchronous signals.
Some information may not be available in all circumstances; for example, file name and line number information is only available if a program was compiled for debug.