Reason codes
The reason code parameter (REASON) is a qualification to the completion code parameter (CMPCOD).
If there is no special reason to report, RCNONE is returned. A successful call returns CCOK and RCNONE.
If the completion code is either CCWARN or CCFAIL, the queue manager always reports a qualifying reason; details are given under each call description.
Where user exit routines set completion codes and reasons, they should adhere to these rules. In addition, any special reason values defined by user exits should be less than zero, to ensure that they do not conflict with values defined by the queue manager. Exits can set reasons already defined by the queue manager, where these are appropriate.
Reason codes also occur in:
- The DLREA field of the MQDLH structure
- The MDFB field of the MQMD structure
The following is a list of reason codes, in alphabetic order, with more detail than is given in the call descriptions.
RCNONE(0)Explanation:The call completed normally. The completion code (CMPCOD) is CCOK.
Completion Code:CCOK
Programmer Response:None.
RC0900(900)Explanation:This is the lowest value for an application-defined reason code returned by a data-conversion exit. Data-conversion exits can return reason codes in the range RC0900 through RC0999 to indicate particular conditions that the exit has detected.
Completion Code:CCWARN or CCFAIL
Programmer Response:As defined by the writer of the data-conversion exit.
RC0999(999)Explanation:This is the highest value for an application-defined reason code returned by a data-conversion exit. Data-conversion exits can return reason codes in the range RC0900 through RC0999 to indicate particular conditions that the exit has detected.
Completion Code:CCWARN or CCFAIL
Programmer Response:As defined by the writer of the data-conversion exit.
RC2001(2001)Explanation:An MQOPEN or MQPUT1 call was issued specifying an alias queue as the destination, but the BaseQName in the alias queue definition resolves to a queue that is not a local queue, a local definition of a remote queue, or a cluster queue.
Completion Code:CCFAIL
Programmer Response:Correct the queue definitions.
RC2002(2002)Explanation:An MQCONN or MQCONNX call was issued, but the application is already connected to the queue manager.
Completion Code:CCWARN
Programmer Response:None. The HCONN parameter returned has the same value as was returned for the previous MQCONN or MQCONNX call.
An MQCONN or MQCONNX call that returns this reason code does not mean that an additional MQDISC call must be issued in order to disconnect from the queue manager. If this reason code is returned because the application has been called in a situation where the connect has already been done, a corresponding MQDISC should not be issued, because this will cause the application that issued the original MQCONN or MQCONNX call to be disconnected as well.
RC2003(2003)Explanation:The current unit of work encountered a fatal error or was backed out. This occurs in the following cases:
- On an MQCMIT or MQDISC call, when the commit operation has failed and the unit of work has been backed out. All resources that participated in the unit of work have been returned to their state at the start of the unit of work. The MQCMIT or MQDISC call completes with CCWARN in this case.
- On an MQGET, MQPUT, or MQPUT1 call that is operating within a unit of work, when the unit of work has already encountered an error that prevents the unit of work being committed (for example, when the log space is exhausted). The application must issue the appropriate call to back out the unit of work. (For a unit of work coordinated by the queue manager, this call is the MQBACK call, although the MQCMIT call has the same effect in these circumstances.) The MQGET, MQPUT, or MQPUT1 call completes with CCFAIL in this case.
Completion Code:CCWARN or CCFAIL
Programmer Response:Check the returns from previous calls to the queue manager. For example, a previous MQPUT call may have failed.
RC2004(2004)Explanation:The BUFFER parameter is not valid for one of the following reasons:
- The parameter pointer is not valid. (It is not always possible to detect parameter pointers that are not valid; if not detected, unpredictable results occur.)
- The parameter pointer points to storage that cannot be accessed for the entire length specified by BUFLEN.
- For calls where BUFFER is an output parameter: the parameter pointer points to read-only storage.
Completion Code:CCFAIL
Programmer Response:Correct the parameter.
RC2005(2005)Explanation:The BUFLEN parameter is not valid, or the parameter pointer is not valid. (It is not always possible to detect parameter pointers that are not valid; if not detected, unpredictable results occur.)
This reason can also be returned to an MQ client program on the MQCONN or MQCONNX call if the negotiated maximum message size for the channel is smaller than the fixed part of any call structure.
Completion Code:CCFAIL
Programmer Response:Specify a value that is zero or greater. For the mqAddString and mqSetString calls, the special value MQBL_NULL_TERMINATED is also valid.
RC2006(2006)Explanation:CALEN is negative (for MQINQ or MQSET calls), or is not large enough to hold all selected attributes (MQSET calls only). This reason also occurs if the parameter pointer is not valid. (It is not always possible to detect parameter pointers that are not valid; if not detected, unpredictable results occur.)
Completion Code:CCFAIL
Programmer Response:Specify a value large enough to hold the concatenated strings for all selected attributes.
RC2007(2007)Explanation:CHRATR is not valid. The parameter pointer is not valid, or points to read-only storage for MQINQ calls or to storage that is not as long as implied by CALEN. (It is not always possible to detect parameter pointers that are not valid; if not detected, unpredictable results occur.)
Completion Code:CCFAIL
Programmer Response:Correct the parameter.
RC2008(2008)Explanation:For MQINQ calls, CALEN is not large enough to contain all of the character attributes for which CA* selectors are specified in the SELS parameter.
The call still completes, with the CHRATR parameter string filled in with as many character attributes as there is room for. Only complete attribute strings are returned: if there is insufficient space remaining to accommodate an attribute in its entirety, that attribute and subsequent character attributes are omitted. Any space at the end of the string not used to hold an attribute is unchanged.
An attribute that represents a set of values (for example, the namelist Names attribute) is treated as a single entity--either all of its values are returned, or none.
Completion Code:CCWARN
Programmer Response:Specify a large enough value, unless only a subset of the values is needed.
RC2009(2009)Explanation:Connection to the queue manager has been lost. This can occur because the queue manager has ended. If the call is an MQGET call with the GMWT option, the wait has been canceled. All connection and object handles are now invalid.
For MQ client applications, it is possible that the call did complete successfully, even though this reason code is returned with a CMPCOD of CCFAIL.
Completion Code:CCFAIL
Programmer Response:Applications can attempt to reconnect to the queue manager by issuing the MQCONN or MQCONNX call. It may be necessary to poll until a successful response is received.
Any uncommitted changes in a unit of work should be backed out. A unit of work that is coordinated by the queue manager is backed out automatically.
RC2010(2010)Explanation:The DATLEN parameter is not valid. Either the parameter pointer is not valid, or it points to read-only storage. (It is not always possible to detect parameter pointers that are not valid; if not detected, unpredictable results occur.)
This reason code can also be returned to an MQ client program on the MQGET, MQPUT, or MQPUT1 call, if the BUFLEN parameter exceeds the maximum message size that was negotiated for the client channel.
Completion Code:CCFAIL
Programmer Response:Correct the parameter.
If the error occurs for an MQ client program, also check that the maximum message size for the channel is big enough to accommodate the message being sent; if it is not big enough, increase the maximum message size for the channel.
RC2011(2011)Explanation:On the MQOPEN call, a model queue is specified in the ODON field of the OBJDSC parameter, but the ODDN field is not valid, for one of the following reasons:
- ODDN is completely blank (or blank up to the first null character in the field).
- Characters are present that are not valid for a queue name.
- An asterisk is present beyond the 33rd position (and before any null character).
- An asterisk is present followed by characters that are not null and not blank.
This reason code can also sometimes occur when a server application opens the reply queue specified by the MDRQ and MDRM fields in the MQMD of a message that the server has just received. In this case the reason code indicates that the application that sent the original message placed incorrect values into the MDRQ and MDRM fields in the MQMD of the original message.
Completion Code:CCFAIL
Programmer Response:Specify a valid name.
RC2012(2012)Explanation:The call is not valid for the current environment.
- On i5/OS, one of the following applies:
- The application is linked to the wrong libraries (threaded or nonthreaded).
- An MQCMIT or MQBACK call was issued, but an external unit-of-work manager is in use. This reason code also occurs if the queue manager does not support units of work.
Completion Code:CCFAIL
Programmer Response:Do one of the following (as appropriate):
- Link the application with the correct libraries (threaded or nonthreaded).
- Remove from the application the call that is not supported.
RC2013(2013)Explanation:On an MQPUT or MQPUT1 call, the value specified for the MDEXP field in the message descriptor MQMD is not valid.
Completion Code:CCFAIL
Programmer Response:Specify a value that is greater than zero, or the special value EIULIM.
RC2014(2014)Explanation:On an MQPUT or MQPUT1 call, the value specified for the MDFB field in the message descriptor MQMD is not valid. The value is not FBNONE, and is outside both the range defined for system feedback codes and the range defined for application feedback codes.
Completion Code:CCFAIL
Programmer Response:Specify FBNONE, or a value in the range FBSFST through FBSLST, or FBAFST through FBALST.
RC2016(2016)Explanation:MQGET calls are currently inhibited for the queue, or for the queue to which this queue resolves. See the InhibitGet queue attribute described in Attributes for queues.
Completion Code:CCFAIL
Programmer Response:If the system design allows get requests to be inhibited for short periods, retry the operation later.
RC2017(2017)Explanation:An MQOPEN or MQPUT1 call was issued, but the maximum number of open handles allowed for the current task has already been reached. Be aware that when a distribution list is specified on the MQOPEN or MQPUT1 call, each queue in the distribution list uses one handle.
Completion Code:CCFAIL
Programmer Response:Check whether the application is issuing MQOPEN calls without corresponding MQCLOSE calls. If it is, modify the application to issue the MQCLOSE call for each open object as soon as that object is no longer needed.
Also check whether the application is specifying a distribution list containing a large number of queues that are consuming all of the available handles. If it is, increase the maximum number of handles that the task can use, or reduce the size of the distribution list. The maximum number of open handles that a task can use is given by the MaxHandles queue manager attribute (see Attributes for the queue manager).
RC2018(2018)Explanation:The connection handle HCONN is not valid, for one of the following reasons:
- The parameter pointer is not valid, or (for the MQCONN or MQCONNX call) points to read-only storage. (It is not always possible to detect parameter pointers that are not valid; if not detected, unpredictable results occur.)
- The value specified was not returned by a preceding MQCONN or MQCONNX call.
- The value specified has been made invalid by a preceding MQDISC call.
- The handle is a shared handle that has been made invalid by another thread issuing the MQDISC call.
- The handle is a shared handle that is being used on the MQBEGIN call (only nonshared handles are valid on MQBEGIN).
- The handle is a nonshared handle that is being used a thread that did not create the handle.
- The call was issued in the MTS environment in a situation where the handle is not valid (for example, passing the handle between processes or packages; note that passing the handle between library packages is supported).
Completion Code:CCFAIL
Programmer Response:Ensure that a successful MQCONN or MQCONNX call is performed for the queue manager, and that an MQDISC call has not already been performed for it. Ensure that the handle is being used within its valid scope (see MQCONN - Connect queue manager).
RC2019(2019)Explanation:The object handle HOBJ is not valid, for one of the following reasons:
- The parameter pointer is not valid, or (for the MQOPEN call) points to read-only storage. (It is not always possible to detect parameter pointers that are not valid; if not detected, unpredictable results occur.)
- The value specified was not returned by a preceding MQOPEN call.
- The value specified has been made invalid by a preceding MQCLOSE call.
- The handle is a shared handle that has been made invalid by another thread issuing the MQCLOSE call.
- The handle is a nonshared handle that is being used a thread that did not create the handle.
- The call is MQGET or MQPUT, but the object represented by the handle is not a queue.
Completion Code:CCFAIL
Programmer Response:Ensure that a successful MQOPEN call is performed for this object, and that an MQCLOSE call has not already been performed for it. Ensure that the handle is being used within its valid scope (see MQOPEN - Open object).
RC2020(2020)Explanation:On an MQSET call, the value specified for either the IAIGET attribute or the IAIPUT attribute is not valid.
Completion Code:CCFAIL
Programmer Response:Specify a valid value. See the InhibitGet or InhibitPut attribute described in Attributes for queues.
RC2021(2021)Explanation:On an MQINQ or MQSET call, the IACNT parameter is negative (MQINQ or MQSET), or smaller than the number of integer attribute selectors (IA*) specified in the SELS parameter (MQSET only). This reason also occurs if the parameter pointer is not valid. (It is not always possible to detect parameter pointers that are not valid; if not detected, unpredictable results occur.)
Completion Code:CCFAIL
Programmer Response:Specify a value large enough for all selected integer attributes.
RC2022(2022)Explanation:On an MQINQ call, the IACNT parameter is smaller than the number of integer attribute selectors (IA*) specified in the SELS parameter.
The call completes with CCWARN, with the INTATR array filled in with as many integer attributes as there is room for.
Completion Code:CCWARN
Programmer Response:Specify a large enough value, unless only a subset of the values is needed.
RC2023(2023)Explanation:On an MQINQ or MQSET call, the INTATR parameter is not valid. The parameter pointer is not valid (MQINQ and MQSET), or points to read-only storage or to storage that is not as long as indicated by the IACNT parameter (MQINQ only). (It is not always possible to detect parameter pointers that are not valid; if not detected, unpredictable results occur.)
Completion Code:CCFAIL
Programmer Response:Correct the parameter.
RC2024(2024)Explanation:An MQGET, MQPUT, or MQPUT1 call failed because it would have caused the number of uncommitted messages in the current unit of work to exceed the limit defined for the queue manager (see the MaxUncommittedMsgs queue manager attribute). The number of uncommitted messages is the sum of the following since the start of the current unit of work:
- Messages put by the application with the PMSYP option
- Messages retrieved by the application with the GMSYP option
- Trigger messages and COA report messages generated by the queue manager for messages put with the PMSYP option
- COD report messages generated by the queue manager for messages retrieved with the GMSYP option
Completion Code:CCFAIL
Programmer Response:Check whether the application is looping. If it is not, consider reducing the complexity of the application. Alternatively, increase the queue manager limit for the maximum number of uncommitted messages within a unit of work.
- On i5/OS, the limit for the maximum number of uncommitted messages can be changed by using the CHGMQM command.
RC2025(2025)Explanation:The MQCONN or MQCONNX call was rejected because the maximum number of concurrent connections has been exceeded.
- On i5/OS, this reason code can also occur on the MQOPEN call.
Completion Code:CCFAIL
Programmer Response:Either increase the size of the appropriate install parameter value, or reduce the number of concurrent connections.
RC2026(2026)Explanation:The MQMD structure is not valid, for one of the following reasons:
- The MDSID field is not MDSIDV.
- The MDVER field specifies a value that is not valid or not supported.
- The parameter pointer is not valid. (It is not always possible to detect parameter pointers that are not valid; if not detected, unpredictable results occur.)
- The queue manager cannot copy the changed structure to application storage, even though the call is successful. This can occur, for example, if the pointer points to read-only storage.
Completion Code:CCFAIL
Programmer Response:Ensure that input fields in the MQMD structure are set correctly.
RC2027(2027)Explanation:On an MQPUT or MQPUT1 call, the MDRQ field in the message descriptor MQMD is blank, but one or both of the following is true:
- A reply was requested (that is, MTRQST was specified in the MDMT field of the message descriptor).
- A report message was requested in the MDREP field of the message descriptor.
Completion Code:CCFAIL
Programmer Response:Specify the name of the queue to which the reply message or report message is to be sent.
RC2029(2029)Explanation:On an MQPUT or MQPUT1 call, the value specified for the MDMT field in the message descriptor (MQMD) is not valid.
Completion Code:CCFAIL
Programmer Response:Specify a valid value. See the MDMT field described in MQMD - Message descriptor for details.
RC2030(2030)Explanation:An MQPUT or MQPUT1 call was issued to put a message on a queue, but the message was too long for the queue and MFSEGA was not specified in the MDMFL field in MQMD. If segmentation is not allowed, the length of the message cannot exceed the lesser of the queue MaxMsgLength attribute and queue manager MaxMsgLength attribute.
This reason code can also occur when MFSEGA is specified, but the nature of the data present in the message prevents the queue manager splitting it into segments that are small enough to place on the queue:
- For a user-defined format, the smallest segment that the queue manager can create is 16 bytes.
- For a built-in format, the smallest segment that the queue manager can create depends on the particular format, but is greater than 16 bytes in all cases other than FMSTR (for FMSTR the minimum segment size is 16 bytes).
RC2030 can also occur in the MDFB field in the message descriptor of a report message; in this case it indicates that the error was encountered by a message channel agent when it attempted to put the message on a remote queue.
Completion Code:CCFAIL
Programmer Response:Check whether the BUFLEN parameter is specified correctly; if it is, do one of the following:
- Increase the value of the queue's MaxMsgLength attribute; the queue manager's MaxMsgLength attribute may also need increasing.
- Break the message into several smaller messages.
- Specify MFSEGA in the MDMFL field in MQMD; this will allow the queue manager to break the message into segments.
RC2031(2031)Explanation:An MQPUT or MQPUT1 call was issued to put a message on a queue, but the message was too long for the queue manager and MFSEGA was not specified in the MDMFL field in MQMD. If segmentation is not allowed, the length of the message cannot exceed the lesser of the queue manager MaxMsgLength attribute and queue MaxMsgLength attribute.
This reason code can also occur when MFSEGA is specified, but the nature of the data present in the message prevents the queue manager splitting it into segments that are small enough for the queue manager limit:
- For a user-defined format, the smallest segment that the queue manager can create is 16 bytes.
- For a built-in format, the smallest segment that the queue manager can create depends on the particular format, but is greater than 16 bytes in all cases other than FMSTR (for FMSTR the minimum segment size is 16 bytes).
RC2031 can also occur in the MDFB field in the message descriptor of a report message; in this case it indicates that the error was encountered by a message channel agent when it attempted to put the message on a remote queue.
This reason also occurs if a channel, through which the message is to pass, has restricted the maximum message length to a value that is actually less than that supported by the queue manager, and the message length is greater than this value.
Completion Code:CCFAIL
Programmer Response:Check whether the BUFLEN parameter is specified correctly; if it is, do one of the following:
- Increase the value of the queue manager's MaxMsgLength attribute; the queue's MaxMsgLength attribute may also need increasing.
- Break the message into several smaller messages.
- Specify MFSEGA in the MDMFL field in MQMD; this will allow the queue manager to break the message into segments.
- Check the channel definitions.
RC2033(2033)Explanation:An MQGET call was issued, but there is no message on the queue satisfying the selection criteria specified in MQMD (the MDMID and MDCID fields), and in MQGMO (the GMOPT and GMMO fields). Either the GMWT option was not specified, or the time interval specified by the GMWI field in MQGMO has expired. This reason is also returned for an MQGET call for browse, when the end of the queue has been reached.
This reason code can also be returned by the mqGetBag and mqExecute calls. mqGetBag is similar to MQGET. For the mqExecute call, the completion code can be either MQCC_WARNING or MQCC_FAILED:
- If the completion code is MQCC_WARNING, some response messages were received during the specified wait interval, but not all. The response bag contains system-generated nested bags for the messages that were received.
- If the completion code is MQCC_FAILED, no response messages were received during the specified wait interval.
Completion Code:CCWARN or CCFAIL
Programmer Response:If this is an expected condition, no corrective action is required.
If this is an unexpected condition, check that:
- The message was put on the queue successfully.
- The unit of work (if any) used for the MQPUT or MQPUT1 call was committed successfully.
- The options controlling the selection criteria are specified correctly. All of the following can affect the eligibility of a message for return on the MQGET call:
- GMLOGO
- GMAMSA
- GMASGA
- GMCMPM
- MOMSGI
- MOCORI
- MOGRPI
- MOSEQN
- MOOFFS
- Value of MDMID field in MQMD
- Value of MDCID field in MQMD
Consider waiting longer for the message.
RC2034(2034)Explanation:An MQGET call was issued with either the GMMUC or the GMBRWC option. However, the browse cursor is not positioned at a retrievable message. This is caused by one of the following:
- The cursor is positioned logically before the first message (as it is before the first MQGET call with a browse option has been successfully performed).
- The message the browse cursor was positioned on has been locked or removed from the queue (probably by some other application) since the browse operation was performed.
- The message the browse cursor was positioned on has expired.
Completion Code:CCFAIL
Programmer Response:Check the application logic. This may be an expected reason if the application design allows multiple servers to compete for messages after browsing. Consider also using the GMLK option with the preceding browse MQGET call.
RC2035(2035)Explanation:The user is not authorized to perform the operation attempted:
- On an MQCONN or MQCONNX call, the user is not authorized to connect to the queue manager.
- On an MQOPEN or MQPUT1 call, the user is not authorized to open the object for the option(s) specified.
- On an MQCLOSE call, the user is not authorized to delete the object, which is a permanent dynamic queue, and the HOBJ parameter specified on the MQCLOSE call is not the handle returned by the MQOPEN call that created the queue.
This reason code can also occur in the MDFB field in the message descriptor of a report message; in this case it indicates that the error was encountered by a message channel agent when it attempted to put the message on a remote queue.
Completion Code:CCFAIL
Programmer Response:Ensure that the correct queue manager or object was specified, and that appropriate authority exists.
RC2036(2036)Explanation:An MQGET call was issued with one of the following options:
- GMBRWF
- GMBRWN
- GMBRWC
- GMMUC
but the queue had not been opened for browse.
Completion Code:CCFAIL
Programmer Response:Specify OOBRW when the queue is opened.
RC2037(2037)Explanation:An MQGET call was issued to retrieve a message from a queue, but the queue had not been opened for input.
Completion Code:CCFAIL
Programmer Response:Specify one of the following when the queue is opened:
- OOINPS
- OOINPX
- OOINPQ
RC2038(2038)Explanation:An MQINQ call was issued to inquire object attributes, but the object had not been opened for inquire.
Completion Code:CCFAIL
Programmer Response:Specify OOINQ when the object is opened.
RC2039(2039)Explanation:An MQPUT call was issued to put a message on a queue, but the queue had not been opened for output.
Completion Code:CCFAIL
Programmer Response:Specify OOOUT when the queue is opened.
RC2040(2040)Explanation:An MQSET call was issued to set queue attributes, but the queue had not been opened for set.
Completion Code:CCFAIL
Programmer Response:Specify OOSET when the object is opened.
RC2041(2041)Explanation:Object definitions that affect this object have been changed since the HOBJ handle used on this call was returned by the MQOPEN call. See MQOPEN - Open object for more information.
This reason does not occur if the object handle is specified in the PMCT field of the PMO parameter on the MQPUT or MQPUT1 call.
Completion Code:CCFAIL
Programmer Response:Issue an MQCLOSE call to return the handle to the system. It is then usually sufficient to reopen the object and retry the operation. However, if the object definitions are critical to the application logic, an MQINQ call can be used after reopening the object, to obtain the new values of the object attributes.
RC2042(2042)Explanation:An MQOPEN call was issued, but the object in question has already been opened by this or another application with options that conflict with those specified in the OPTS parameter. This arises if the request is for shared input, but the object is already open for exclusive input; it also arises if the request is for exclusive input, but the object is already open for input (of any sort).
MCAs for receiver channels, or the intra-group queuing agent (IGQ agent), may keep the destination queues open even when messages are not being transmitted; this results in the queues appearing to be "in use". Use the MQSC command DISPLAY QSTATUS to find out who is keeping the queue open.
Completion Code:CCFAIL
Programmer Response: