Understanding return codes

 

A completion code and a reason code are returned as output parameters by each call. These are known collectively as return codes.

To show whether or not a call is successful, each call returns a completion code when the call is complete. The completion code is usually either MQCC_OK or MQCC_FAILED, showing success and failure, respectively. Some calls can return an intermediate state, MQCC_WARNING, indicating partial success.

Each call also returns a reason code that shows the reason for the failure, or partial success, of the call. There are many reason codes, covering such circumstances as a queue being full, get operations not being allowed for a queue, and a particular queue not being defined for the queue manager. Programs can use the reason code to decide how to proceed. For example, they can prompt users to change their input data, then make the call again, or they can return an error message to the user.

When the completion code is MQCC_OK, the reason code is always MQRC_NONE.

The completion and reason codes for each call are listed with the description of that call in Application Programming Reference. For more detailed information, including ideas for corrective action, see:

 

Parent topic:

Parameters common to all the calls


fg11610_