The MQXCNVC call has the following parameters.
Connection handle.
This handle represents the connection to the queue manager.
In a data-conversion exit, Hconn should normally be the handle passed to the data-conversion exit in the Hconn field of the MQDXP structure; this handle is not necessarily the same as the handle specified by the application which issued the MQGET call.
On i5/OS, the following special value can be specified for Hconn:
Options that control the action of MQXCNVC.
Zero or more of the options described below can be specified. If more than one is required, the values can be:
Default-conversion option: The following option controls the use of default character conversion:
This option specifies that default character conversion can be used if one or both of the character sets specified on the call is not supported. This allows the queue manager to use an installation-specified default character set that approximates the specified character set, when converting the string.
The default character sets are defined by a configuration option when the queue manager is installed or restarted.
If MQDCC_DEFAULT_CONVERSION is not specified, the queue manager uses only the specified character sets to convert the string, and the call fails if one or both of the character sets is not supported.
This option is supported in the following environments: AIX, HP-UX, OS/2, i5/OS, Solaris, Linux, Windows.
Padding option: The following option allows the queue manager to pad the converted string with blanks or discard insignificant trailing characters, in order to make the converted string fit the target buffer:
This option requests that conversion take place in such a way that the target buffer is filled completely:
If there are too few insignificant trailing characters, as much of the string as will fit is placed in the target buffer, and the call completes with MQCC_WARNING and reason code MQRC_CONVERTED_MSG_TOO_BIG.
Insignificant characters are:
If this option is not specified:
If the converted string fits in the target buffer, the call completes with MQCC_OK and reason code MQRC_NONE.
If the converted string is too big for the target buffer, as much of the string as will fit is placed in the target buffer, and the call completes with MQCC_WARNING and reason code MQRC_CONVERTED_MSG_TOO_BIG. Note that fewer than TargetLength bytes can be returned in this case.
This option is supported in the following environments: AIX, HP-UX, OS/2, i5/OS, Solaris, Linux, Windows.
Encoding options: The options described below can be used to specify the integer encodings of the source and target strings. The relevant encoding is used only when the corresponding character set identifier indicates that the representation of the character set in main storage is dependent on the encoding used for binary integers. This affects only certain multibyte character sets (for example, UCS-2 character sets).
The encoding is ignored if the character set is a single-byte character set (SBCS), or a multibyte character set whose representation in main storage is not dependent on the integer encoding.
Only one of the MQDCC_SOURCE_* values should be specified, combined with one of the MQDCC_TARGET_* values:
The encoding values defined above can be added directly to the Options field. However, if the source or target encoding is obtained from the Encoding field in the MQMD or other structure, the following processing must be done:
The following illustrates how this might be coded in the C programming language:
Options = (MsgDesc.Encoding & MQENC_INTEGER_MASK) * MQDCC_SOURCE_ENC_FACTOR + (DataConvExitParms.Encoding & MQENC_INTEGER_MASK) * MQDCC_TARGET_ENC_FACTOR;
If not specified, the encoding options default to undefined (MQDCC_*_ENC_UNDEFINED). In most cases, this does not affect the successful completion of the MQXCNVC call. However, if the corresponding character set is a multibyte character set whose representation is dependent on the encoding (for example, a UCS-2 character set), the call fails with reason code MQRC_SOURCE_INTEGER_ENC_ERROR or MQRC_TARGET_INTEGER_ENC_ERROR as appropriate.
The encoding options are supported in the following environments: AIX, HP-UX, z/OS, OS/2, i5/OS, Solaris, Linux, Windows.
Default option: If none of the options described above is specified, the following option can be used:
MQDCC_NONE is defined to aid program documentation. It is not intended that this option be used with any other, but as its value is zero, such use cannot be detected.
Coded character set identifier of string before conversion.
This is the coded character set identifier of the input string in SourceBuffer.
Length of string before conversion.
This is the length in bytes of the input string in SourceBuffer; it must be zero or greater.
String to be converted.
This is the buffer containing the string to be converted from one character set to another.
Coded character set identifier of string after conversion.
This is the coded character set identifier of the character set to which SourceBuffer is to be converted.
Length of output buffer.
This is the length in bytes of the output buffer TargetBuffer; it must be zero or greater. It can be less than or greater than SourceLength.
String after conversion.
This is the string after it has been converted to the character set defined by TargetCCSID. The converted string can be shorter or longer than the unconverted string. The DataLength parameter indicates the number of valid bytes returned.
Length of output string.
This is the length of the string returned in the output buffer TargetBuffer. The converted string can be shorter or longer than the unconverted string.
Completion code.
Reason code qualifying CompCode.
If CompCode is MQCC_WARNING:
If CompCode is MQCC_FAILED:
For more information on these reason codes, see Appendix A. Return codes.
Notices |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
csqzak10388 |