The text read off it
[page 75]
Data description coding form — REDEF of RATE.TABLE into RATE, CITY, ONE.WAY, ROUND.TRIP, EXCURSION (page 75).
SERIAL DATA NAME LEVEL TYPE QUANTITY MODE JUSTIFY DESCRIPTION
01 REDEF RATE.TABLE
RATE 02 30
CITY 03 AAAAAAAAAAAAAA
ONE.WAY 03 999V99
ROUND.TRIP 03 999V99
EXCURSION 03 999V99
In the first of these entries, the data previously defined as RATE.TABLE is redefined (by the type code REDEF) as a new body of data. In this case a name has not been given to the redefined data, but the programmer could assign one if he wished. It will be noted that the level of the new entry (01) is the same as that of the entry being redefined.
The RATE entry and the four data-names which follow it (CITY, ONE.WAY, ROUND.TRIP, and EXCURSION) are on lower levels (02 and 03); therefore, they will be understood to be subordinate elements of the entry at the 01 level, and the code REDEF will apply to them as well.
The number 30 in the "Quantity" columns, as will be explained later in this chapter , shows that space is to be reserved for 30 entries at the 02 level. In other words, there will be 30 items called RATE. It will be seen later that the programmer may single out any one of these items by appending a subscript to the name RATE. This subscript may be a literal, a data-name, or a limited arithmetic expression. The value represented by the subscript must be a positive integer, since it will be used within the system to count individual items until the required one is reached. (See the discussion of lists, tables, and subscripts in Chapter 2.)
It has been noted that the name RATE includes all of the four items immediately following it. Thus, each of the 30 RATE entries will contain one called CITY, one called ONE.WAY, another called ROUND.TRIP, and a fourth called EXCURSION. Since 30 separate RATE entries were specified, the processor will lay out this entire sequence 30 times.
The characters in the "Description" columns show the length and type of data to be expected in each field. This is explained more fully later in this chapter, but the effect of the entries given in the example is as follows: The 14 A's following the name CITY will reserve space in storage for names of up to 14 characters in length. The symbols 999V99 will reserve space for five-digit numeric values, with an assumed decimal point between the third and fourth digits.
Once the processor has this information, it can identify and use any single item of data in the table. It will know, for example, that the first 14 character spaces of each RATE listing contain the name of a destination city, that the next five show the corresponding one-way rate, and so on. In other words, it now has the means of locating any item by its position in storage, which, as has been noted already, is the way in which the system locates all items of data in storage.
The programmer may then call for any individual item by its name, using a subscript to specify which one of the 30 items having the same name is wanted. Thus, ONE.WAY (17) would obtain the one-way rate for the 17th city in the table. Usually, however, the subscript would be a variable, such as the name of a field containing a number.