Data Items [ COBOL/HP-UX Language Reference for the Series 700 and 800 ] MPE/iX 5.0 Documentation
COBOL/HP-UX Language Reference for the Series 700 and 800
Data Items
(VSC2) (MF)
DBCS Data Items
There is a class of data additional to the classes described in Chapter
2: it is called DBCS. It includes two data categories: DBCS and DBCS
edited.
A data item of class DBCS is described by using the USAGE DISPLAY-1
clause. An item with this clause can have only the characters "G" and
"B" in its PICTURE character-string. A "G" represents a DBCS character
position; "B" is an editing character, and indicates a position that will
always have a DBCS space inserted in editing. An item whose PICTURE
character-string is all "G"s is of category DBCS; an item whose PICTURE
character-string contains both "G" s and "B"s is of category DBCS edited.
Note that each "G" or "B" represents one 2-byte character position.
Except where otherwise stated, the length of the data item for all
purposes is the number of "G" s and "B"s in its PICTURE character-string.
Data items of class DBCS can be used wherever data items of class
alphanumeric can be used, subject to rules and exceptions given in the
appropriate places in this chapter.
Mixed Data Items
DBCS characters can be included in data stored in data items of category
alphanumeric. In such data, SBCS characters are represented by SBCS
codes and DBCS characters by DBCS codes. Each space character is
represented by the SBCS code for space.
On input and output both the SBCS and the DBCS codes will be recognized.
The first byte of a DBCS code is never a valid SBCS code; hence the two
can be used together without confusion. But in operations within the
program the data will be treated as ordinary alphanumeric data. It is
the programmer's responsibility to ensure that the two halves of a DBCS
code do not get separated.
The length of the data item for all purposes is its length in bytes.
MPE/iX 5.0 Documentation