SBCS, DBCS, and MBCS data conversion considerations

SBCS, DBCS, and MBCS represent different code page layouts, as described below:
SBCS: single byte character set
This describes an encoding in which each hexadecimal value has a simple relationship with a character. Up to 256 characters can be defined. Not all hexadecimal values necessarily have a meaning. The EBCDIC IBM-037 code page is one example of such a code page; the ASCII IBM-850 is another.
DBCS: double byte character set
This describes an encoding in which some hexadecimal values are recognized as being the first byte of a two-byte sequence that collectively identifies a particular character. This kind of encoding allows far more characters to be defined; in theory up to 65536. The IBM-932 code page (Japanese) is one example of a DBCS code page in which:

X'00' to X'7F' are single-byte codes
X'81' to X'9F' are double-byte introducer
X'A1' to X'DF' are single-byte codes
X'E0' to X'FC' are double-byte introducer

In this example, code points such as X'80' are undefined and have no meaning. A code point such as X'81' is recognized as being the first byte of a two-byte code. The second byte can be any of the 256 possible values. Other DBCS code pages have different organizations; each one is structured according to need.

MBCS: multibyte character set
This encoding describes a character set in which hexadecimal sequences of arbitrary length are associated with particular characters. eucJP is an example of a multibyte encoding. The principle is the same as that which is described for DBCS, except that particular hex values are recognized as being simple SBCS values or introducers for longer MBCS strings. Sequences of different lengths can be identified within a single code page.

To summarize, MBCS can be viewed as a more generalized form of DBCS, in which sequences of arbitrary length can be defined. SBCS is the simplest of all, in which every sequence is only one byte long.

Note: MBCS is not supported by a standard, although wide characters are. A wide character set is one in which the encoding supports multiple bytes (2, 3, or 4), but does so consistently; mixed length sequences do not exist in the set. For instance, IBM's wide characters are two bytes (DBCS) and HP's are four bytes.

In TXSeries for Multiplatforms, no difference exists in coding the CICS-supplied program that performs the standard conversions for SBCS, DBCS, or MBCS data.

With DBCS and MBCS data, you can convert data within the same language (Japanese, Korean, Traditional Chinese, and Simplified Chinese) between the following types of character sets:

Cross-language conversion is not possible. Conversions between SBCS and DBCS or MBCS are also not possible.

In the conversions that are listed above, the length of the converted data might differ from the original length because of the insertion and deletion of shift-out (SO) characters and shift-in (SI) characters and the DBCS or MBCS code scheme difference. An SO character is a code extension character that substitutes, for the graphic characters of the standard character set, an alternative set of graphic characters upon which an agreement exists or that has been designated by use of code-extension procedures. An SI character is a code extension character that is used to terminate a sequence that has been introduced by the SO character to make effective the graphic characters of the standard character set.

CICS® does not have the logic to handle any special treatment of data-length changes. For example, 20-byte user data in a 20-byte input buffer might become more than 20 bytes long after conversion, in which case the data might be truncated. The application must compensate for expansion during data conversion. For more information about how to use shift-out/shift-in (SO/SI) characters, refer to the IBM® 3270 Information Display Programmer's Reference.

In transaction routing, 3270 data streams are always flowed across a network in EBCDIC. Routed transaction BMS panels behave in the same way as do ordinary EBCDIC 3270 screens, regardless of the CICS platform or the code page. Therefore, no MBCS-unique considerations are needed for transaction routing.