Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)

Data Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual426750-001
5-19
USAGE Clause
USAGE Clause
The USAGE clause defines how a data item is stored within the Compaq NonStop™
Himalaya 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.
Declaration of a group item as COMPUTATIONAL implies that all subordinate items in
the group are COMPUTATIONAL. The group item itself cannot be used in
computations.
A DISPLAY item has a value that is stored in the standard data format as a sequence of
ASCII characters. The characteristics of the item are given in the PICTURE string.
If the PICTURE string of a numeric item contains an S symbol, the item has an
operational sign. If a SIGN IS SEPARATE clause is not specified, the operational sign
is maintained as part of either the leading or trailing digit; the affected character
position will contain a nondigit ASCII character.
[ 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