Length Field (Columns 30 through 34)
Leave this field blank when you are defining a field that is to be used for
output only (column 38 the Usage field, has an 0 in it).
You must specify a length when a data field is used for both input and output
(the Usage field, column 38, has a B in it). The following rules apply:
The maximum length of the field depends on the type of field you specify:
1. Character fields can contain up to 256 positions; field description
statements, as noted earlier, are compiled as
02
level data-items in your
COBOL program.
2. Numeric fields can contain up to 18 positions.
Only the digits 0 through 9 are allowed in the Length field; either leading
zeros or leading blanks are acceptable. The entry in the Length field must be
right adjusted.
Data Type Field (Column 35)
Leave this field blank when:
•
You code CHECK(BY) in the Editing field.
•
This statement defines a field that is to be used for output only (the
Usage field, column 38, has an 0 in it).
You must specify a data type when the field is used for both input and output
(the Usage field, column 38, has a B in it) unless you specify CHECK(BY) in
the Editing field. (The CHECK keyword is explained later in this chapter.)
Data-Item Class in COBOL Program
The class (numeric or alphanumeric) of the data-item compiled in the
COBOL program depends on you entry in both the Data Type field and the
Decimal Positions field, as shown in the following table:
Data Type
Decimal Position
Data class of field in COBOL
field contents:
field contents:
program after compilation:
A,C,D,H,N,
blank
alphanumeric (X)
S, V, W, X, or Y
A,C,H, V, W,
0-9
unsigned numeric
X,orY
(9V9)
D, N, or S
0-9
signed numeric
ICOUO\
tJ71'7
2- 16
IBM 5280 COBOL Programmer's Guide
Need help?
Do you have a question about the 5280 and is the answer not in the manual?