Previous Topic: General Storage Area (GSA) DefinitionNext Topic: Report Definition


Data Manipulation/File Reading

Data Manipulation and File Reading commands must appear after the Input File Definition or GSA Definition commands, but before the Report Specification or Output File Definition commands. This section of the program is responsible for all activity to be performed prior to a sort, the printing of a single line on the report, or the output of a single record.

The Reporting Facility recognizes the first command in this area as the first procedural keyword. The system works in a cyclical manner when operating in Primary, Secondary, or Write Only modes. In other words, when a complete input record set must be made available, you can either ignore the set completely, or pass it through the selection criteria specified in the SELECT commands in either the report definition groups or the subsequent output file definition section.

The predefined label START is logically attached to the first procedural keyword in this section of the program. A branch to START ignores the current record set and reads a new record set without passing the record set through the SELECT criteria. Another predefined label, TEST, is automatically assigned by the system and is logically attached to the first SELECT command. Encountering a branch to TEST in the program indicates that the current record set will be tested against the SELECT criteria. When the system completes its analysis of the record set, it takes an automatic branch to START to begin reading the next record set. The combination of these two predefined labels provides multiple options for selecting input data.

The following is a basic diagram of the Data Manipulation and File Reading commands within a program:

         ┌────────┐
         │        │
         │    1   │ Run Control
         │        │
         ├────────┤
         │        │
         │   2A   │ Input File Definition
         │        │
         ├────────┤
         │        │
         │   2B   │ GSA Definition
         │        │
         ├────────┤
         │        │
START:   │    3   │ Data Manipulation/File Reading
         │        │
         ├────────┤
         │        │
 TEST:   │ 4A,4B  │ Report Definition/Output File Definition
         │        │
         └────────┘