The text read off it
[page 41]
proper number of records has been accumulated, writing occurs. 2. When the physical end of a reel is sensed, the end-of-reel label is prepared and written, arrangements are made for alternation of tape units, and the tape is rewound. 3. A count of the number of records written is maintained.
It should be noted that a record that has been filed is still available for further processing. It is entirely possible, for example, to file a record in each of several files by means of a succession of FILE commands.
Some examples of the FILE command are:
FILE MASTER.
FILE PAY.RECORD.
FILE DETAIL IN ERROR.FILE.
The CLOSE Command
The CLOSE command terminates the use of one or more data files. It may take either of two general forms:
CLOSE file.name.1, file.name.2, ... file.name.n
CLOSE ALL FILES
In its first form the CLOSE command causes only the named file(s) to be closed. With the second form, all files defined in the environment description are closed.
In the case of an input file the CLOSE command causes appropriate "housekeeping " operations such as:
- The record count is compared with the count in the end-of-file label if label records are present and if end of file has been reached. If the count does not agree, notification is given through external display. If the tape is not at end of file the record count is ignored.
- If the file is on tape, a rewind is initiated.
- The storage area allocated to the file is released for the use of other files.
If the addressed file is an output file, operations such as the following occur:
- Any remaining information belonging to that file is written.
- If specified by the programmer, an end-of-file label containing the record count is written.
- The tape is rewound (if the file is on tape).
- The storage area is released for the use of other files.
Each file which has been opened must ultimately be closed.
Examples of the CLOSE command are:
CLOSE INVENTORY.FILE, STATISTICS.
CLOSE ALL FILES.
Data Transmission Commands
The transmission of data from one area of storage to another is implicit in the functioning of a number of the Commercial Translator verbs. For example, the SET verb requires the transmission of result data after the computation has been performed. Except for one verb, however, such transmission is incidental to the main purpose. It is the MOVE verb which has as its primary function the transmission , or movement, of data from one area of storage to one or more other areas. MOVE and its alternate form, MOVE CORRESPONDING, are used in writing the two data transmission commands, which are described in the following paragraphs.
