Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Handling differences in ASCII DBCS and EBCDIC DBCS strings

To obtain mainframe behavior for alphanumeric data items that contain DBCS characters, use the CHAR(EBCDIC) compiler option and the SOSI compiler option. To avoid problems with the different data representation between ASCII DBCS and EBCDIC DBCS characters, use the CHAR(EBCDIC) compiler option.

In alphanumeric data items, mainframe double-byte character strings (containing EBCDIC DBCS characters) are enclosed in shift codes, and Windows-based workstation multibyte character strings (containing ASCII DBCS characters) are not enclosed in shift codes. The hexadecimal values used to represent the same characters are also different.

In DBCS data items, mainframe double-byte character strings are not enclosed in shift codes, but the hexadecimal values used to represent characters are different from the hexadecimal values used to represent the same characters in workstation multibyte strings.

For most programs, these differences should not make porting difficult. However, if your program depends on the hexadecimal value of a multibyte string, or expects that an alphanumeric character string contains a mixture of single-byte characters and multibyte characters, use caution in your coding practices.

related references
CHAR
SOSI


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)