Pathway/iTS TCP and Terminal Programming Guide

Processing Double-Byte Character Sets
Compaq NonStop™ Pathway/iTS TCP and Terminal Programming Guide426751-001
8-3
Subscripting Considerations
One 2-byte character and up to eight 1-byte Katakana or alphanumeric characters
If a data item contains fewer than the maximum number of characters allowed, the
appropriate number of padding space characters are added to the right. If a PIC X field
contains no double-byte (2-byte) characters, it is not a mixed data item.
When manipulating a PIC X field, you must remember two points:
Double-byte characters take two bytes of storage.
On output to 3270-class devices, the data-conversion function converts the data
stream from internal format to a format suitable for the external device. When the
external device is an IBM 3270-class device, SO/SI (shift-out/shift-in) characters are
inserted around each double-byte character substring. These SO/SI characters each
take up one column of screen space. When the external device is a Fujitsu 3270-
class device, a similar operation to that for an IBM 3270-class device is performed,
but the substring framing characters do not occupy screen space.
The use of SO/SI characters to bracket double-byte character set data is discussed
later in this section.
Mixed data items are allowed in the Working-Storage Section, the Linkage Section, and
the Screen Section of the Data Division of a SCREEN COBOL program. For both
Working-Storage Section and Linkage Section entries, the maximum size of a data item
is 16,000 double-byte characters or its equivalent (32,000 bytes). Mixed data items are
not allowed in the Message Section of the Data Division of a SCREEN COBOL
program.
Subscripting Considerations
Subscripts are used to refer to elements in a table. Subscripts are needed because all
table elements have the same name.
When you develop a Pathway application that uses double-byte characters, you must
code the OCCURS clause to accommodate PIC X data items that might contain double-
byte characters, as explained in the following paragraphs.
The left or right byte of a double-byte character in itself has no meaning. Referring to a
subscripted data item, defined by using a PIC X clause containing double-byte data and
redefined as PIC X(1) OCCURS n TIMES, might refer to only the left or right byte of a
double-byte character. That half of the double-byte character by itself is undefined. For
example:
WORKING-STORAGE SECTION.
.
:
01 WS-KANJI-DATA PIC N(05).
01 WS-UNDEFINED-DATA PIC X.
01 WS-NAME-1 PIC N(05).
01 WS-GROUP-REDEF REDEFINES WS-NAME-1.
02 WS-BYTE-DATA PIC X OCCURS 10 TIMES.
Note. Katakana characters are not classed as alphanumeric characters in PIC A items.
PIC A items can consist only of letters of the Roman alphabet or space characters.