COBOL Manual for TNS and TNS/R Programs

Data Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
7-75
USAGE Clause
°
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.
°
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 items data description entry; therefore, an elementary
data item’s usage attribute can be inherited, explicit, or implicit.
PICTURE
Clause
NATIVE-n
Equivalent
Range
Signed
1
Unsigned
2
PIC [S]9(1) -
PIC [S]9(4)
NATIVE-2 -32,768 through 32,767 0 through 65,535
PIC [S]9(5) -
PIC [S]9(9)
NATIVE-4 -2,147,483,648 through
2,147,483,647
0 through
4,294,967,295
PIC [S]9(10) -
PIC [S]9(18)
NATIVE-8 -9,223,372,036,854,775,
808 through
9,223,372,036,854,775,
807
0 through
18,446,744,073,709,
551, 615
1. NATIVE-n items must be in the signed range.
2. Applies only to PICTURE Clause.