The STOP statement terminates processing before the end of the input file.

STOP {AFTER numrec RECORDS | PASS}.
  • AFTER numrec RECORDS
    Stops processing the input file after numrec records are selected -- that is, after numrec statements pass any SELECT and IGNORE conditions.
    When developing and testing report control files, use the STOP AFTER numrec RECORDS statement to save time in trial runs.
  • PASS
    Terminates processing of the input file. Use PASS when significant data is in a known order and no more data needs to be checked.

Examples

The following examples show how to use the STOP statement to halt processing before the end of the input file is reached:

  • To stop processing after VMRGRW selects seven records, add this statement to the control file:

    STOP AFTER 7 RECORDS.
    
  • To stop processing after VMRGRW encounters a record with the FLAG1 field set to X'FF', add these statements to the control file:

    IF FLAG EQ X'FF'.
         STOP PASS.
    END IF.