CODE_SYSTEM

The runtime configuration variable CODE_SYSTEM tells the runtime if double-byte character data is being accepted or displayed, and which code system (that is, which standard for encoding Japanese and other Asian character sets, for example) is being used. Each code system has a range of values that it allows within each byte of a two-byte character, so identifying the code system allows the runtime to recognize character boundaries when it is processing double-byte data for ACCEPT and DISPLAY statements.

Setting CODE_SYSTEM to the proper value allows your COBOL applications to handle input and display of double-byte character data without source program changes. The syntax is:

CODE_SYSTEM  setting

The table below shows the possible settings of the CODE_SYSTEM variable, the code system to which each setting refers, and some examples of operating systems to which the particular code system applies:

Setting Code System Op. System Examples
BIG5 Big Five (placecountry-regionTaiwan) Chinese DOS, Windows
DBC Acucorp Generic Double-byte Coding Scheme other double-byte machines
EUC Extended UNIX Most UNIX machines
GB Code of Chinese Graphic Character Set (People's Republic of placecountry-regionChina) Chinese DOS, Windows
KSC Korean Character Standard Korean DOS
SJC Shift JIS Code (Japanese Industrial Standard) DOS/V, Windows, some UNIX machines

The default 0 means ASCII or EBCDIC single-byte characters.

The following table shows the decimal values that the respective code systems allow for each byte of the two-byte character:

Code System Setting 1st byte 2nd byte
BIG5

(second format)

161 - 254

161 - 254

64 - 126

161 - 254

DBC 128 - 255 128 - 255
EUC

(second format)

142

161 - 254

161 - 223

161 - 254

GB and KSC 161- 254 161 - 254
SJC

(second format)

129 - 159

224 - 239

64 - 252 (not 127)

64 - 252 (not 127)

Note: The first and second byte values are co-dependent; that is, both values must fall within the respective ranges shown in the table. If either value is not within its allowable range, then each byte will be treated as a single character.