Handling differences in ASCII multibyte and EBCDIC DBCS strings

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

About this task

In alphanumeric data items, Enterprise COBOL double-byte character strings (containing EBCDIC DBCS characters) are enclosed in shift codes, and COBOL for Linux® on x86 multibyte character strings (containing ASCII DBCS, UTF-8, or EUC characters) are not enclosed in shift codes. The hexadecimal values used to represent the same characters are also different.

In DBCS data items, Enterprise COBOL 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 COBOL for Linux on x86 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