COMTRAN Reconstruction

F28-8043 · June 1960

Page 15

PDF page 21 of 124. Download the scanned PDF

The page as scanned

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

The text read off it

[page 15]

Once the condition-name has been defined, the programmer may use it in the procedure statements. For example, he might write such a sentence as IF OUT.OF.ZONE THEN DO BILLING.ROUTINE.A OTHERWISE DO BILLING.ROUTINE.B. The expression IF OUT.OF.ZONE will cause the system to examine the data to determine if the indicated condition has been met. When the reader has studied the discussion of conditional expressions, he will realize that a condition-name of this kind is actually a short way of writing an expression that shows a relationship between two items. Thus, if the "out-of-zone" code were 2, and if the field containing that code were called DISTANCE.CODE, the condition-name OUT.OF.ZONE would actually be equivalent in every way to the expression DISTANCE.CODE = 2.

Condition-names are subject to the general rules for the formation of names, which are given below. They may be assigned by the programmer at his discretion.

Formation of Names

Names may be formed by combining any of the characters from the basic list of alphabetic characters, numerals, and the period, subject to the following rules:

  1. Names must not contain blanks.
  2. Names must always begin with an alphabetic character.
  3. They may contain from 1 to 30 characters.
  4. They may neither begin nor end with a period. However, "imbedded" periods may be used within the name for the sake of readability.
  5. They may be "qualified" (to make them unique within the program) by the use of other names. This is explained below under the heading "Compound Names."

Compound Names

In many cases a program will contain duplicate names. This often happens when an input file is "updated" to produce an output file, since each file will usually contain the same kinds of records.

Suppose that an input record is named INPUT.MASTER and an output record is called OUTPUT.MASTER. Suppose, further, that each record contains two dates, one called ORDER.DATE, the other called SHIPMENT.DATE.

If the program involves both kinds of records, it would not be possible to distinguish readily between the two ORDER.DATE names and the two SHIPMENT.DATE names. All four names would be defined in the data description (see Chapter 4), which gives the system the information it needs to locate individual items of data. To indicate which of the ORDER.DATE (or SHIPMENT.DATE) names is meant, however, each such name can be "qualified," or "compounded," when used in a procedure statement. That is, the name of a larger data item of which it is a part can be added to the name to identify it. Thus, INPUT.MASTER ORDER.DATE would be clearly distinguishable from OUTPUT.MASTER ORDER.DATE. Names qualified in this manner are referred to as compound names.

Compounding of names is not limited to two levels. For example, the various dates mentioned in this example may each have an element called MONTH to which the programmer may wish to refer individually. If, at the time of reference, the program is working with only one record which contains an element called MONTH, there is no ambiguity. But should ambiguity exist, the name of a data item at a higher level may be used as a qualifier. Thus, the programmer may specify, in this case, ORDER.DATE MONTH or SHIPMENT.DATE MONTH. If, as is likely, both input and output records are in use at the same time, three levels of names may be used in a single compound name—for example, INPUT.MASTER ORDER.DATE MONTH.

When names are to be compounded, the following rules apply:

  1. Each name must be separated from the next by at least one blank space. (This distinguishes between compound and simple names, since simple names may not contain blanks.)