Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)

Data Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual426750-003
5-19
USAGE Clause
Automatic alignment or requested alignment of data items described by redefinition of
character positions (through use of the REDEFINES clause) follows the rules
described in the preceding paragraphs. However, when the first data item allocated by
a redefinition requires word alignment or doubleword alignment, the data item being
redefined must begin on the appropriate boundary. In other words, SCREEN COBOL
does not permit redefinitions that require insertion of implicit FILLER bytes before the
first data item of the redefinition. Any bytes inserted at other places within the
redefinition are counted when determining the redefinition size.
USAGE Clause
The USAGE clause defines how a data item is stored within the HP NonStop system
and, normally, affects the number of character positions used. The USAGE clause
does not restrict how the item is used; however, some statements in the Procedure
Division require certain usages for their operands.
COMP or COMPUTATIONAL
indicates a numeric data item that is suitable for computations.
DISPLAY
indicates a data item value that is stored in the standard data format as a
sequence of ASCII characters. If this clause is omitted, the default is DISPLAY.
A USAGE clause can be written at any level. A USAGE clause written at the group
level applies to each elementary item in the group. The usage of an elementary item
cannot contradict the USAGE clause of a group to which the item belongs. Note,
however, that a group item is always considered to be alphanumeric by SCREEN
COBOL; thus, the USAGE clause of a group item might not always apply to the
manipulation of the item.
A COMPUTATIONAL item has a value suitable for computations and, therefore, must
be numeric. The PICTURE string of the item can have only the symbols 9, S, V, and P.
Two to eight bytes are selected for a COMPUTATIONAL item, depending on the
number of 9 symbols in the PICTURE string, as Table 5-2 indicates.
[ USAGE [ IS ] ] { COMP }
{ COMPUTATIONAL }
{ DISPLAY }
Table 5-2. Storage Occupied by COMPUTATIONAL Data Items
Number of 9 Symbols Size of Data Item
1 through 4 2 bytes
5 through 9 4 bytes
10 through 18 8 bytes