Conversion processing

The queue manager performs the following actions if the GMCONV option is specified on the MQGET call, and there is a message to be returned to the application:

  1. If one or more of the following is true, no conversion is necessary: In these cases the message is returned without conversion to the application issuing the MQGET call; the MDCSI and MDENC values in the MSGDSC parameter are set to the values in the control information in the message, and the call completes with one of the following combinations of completion code and reason code:
    Completion code
    Reason code
    CCOK
    RCNONE
    CCWARN
    RC2079
    CCWARN
    RC2080

The following steps are performed only if the character set or encoding of the message data differs from the corresponding value in the MSGDSC parameter, and there is data to be converted:

  1. If the MDFMT field in the control information in the message has the value FMNONE, the message is returned unconverted, with completion code CCWARN and reason code RC2110.

    In all other cases conversion processing continues.

  2. The message is removed from the queue and placed in a temporary buffer which is the same size as the BUFFER parameter. For browse operations, the message is copied into the temporary buffer, instead of being removed from the queue.
  3. If the message has to be truncated to fit in the buffer, the following is done:
  4. If the message can be accommodated in the buffer without truncation, or the GMATM option was specified, the following is done:

    If no error occurs, the output from the data-conversion service or from the user-written exit is the converted message, plus the completion code and reason code to be returned to the application issuing the MQGET call.

  5. If the conversion is successful, the queue manager returns the converted message to the application. In this case, the completion code and reason code returned by the MQGET call will usually be one of the following combinations:
    Completion code
    Reason code
    CCOK
    RCNONE
    CCWARN
    RC2079
    However, if the conversion is performed by a user-written exit, other reason codes can be returned, even when the conversion is successful.

    If the conversion fails (for whatever reason), the queue manager returns the unconverted message to the application, with the MDCSI and MDENC fields in the MSGDSC parameter set to the values in the control information in the message, and with completion code CCWARN. See below for possible reason codes.