CBL_GET_EXIT_INFO

Enables an application to determine under what circumstances an exit procedure has been invoked.

Syntax:

call "CBL_GET_EXIT_INFO" using     param-block
                         returning status-code

Parameters

param-block
Group predefined as cblt-exit-info-params containing
01 cblt-exit-info-params    typedef.
  03 cblte-gei-size         cblt-x4-comp5. 	*> pic x(4) comp-5 value 16.
  03 cblte-gei-return-code  cblt-x4-comp5. 	*> pic x(4) comp-5.
  03 cblte-gei-rts-error    cblt-x4-comp5. 	*> pic x(4) comp-5.
  03 cblte-gei-exit-flags   cblt-x4-comp5. 	*> pic x(4) comp-5.


status-code
See Library Routines - Key.

On Entry:

cblte-gei-size
The size of parameter block including this field (must be set to 16).

On Exit:

cblte-gei-return-code
Current value of RETURN-CODE.
cblte-gei-rts-error
Error number of the run-time system error that caused termination (zero if none).
cblte-gei-exit-flags
A 32-bit word providing additional termination information:
Bit 0
0 Not running under Debugger
1 Running under Debugger
Bit 1
Escaped from Debugger
Bit 2
Terminated due to normal run-time system termination, such as a STOP RUN, when all COBOL threads terminate or return, or when the cobexit() or cobtidy() routines are called.
Bit 3
Not used
Bit 4
Terminated due to abnormal run-time system termination, which does not produce an RTS error, such as when the interrupt key is pressed (for example, CTRL+C) or the CBL_ABORT_RUN_UNIT routine is called.
Bit 5
Not used
Bit 6
Terminated by the operating system, such as when the exit() routine is called.
Bits 7-31
Reserved for future use - set to 0
status-code
0 Success.
1006 API called from outside of exit procedure.
1009 Invalid parameter passed to API.

Comments:

This routine must only be called from within an exit procedure that has been installed using CBL_EXIT_PROC.

A typical use of this routine would be in database applications which need to be able to determine under what circumstances an exit procedure has been invoked. Database applications would typically need to be able to determine whether the exit procedure had been invoked due to a normal or abnormal run-time system termination. This routine would enable them to decide whether to commit or rollback.