COMTRAN Reconstruction

F28-8043 · June 1960

Page 39

PDF page 45 of 124. Download the scanned PDF

The page as scanned

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

The text read off it

[page 39]

The OPEN Command

The OPEN command initiates the handling of one or more files. It may take either of two general forms:

OPEN file.name.1, file.name.2, ... file.name.n
OPEN ALL FILES

The first form of the command causes only the named file(s) to be opened. When the second form is used, all files specified in the environment description are opened. A given file must be opened, of course, before it can be addressed by a GET or FILE command.

If the file being opened is an input file, the following series of events occurs:

  1. The label record, if any, is read into storage and checked for validity according to the standard label-handling conventions.
  2. Subsequent records are brought into the portion of storage governed by the input/output control system, filling the area which has been allocated to the file.
  3. Checking is performed, and a record count is initiated.

In the case of an output file the following events occur:

  1. If specified by the programmer, a label record is created and written.
  2. Preparation is made to file data records in the output file as they become available in processing.
  3. Checking is performed, and a record count is initiated.

Some typical OPEN commands are:

OPEN INVENTORY.FILE.
OPEN ALL FILES.
OPEN STATISTICS, CUSTOMER.FILE, INVOICE.FILE.

The GET Command

The GET command is used to fetch records from an input storage area which is filled automatically from a file stored on tape or cards. The programmer need be concerned only with the use of single records since all auxiliary input operations such as

  • unblocking
  • tape alternation
  • tape identification
  • error checking
  • reading ahead

are automatically provided in the object program by the processor, based on information in the environment description.

The GET command may take either of two general forms:

GET RECORD FROM file.name
GET record.name

The first form of the command assumes that the specified input file contains more than one type of data record. The record obtained may be of any type, and the programmer must arrange to identify the type. The second form implies an input file containing only one type of data record: the record is obtained from the file associated with "record.name" in the environment description.