Loading a Run-Time Array by Reading One Record from a File

If an input record from a database file will contain all the information for the entire array, the array can be loaded in a single input operation. If the fields in the database record that correspond to the array occupy consecutive positions in the database record, then the array can be loaded with a single Input specification, as shown in Figure 69. The Input specification defines the positions in the database record for the entire array.

Figure 69. Using a Run-Time Array with Consecutive Elements
*...1....+....2....+....3....+....4....+....5....+....6....+....7...
DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++
DINPARR           S             12A   DIM(6)
IFilename++SqNORiPos1+NCCPos2+NCCPos3+NCC................................
I........................Fmt+SPFrom+To+++DcField+++++++++L1M1FrPlMnZr....
IARRFILE   AA  01
I                                  1   72  INPARR

If the fields in the database record that correspond to the array are scattered throughout the database record, then the array must be loaded with a several Input specifications. The example in Figure 70 assumes that the database record contains data for all the array elements, but a blank separates the data for each array element in the database record. Each Input specification defines the position in the database record for a single element.

Figure 70. Defining a Run-Time Array with Scattered Elements
*...1....+....2....+....3....+....4....+....5....+....6....+....7...
DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++
DARRX             S             12A   DIM(6)
IFilename++SqNORiPos1+NCCPos2+NCCPos3+NCC................................
I........................Fmt+SPFrom+To+++DcField+++++++++L1M1FrPlMnZr....
IARRFILE   AA  01
I                                  1   12  ARRX(1)
I                                 14   25  ARRX(2)
I                                 27   38  ARRX(3)
I                                 40   51  ARRX(4)
I                                 53   64  ARRX(5)
I                                 66   77  ARRX(6)


[ Top of Page | Previous Page | Next Page | Contents | Index ]