Handling Tables
4.3 Accessing Table Elements
Note
Because ITEM5 is not subordinate to ITEM2, an occurrence number for
ITEM2 is not permitted in the subscript list (when referencing ITEM3,
ITEM4, or ITEM5). The ninth occurrence of ITEM2 in the fifth occurrence
of A-GROUP will be selected by ITEM2(5,9).
Table 4–1 shows the subscripting rules that apply to Example 4–16.
Table 4–1 Subscripting Rules for a Multidimensional Table
Name of Item
Number of Subscripts
Required to Refer to
the Name Item
Size of Item in Bytes
(Each Occurrence)
A-TABLE
NONE
1105
A-GROUP
ONE
221
ITEM1
ONE
1
ITEM2
TWO
2
ITEM3
TWO
9
ITEM4
TWO
1
ITEM5
THREE
2
4.3.3 Subscripting with Data Names
You can also use data names to specify subscripts. To use a data name as a
subscript, define it with COMP, COMP-1, COMP-2, COMP-3, or DISPLAY usage
and with a numeric integer value. If the data name is signed, the sign must be
positive at the time the data name is used as a subscript.
A data name that is a subscript can also be subscripted; for example, A(B(C)).
Note that for efficiency your subscripts should be S9(5) to S9(9) COMP.
Содержание COBOL AAQ2G1FTK
Страница 22: ......
Страница 30: ......
Страница 94: ......
Страница 110: ......
Страница 146: ......
Страница 180: ......
Страница 194: ...Processing Files and Records 6 1 Defi...
Страница 300: ......
Страница 490: ......
Страница 516: ......
Страница 517: ......
Страница 530: ......
Страница 534: ......
Страница 590: ......
Страница 620: ......