Cancel Handler Reason Codes

The following table lists the bits that are set in the reason code. If the activation group is to be stopped, then the activation group is stopped bit is also set in the reason code. These bits must be correlated to _CNL_MASK_T in _CNL_Hndlr_Parms_T in <except.h>. Column 2 contains the macro constant defined for the cancel reason mask in <except.h>.

Table 18. Determining Canceled Invocation Reason Codes
Function Bits set in reason code Rationale
Library routines
exit _EXIT_VERB The definition of exit is normal end of processing, and therefore invocations canceled by this function is done with a reason code of normal.
abort
_ABNORMAL_TERM
_EXIT_VERB
The definition of abort is abnormal end of processing, and therefore invocations canceled by this function are done with a reason code of abnormal.
longjmp _JUMP The general use of the longjmp() function is to return from an exception handler, although it may be used in non-exception situations as well. It is used as part of the "normal" path for a program, and therefore any invocations canceled because of it are cancelled with a reason code of normal.
Unhandled function check
_ABNORMAL_TERM_
UNHANDLED_EXCP
Not handling an exception which is an abnormal situation.
System APIs
CEEMRCR
_ABNORMAL_TERM
_EXCP_SENT
This API is only used during exception processing. It is typically used to cancel invocations where a resume is not possible, or at least the behavior would be undefined if control was resumed in them. Also, these invocations have had a chance to handle the exception but did not do so. Invocations canceled by this API are done with reason code of abnormal.
QMHSNDPM /QMHRSNEM (escape messages) Message Handler APIs _ABNORMAL_TERM _EXCP_SENT All invocations down to the target invocation are canceled without any chance of handling the exception. The API topic contains information about these APIs.
i5/OS commands
Process end _ABNORMAL_TERM _PROCESS_TERM _AG_TERMINATING Any externally initiated shutdown of an activation group is considered abnormal.
RCLACTGRP _ABNORMAL_TERM _RCLRSC The default is abnormal termination. The termination could be normal if a normal/abnormal flag is added to the command.
Table 19. Common Reason Code for Cancelling Invocations
Bit Description Header File Constant <except.h>
Bits 0 Reserved
Bits 1 Invocation canceled due to sending exception message _EXCP_SENT
Bits 2-15 Reserved
Bit 16 0 - normal end of process 1 - abnormal end of process _ABNORMAL_TERM
Bit 17 Activation Group is ending. _AG_TERMINATING
Bit 18 Initiated by Reclaim Activation Group (RCLACTGRP) _RCLRSC
Bit 19 Initiated by the process end. _PROCESS_TERM
Bit 20 Initiated by an exit() function. _EXIT_VERB
Bit 21 Initiated by an unhandled function check. _UNHANDLED_EXCP
Bit 22 Invocation canceled due to a longjmp() function. _JUMP
Bit 23 Invocation canceled due to a jump because of exception processing. _JUMP_EXCP
Bits 24-31 Reserved (0)


[ Top of Page | Previous Page | Next Page | Contents | Index ]