ReasonCode property

Read-only. Returns the reason code set by the most recent method or property set issued against any WebSphere MQ object.

An error event handler can inspect this property to diagnose the error, without having to know which object was involved.

Using the CompletionCode and ReasonCode in the MQSession object is very convenient for simple error handlers.

Note:
See Threading for restrictions on the use of MQSession error codes in threaded applications.

Defined in: MQSession class

Data Type: Long

Values:

  • See the WebSphere MQ Application Programming Reference and the additional MQAX values listed under Reason codes

Syntax:
To get: reasoncode& = MQSession.ReasonCode