IBM Data Conversion Under Websphere MQ
Total Page:16
File Type:pdf, Size:1020Kb
IBM WebSphere MQ Data Conversion Under WebSphere MQ Table of Contents .................................................................................................................................................... 3 .................................................................................................................................................... 3 Int roduction............................................................................................................................... 4 Ac ronyms and terms used in Data Conversion........................................................................ 5 T he Pieces in the Data Conversion Puzzle............................................................................... 7 Coded Character Set Identifier (CCSID)........................................................................................ 7 Encoding .............................................................................................................................................. 7 What Gets Converted, and How............................................................................................... 9 The Message Descriptor.................................................................................................................... 9 The User portion of the message..................................................................................................... 10 Common Procedures when doing the MQPUT................................................................. 10 The message is entirely numeric data................................................................................ 11 The message is entirely character data............................................................................... 11 The message is mixed numeric and character data............................................................ 11 Common Procedures to ensure conversion........................................................................ 13 Wher e to Find the Conversion Tables.................................................................................... 14 On WebSphere MQ for AIX........................................................................................................... 14 On WebSphere MQ for HP-UX...................................................................................................... 14 On WebSphere MQ for Sun Solaris and Linux............................................................................ 15 On WebSphere MQ for Windows.................................................................................................. 15 Testing Conversion........................................................................................................................... 15 H ints and Tips......................................................................................................................... 16 T racing (Windows, UNIX and iSeries).................................................................................. 18 S upporting multiple languages.............................................................................................. 19 We bSphere MQ and UNICODE............................................................................................. 20 What is UNICODE?......................................................................................................................... 20 WebSphere MQ support for UNICODE....................................................................................... 20 UCS-2 and UTF-8 - which should you use?................................................................................... 21 UCS-2 ................................................................................................................................ 21 UTF-8 ................................................................................................................................ 21 UNICODE CCSIDs.......................................................................................................................... 21 Designing UNICODE applications for WebSphere MQ.............................................................. 21 GB18030 ............................................................................................................................................ 22 De fault data conversion.......................................................................................................... 23 Enabling default data conversion................................................................................................... 23 Data Conversion Under WebSphere MQ 2 Limitations ........................................................................................................................................ 23 Appe ndix A. Control code conversions.................................................................................. 25 Appe ndix B. CCSID.TBL....................................................................................................... 27 WebSphere MQ for AIX, HP-UX................................................................................................... 27 WebSphere MQ for Windows, Linux, Sun Solaris....................................................................... 27 Appe ndix C. How the non-z/OS platforms treat EBCDIC newline...................................... 28 Appe ndix D. How CCSIDs relate to code set names............................................................. 29 AIX, HP-UX and DEC-OVMS........................................................................................................ 29 Appe ndix E. How to set the Queue Manager CCSIDs.......................................................... 30 How to set the Queue Manager CCSID on WebSphere MQ for z/OS....................................... 30 Non z/OS platforms.......................................................................................................................... 30 Displaying the Queue Manager CCSID............................................................................. 30 Setting the Queue Manager CCSID on WebSphere MQ for UNIX products................... 30 Setting the Queue Manager CCSID on WebSphere MQ for Windows............................. 32 Setting the Queue Manager CCSID on WebSphere MQ for iSeries................................. 32 Displaying iSeries CCSID values...................................................................................... 32 Setting the Queue Manager CCSID on MQSeries for HP OpenVMS............................... 33 Appe ndix F. How do EBCDIC Latin 1 codepages differ...................................................... 34 Appe ndix G. Windows and OEM codepages.......................................................................... 37 Appe ndix H. Notices............................................................................................................... 39 Trademarks ....................................................................................................................................... 39 Data Conversion Under WebSphere MQ 3 Introduction Data conversion in WebSphere MQ is a constant companion. As soon as you create a connection between two Queue Managers, data conversion has entered the picture. Regardless of whether you are connecting two ‘like’ systems (ASCII to ASCII, or EBCDIC to EBCDIC), or even if your two Queue Managers are on the same physical machine -- the WebSphere MQ data conversion routines will be invoked. In the case of a connection between two ‘like’ systems, these routines will likely decide that no work is necessary, but a WebSphere MQ trace will always show the calls to the xcsQueryCCSIDType routines whenever message data is being handled in WebSphere MQ. Revision information Revised June 2008: Corrections and expansion. Revised October 2009: Corrections. Data Conversion Under WebSphere MQ 4 Acronyms and terms used in Data Conversion Here are a few of the words and acronyms which may be used in this and other documents you may read about data conversion. They are ‘informal’ definitions Table 1. Acronyms and terms code page A number which IBM and others assign to a particular assignment of character shapes (glyphs) to binary codes. character A number used to identify the set of characters represented, without reference set to the codes used for the characters. One character set can be encoded into more than one code page. CCSID Coded Character Set IDentifier. A number. An IBM term which extends the meaning of code page to include other code information. Defined formally in the CDRA (Coded Character Representation Architecture) documents from IBM (see also “Coded Character Set Identifier (CCSID)”). code set UNIX term equivalent to code page. On UNIX systems this is a character string. SBCS Single Byte Character Set. A code page with up to 256 characters which can be represented by a single 8 bit byte. DBCS Double Byte Character Set. A code page with up to 65536 characters represented by two 8 bit bytes. Also used to mean anything related to languages which use DBCS or MBCS code pages. Note that, in practice, most languages which use DBCS also support an SBCS character set to represent Latin characters and have differing ways of switching between SBCS and DBCS in a character string. MBCS Multiple Byte Character Set. Some encodings used for large character set languages can use 2, 3, or 4 bytes for each character. MBCS is the general term used to cover all non-SBCS character