ILE COBOL Language Reference

REEL or UNIT Phrase

When the REEL or UNIT phrase is specified for an output file, it indicates that a sequential multivolume file is being created, and that no more records are to be written to the current volume of the file. The following processing takes place:

  1. Standard labels are written at the end of the current volume.
  2. A message is issued asking for a new volume to be mounted to receive the continuation of the file.
  3. Standard labels are written at the start of the new volume.
  4. The next WRITE statement that is processed writes a record to the newly mounted volume.

When the REEL or UNIT phrase is specified for a sequential multivolume file that is open for input, the current volume is positioned to read the standard labels. If this is the last volume of the file, the program continues, and the next READ statement that is processed will cause the AT END condition to occur. If this is not the last volume of the file:

  1. A message is issued asking for the next volume of the file to be mounted.
  2. The standard labels at the start of the next volume are processed.
  3. The next READ statement that is processed requests the first record on the newly mounted volume.

The REEL or UNIT phrase is optional for sequential single volume files open for input. It is syntax-checked only, and performs no function at run time.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]