COMTRAN Reconstruction

F28-8043 · June 1960

Page 31

PDF page 37 of 124. Download the scanned PDF

The page as scanned

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

The text read off it

[page 31]

respond to the number of subdivisions—i.e., the number of “levels”—of the table required to obtain the item. For example, if the programmer wished to obtain all of the words on line 10, it would be sufficient to write either PAGE (150) LINE (10) or PAGE LINE (150, 10). If the name LINE were unique, it would suffice to write LINE (150, 10).

A subscript may consist of a single name representing a variable quantity (such as a data-name), or a literal, or it may consist of an arithmetic expression of the form

a * VARIABLE ± b

in which the quantities a and b are literals and the name VARIABLE is the name of a field which may contain a variable quantity. This name may be a compound name, but, whether simple or compound, it must not have a subscript. Condition-names may not be used in subscripts. A name, literal, or arithmetic expression used as a subscript must represent a positive integral value.

Following are examples of subscripted names:

Subscripted Name Comment
PAGE LINE WORD (150, 10, 4) The subscripts actually apply to the name WORD, but it is assumed that this name is not unique and has been compounded by the use of the names PAGE and LINE.
WORD (150, 10, 4) The name WORD is assumed to be unique, but it is part of a larger structure having three levels which must be identified by subscripts.
RATE.TABLE ONE.WAY (2, DESTINATION, 4) It is assumed that there are several different tables called RATE.TABLE, each having the same structure. The 2 indicates the second table of this series, the name DESTINATION is the name of a field in the table, and the code 4 is a literal code which identifies a further subdivision of the table—e.g., “family plan, 4 persons.”
ITEM (BASE ± 1) This subscript obtains the value following the one obtained by the notation ITEM (BASE). This construction may be useful in such procedures as interpolating between successive items in a table. Usually (in this particular kind of procedure) both items would be obtained and both would be used as inputs to some interpolating procedure.
ITEM (4 * AMOUNT) In this case, the value of AMOUNT would be obtained and it would then be multiplied by the factor 4 and used as the subscript. Such a subscript could be used to obtain every fourth value in a table, assuming the value in the AMOUNT field is increased by 1 on each repetition of the routine.