The text read off it
[page 14]
Data-names are invented and assigned to data at the discretion of the programmer, following the rules given below which govern the formation of names. All data referred to in the program must be named, but this does not mean that all subdivisions of data must be named. For example, if the programmer wishes to refer to a date, he will have to give it a name, but he does not have to name the component parts, such as the day, the month, or the year, unless he wishes to refer to them individually.
The general category of data-names may be broken down, for convenience, into record-names, field-names, function-names, parameter-names, named constants, and so on. The meanings of these names will be explained later in this manual.
Procedure-Names
Procedure-names are names assigned to individual portions of the program so that one procedure can refer to another. Suppose, for instance, that the programmer has written a routine for computing a discount and that he wishes to use this routine at various times in the program. He could actually copy the routine into the program each time it is required, but this may be inefficient. An alternative method would be to give the routine a name, such as DISCOUNT, or DISCOUNT.CALCULATION; then, when the programmer wished to use this routine he could write such an instruction as DO DISCOUNT.CALCULATION. As the reader will discover, there are many reasons why the programmer may wish to refer from one part of the program to another. Procedure-names provide him with the means of doing this.
Like data-names, procedure-names are invented and assigned by the programmer as he needs them, following the rules for name formation given below. They are placed at the beginning of the portion of the program to which they apply.
Procedure-names may be assigned to any sentence or section of the program. (A section consists of one or more successive sentences.) The reader will find further details of how to use procedure-names in Chapter 3 in the discussion of the commands DO, GO TO, INCLUDE, OVERLAP, BEGIN SECTION, and END. Procedure-names may also be referred to as sentence-names or section-names, as appropriate.
Condition-Names
The concept of condition-names will be more clearly understood after the reader has studied the discussion of conditional expressions beginning on page 21 of this manual. In general, however, a condition-name defines a condition which can be used to control an operation.
For example, suppose that a manufacturer has agreed to pay shipping charges for goods shipped to customers within 50 miles of the factory, but that charges for shipment out of this 50-mile zone will be billed to the customer. Obviously, two different routines are called for in the program, and the decision as to which will be used will depend on the shipping distance.
Suppose that a code is used in the input records to indicate whether the customer is located within the 50-mile zone or not. The programmer will need to refer to this code, and it will usually be convenient to be able to give it a name which can be written in a procedure statement.
In this case, the programmer might wish to use the name OUT.OF.ZONE to indicate that a customer is located more than 50 miles from the factory. He can place this name in the program by writing an entry that instructs the system that the name is to be treated as an equivalent for the code it represents. (The actual method of doing this is explained in Chapter 4.)
