The CONTROL clause establishes the levels of the control hierarchy for the report.
General Format
Syntax Rules
- Data-name-1 must not be defined in the Report Section. Data-name-1 can be qualified.
- Each recurrence of data-name-1 must identify a different data item.
- Data-name-1 must not have subordinate to it a variable occurrence data item.
General Rules
- Data-name-1 and the word FINAL specify the levels of the control hierarchy. FINAL, if specified, is the highest control, data-name-1 is the major control, the next recurrence of data-name-1 is an intermediate control, and so on. The last recurrence of data-name-1 is the minor control.
- The execution of the chronologically first GENERATE statement for a given report causes the RWCS to save the values of all control data items associated with that report. On subsequent executions of all GENERATE statements for that report, control data items are tested by the RWCS for a change of value. A change of value in any control data item causes a control break to occur. This control break is associated with the highest level for which a change of value is noted. (See the section The GENERATE Statement.)
- The RWCS tests for a control break by comparing the content of each control data item with the prior content of each control data item that was saved when the previous GENERATE statement for the same report was executed. The RWCS applies the inequality relation test as follows:
- If the control data item is a numeric data item, the relation test is for the comparison of two numeric operands.
- If the control data item is an index data item, the relation test is for the comparison of two index data items.
- If the control data item is a data item other than as described in 3a and 3b above, the relation test is for the comparison of two nonnumeric operands.
The relation test is further explained in the appropriate paragraph. (See the topic Relation Condition.)
- FINAL is used when the most inclusive control group in the report is not associated with a control data-name.