Useful macros

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;
	/*WebSphere MQ Everyplace API call */
	MQERETURN returncode;
	returnCode = EC(&exceptBlock);

ERC
Accesses the reason code, for example:
	MQeExceptBlock exceptBlk;
	/*WebSphere MQ Everyplace 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, for example:



© IBM Corporation 2002. All Rights Reserved