Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

RERUN clause

Function

A RERUN clause indicates where and when restart-point records are to be issued. A restart-point record describes the status of a program at a specified point during program execution. It is produced automatically by the operating system upon the request of the program and contains all information necessary to restart the program from that point. The RERUN clause controls such requests by the COBOL object.
For further information on the RERUN clause, see "COBOL2000 User Guide" [1].

The RERUN clause in the I-O CONTROL paragraph enables programs containing a SORT or MERGE statement to be restarted.

Format 1 for sequential file organization


RERUN [ON {file-name-1 | implementor-name}]
       EVERY {  { [END OF] {REEL | UNIT} | integer-1 RECORDS } OF file-name-2
              | integer-2 CLOCK-UNITS
              | condition-name
             }


Format 2 for relative and indexed file organization


RERUN [ON {implementor-name | file-name-1}]
       EVERY {  integer-1 RECORDS OF file-name-2
              | integer-2 CLOCK-UNITS
              | condition-name
             }


Syntax rules

  1. file-name-1 must be the name of a sequential tape file; it must be described in the FILE SECTION.

  2. implementor-name has the format
    SYSnnn
    where 000 <= nnn <= 244
    nnn determines the processing mode.
    If nnn >= 200, restart points are written alternately to two restart files. This enables the restart to be made from the two most recent restart points.

  3. If the same implementor-name is also used in the SELECT clause, it must be associated with a tape file.

  4. The END OF REEL/UNIT phrase may be used only when file-name-2 describes a sequential file. REEL and UNIT are synonymous.

  5. implementor-name must be specified in the RERUN clause when integer-1 RECORDS or integer-2 CLOCK-UNITS is used.

  6. Subject to the following restrictions, more than one RERUN clause may be specified for the same file-name-2:

    1. When specifying more than one integer-1 RECORDS phrase, the same file-name-2 must appear only once in them.

    2. When specifying more than one END OF REEL or END OF UNIT phrase, the same file-name-2 must appear only once in them.

  7. file-name-1 or implementor-name specifies the file to which the restart points are to be output.

  8. Restart points are written as follows:

    1. If file-name-1 is specified, the restart points are output to each reel or volume assigned to file-name-1.

    2. If implementor-name is specified, the restart points are written as follows:When implementor-name is assigned to a file-name from the SELECT clause, the file involved must be a tape file. The effect on restart point generation is the same as if the file-name had been specified directly in the RERUN clause (see 8a).

      When implementor-name is not assigned to a file from a SELECT clause, a disk storage file must be assigned at runtime; otherwise, a file with the name progid.RERUN.implementor-name is assigned by the runtime system. Only in this case will restart points be written to disk storage.

    3. If the same SYS numbers are specified in the ASSIGN clause and in the RERUN END OF REEL clause, the restart point is written to the end of the output tape.

  9. There are four types of RERUN clauses, depending on the conditions under which restart points are requested.

    1. END OF REEL or END OF UNIT without specification of the ON clause: the restart points are written to file-name-2, which must specify an output file.

    2. END OF REEL or END OF UNIT with file-name-1 specified in the ON clause: the restart points are written to file-name-1, which must refer to an output file. Additionally, the usual end-of-reel handling is carried out for file-name-2. file-name-2 may be an input or output file.

    3. END OF REEL or END OF UNIT with implementor-name in the ON clause: The restart points are written to a separate file (see 8b). file-name-2 may be an input or an output file.

    4. integer-1 RECORDS: The restart points are written to the file specified by file-name1 or implementor-name, respectively, whenever integer-1 records have been processed. File-name-2 may be either an input or an output file with any organization or type of access; it must not be referenced in the USING/GIVING phrase or in an INPUT/OUTPUT procedure during sort (see section "Sorting records" ).

  10. The CLOCK-UNITS phrase is treated by the compiler as a comment.
  11. The condition-name phrase is also treated by the compiler as a comment.
  12. If an external file is specified by file-name-1, the behavior is undefined.

Format 3 for sorting records


RERUN ON {file-name-1 | implementor-name} EVERY SORT [OF file-name-2 ... ]


Syntax rules

  1. file-name-2... must be defined in an FD entry.

  2. file-name-1 must not be defined in an FD entry.

  3. implementor-name must not appear in a SELECT clause.

General rules

  1. When the OF phrase is not specified, the checkpoint is written prior to each sort operation.

  2. When file-name-2 is specified, checkpoints are written for this specific sort operation only.