HP 3000 Manuals

For VSC2 and MF only: Data Items [ Micro Focus COBOL Language Reference - Additional Topics ] MPE/iX 5.0 Documentation


Micro Focus COBOL Language Reference - Additional Topics

For VSC2 and MF only:  Data Items 

DBCS Data Items 

There is a class of data additional to the classes described in the
chapter Concepts of COBOL Language in your Language Reference:  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" or "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
purpose is the number of "G"s and "B"s in its PICTURE character-string.

For reference modification, the leftmost-caracter-position and length
specify the number of DBCS characters, not bytes.

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 responsiblity 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