A number of macros help to access the exception block:
- SET_EXCEPT_BLOCK
- Sets the return and reason codes to specific values, for exampe:
MQeExceptBlock exceptBlock;
SET_EXCEPT_BLOCK(&exceptBlock,
MQERETURN_OK,
MQEREASON_NA);
- SET_EXCEPT_BLOCK_TO_DEFAULT
- Sets return and reason codes to non-error values, for example:
MQeExceptBlock exceptBlock;
SET_EXCEPT_BLOCK_TO_DEFAULT(&exceptBlock);
- EC
- Accesses the return code, for example:
MQeExceptBlock exceptBlk;
/*MQe API call */
MQERETURN returncode;
returnCode = EC(&exceptBlock);
- ERC
- Accesses the reason code, for example:
MQeExceptBlock exceptBlk;
/*MQe API call*/
MQEREASON reasoncode;
MQEREASON reasonCode = ERC(&exceptBlock);
- NEW_EXCEPT_BLOCK
- Can create a temporary exception block. This is useful for temporary clean-up
operations.