COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Signed COMPUTATIONAL-5 data items are equivalent to NATIVE-n data items, but
unsigned COMPUTATIONAL-5 data items can store a larger range of values than the
corresponding NATIVE-n data items (see in PICTURE Clause (page 191)).
◦ PICTURE clause
A COMPUTATIONAL-5 data item can have any PICTURE clause containing 9, P, S, and
V. The PICTURE clause determines its size and the range of its values. Bracketed items
are optional.
Range
Unsigned
2
Signed
1
NATIVE-n
EquivalentPICTURE Clause
0 through 65,535-32,768 through 32,767NATIVE-2PIC [S]9(1) -
PIC [S]9(4)
0 through 4,294,967,295-2,147,483,648 through
2,147,483,647
NATIVE-4PIC [S]9(5) -
PIC [S]9(9)
0 through 18,446,744,073,709,
551, 615
-9,223,372,036,854,775, 808
through
9,223,372,036,854,775, 807
NATIVE-8PIC [S]9(10) -
PIC [S]9(18)
1
NATIVE- n items must be in the signed range.
2
Applies only to PICTURE Clause.
◦ SYNCHRONIZED clause causes 2-Byte alignment
The SYNCHRONIZED clause causes COMPUTATIONAL-5 data items to be aligned on
2-byte or 4-byte boundaries, depending on their size. In this case, LEFT and RIGHT phrases
have the same effect.
◦ Passing by reference requires SYNCHRONIZED clause
To pass a COMPUTATIONAL-5 data item to a routine written in a language that requires
parameters to be 2-byte-aligned, describe the data item with the SYNCHRONIZED clause.
◦ Decimal numeric literal cannot have maximum value of COMP-5 data item
You cannot specify a decimal numeric literal that is the maximum value allowed for a
COMPUTATIONAL-5 data item. The reason is that the maximum value allowed for a
COMPUTATIONAL-5 data item has 19 digits and a decimal numeric literal cannot have
more than 18 digits. You can use a hexadecimal numeric literal for the maximum value
allowed for a COMPUTATIONAL-5 data item.
• DISPLAY Data Items
If the data description entry for an elementary item does not include a USAGE clause and is
not subordinate to any data structure description that includes an explicit USAGE clause, then
the effect is as if a USAGE DISPLAY clause had appeared in the elementary item’s data
description entry; therefore, an elementary data item’s usage attribute can be inherited, explicit,
or implicit.
DISPLAY format is required for these data items:
◦ Data items subordinate to a data structure that is described with a VALUE clause or has
condition-names associated with it
◦ Signed numeric data items that are affected by a data structure’s SIGN clause
208 Data Division










