Compaq AAQ2G1FTK Marine Radio User Manual


 
Handling Tables
4.1 Defining Tables
Figure 4–4 Organization of a Two-Dimensional Table
12
ZK6042GE
2DTABLEX
LY LY
LZ LZ LZ LZ
A B A B A B A B
1 2 3 4 5 6 7 8
Longword number
Byte number
Level 01
Level 05
Level 10
Level 15
A = CELLA
B = CELLB
Legend: LY = LAYERY
LZ = LAYERZ
Example 4–5 Defining a Three-Dimensional Table
01 TABLE-A.
05 LAYER-B OCCURS 2 TIMES.
10 ITEMC PIC X.
10 ITEMD PIC X OCCURS 3 TIMES.
10 ITEME OCCURS 2 TIMES.
15 CELLF PIC X.
15 CELLG PIC X OCCURS 3 TIMES.
Figure 4–5 Organization of a Three-Dimensional Table
Level 05
Longword number
Byte number
Level 01
ZK6043GE
123
A
B
0 0 0 0 0 0 0 0 0 1 1 1
1 2 3 4 5 6 7 8 9 0 1 2
Level 10
1 1 1 1 1 1 1 2 2 2 2 2
3 4 5 6 7 8 9 0 1 2 3 4
456
B
CDD D E E
GF G G F G G G
CDD D E E
GF G G F G G G
Level 15
Legend: A =
B =
ITEME
C =
TABLEA
D =
CELLF
E =
CELLG
F =LAYERB
G =ITEMC
ITEMD
4.1.3 Defining Variable-Length Tables
To define a variable-length table, use Format 2 of the OCCURS clause (refer to
the Compaq COBOL Reference Manual). Options allow you to define single or
multiple keys, or indexes, or both.
Example 4–6 illustrates how to define a variable-length table.
Handling Tables 4–5