COMTRAN Reconstruction

F28-8043 · June 1960

Page 82

PDF page 88 of 124. Download the scanned PDF

The page as scanned

The scan of PDF page 88 of F28-8043
Select the scan to open it at full size.

The text read off it

[page 82]

Quantities Specified in Named Fields

It has been shown that if a value is placed in the "Quantity" columns, the processor will reserve space for repeating the specified data description until it appears the number of times indicated by that value. In certain special cases, the programmer may wish to alter the use of such an area at the time the object program is run. The storage area, of course, will already have been reserved by the action of the processor, and at object time it is no longer possible to set aside new areas. However, for certain specialized purposes, it is possible to regroup the components of an existing area by using the QUANTITY IN option. In this case, a quantity value is placed in a named field and the program is referred to this field by the words QUANTITY IN followed by the name of the field.

This usage is not required in most programs. It represents an advanced programming technique, providing additional facilities which can be used effectively by a skilled programmer. While it is not the purpose of this manual to explain the many refinements and uses of this technique, its general nature is indicated by the following discussion:

Suppose that a certain data description having the field pictorial 999V99 is to be repeated until it appears 100 consecutive times. Each iteration of the data description will reserve 5 character spaces in storage, and therefore a total of 500 spaces will be reserved altogether. Suppose that this area is referred to by the name TABLE.

Suppose, then, that the programmer wishes to set up a number of different tables at different times during the running of the object program, using this same storage area for each. Assume that the first, referred to in this text as Table 1, consists of 10 columns and 10 lines—i.e., there will be 10 data items on each of 10 lines, and each item will have a field pictorial of 999V99. This table could have been set up by the original data description for the area in a series of entries such as the following:

Coding form: TABLE / COLUMN / ITEM with quantities 10, 10 Data description coding form — TABLE 01, COLUMN 02 (quantity 10), ITEM 03 (quantity 10) (page 82).

SERIAL   DATA NAME              LEVEL  TYPE    QUANTITY   MODE  JUSTIFY  DESCRIPTION

         TABLE                    01
         COLUMN                   02                10
         ITEM                     03                10

Once the table is described, the programmer may refer to individual items in it by the use of subscripts, the first subscript referring to the item at the higher level. Thus, ITEM (4, 2) would refer to the second item of the fourth COLUMN group.

When the system is directed to obtain this item, it relies on a technique of counting. Specifically, it would rely on the fact that ten items are specified for each column. Thus, it would count off the first ten items, then the ten items of the second column, the ten items of the third column, and it would then count to the second item following. In other words, it would obtain the 32nd item in the string of data representing the table.

However, it is supposed that at some other time in the program the programmer wishes to set up another table (Table 2) which uses the same field pictorial for each item but which requires a different grouping of columns and lines. Suppose Table 2 has 20 columns and 5 lines. The programmer could theoretically write the following entries: