现在的位置: 首页 > 综合 > 正文

MQ 2539错误

2012年09月11日 ⁄ 综合 ⁄ 共 2546字 ⁄ 字号 评论关闭

今天重新配置了MQ服务器,把MQ服务器移动到繁体的Server上啦.配置OK.用我的客户端连接去始终报 2539错误.

IBM帮助文件给出的解释.

2539 (09EB) (RC2539): MQRC_CHANNEL_CONFIG_ERROR

Explanation

An MQCONN call was issued from a client to connect to a queue manager but the attempt to establish communication failed. Common causes of this reason code are:

  • The server and client cannot agree on the channel attributes to use.
  • There are errors in one or both of the QM.INI or MQCLIENT.INI configuration files.
  • The server machine does not support the code page used by the client.

我在服务器上重新配置客户端,使用amqsputc命令连接OK.所以我怀疑是The server machine does not support the code page used by the client. 的原因.查看了一下帮助.

原来需要客户端的code page设置同服务器一致或可以相互转换才可以.

选择客户机或服务器编码字符集标识(CCSID)

客户机代码假设通过客户机中 MQI 的字符数据位于机器所配置的 CCSID 中。如果此 CCSID 是一个不支持的 CCSID 或不是必需的 CCSID,可以用 MQCCSID 环境变量覆盖它,例如,在 Windows® 上:

SET MQCCSID=850

更新开始或者,在 UNIX® 系统上:

export MQCCSID=850
 

我服务器上队列管理器的CCSID 是950.

所以使用命令,设置客户端CCSID

     SET MQCCSID=950

重新使用amqsputc 进行连接,连接成功,问题解决!

 

搜索了一下网络,转一下CCSID相关的解释:

IBM Coded Character Set Identifiers (CCSID)码表

A CCSID is a Coded Character Set Identifier. The Unicode standard defines a Coded Character Set as "A character set in which each character is assigned a numeric code value." This means that a CCSID is a number that defines a numeric ordering of characters. The IBM ® Character Data Representation Architecture (CDRA) as defined in SC09-1390, defines CCSIDs that are used with IBM to represent character data. This architecture defines Single Byte Character Set (SBCS) CCSIDs, Multiple Byte Character Set (MBCS) CCSIDs, and Mixed CCSIDs which are a combination of SBCS and MBCS data. MBCS CCSIDs are usually used for languages, such as Chinese, Japanese, and Korean, that define a larger number of characters than can be represented in a single byte.
CCSID是一个字符集的标识。作为unicode标准通过定义一个字符集内每个字符要对应那个数字值的方式定义了一个字符集。这说明CCSID就是一个定义字符集顺序的标识数码罢了。IBM的字符标识架构在文档 SC09-1390(
http://www-304.ibm.com/jct03002c/software/globalization/cdra/index.jsphttp://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/FOCREF00/CCONTENTS)中做了定义,CCSID是IBM用来标识字符序列的标识代码。这个架构定义了SDCS(单字符集)的CCSID值,MBCS(多字符集)的CCSID值和混合单字符多字符集的混合CCSID值。多字符集的CCSID一般用于语言,比如中文,日文,韩文,这些语言的字符量很大,无法用单字节的码值来代表。

All SBCS CCSIDs define a similar basic set of characters, although they might define them in different numeric ordering. For instance all SBCS EBCDIC CCSIDs define the number "1" as x'F0' and all SBCS ASCII CCSIDs define the number 1 as x'30'.

CCSID间的转换有多种类型。其中一种转换就是从一种CCSID到另一种CCSID的转换,举例来说从ASCII(CCSID 1252)到EBCDIC(CCSID 37)。另一种是从串数据到另一种数据类型的转换。举例来说转换字符串数据到数值。在所有的这种类型的转换中都必须标识CCSID值来保证转换的正确进行。

但是转换是有要求的,第一种转换的前提是转到的 CCSID的类型中要包含转换前的CCSID类型中要转换的字符,比如,如果从CCSID1381(S-CHGBPC-DATA) 类型的简体中文的PC编码中的一个中文字符"中"字到其他CCSID编码转换到的编码起码要求这个CCSID编码的字符集中包含同样的"中"字。

我从IBM找到的对CCSID说明的列表如下:

摘录自http://www-304.ibm.com/jct03002c/software/globalization/ccsid/ccsid_registered.jsp,如果需要详细信息,请自行查询。

抱歉!评论已关闭.