The GENERATE Statement
The GENERATE statement directs the RWCS to produce a report in
accordance with the Report Description specified in the Report Section of the
Data Division.
General Format

Syntax Rules
-
Data-name-1 must name a TYPE DETAIL report group and can
be qualified by a report-name.
- Report-name-1 can be used only if the referenced report
description contains:
- A CONTROL clause, and
- Not more than one DETAIL report group, and
- At least one body group.
General Rules
-
In response to a GENERATE report-name-1 statement, the
RWCS performs summary processing. If all of the GENERATE statements that are
executed for a report are of the form GENERATE report-name-1, then the report
that is produced is called a summary report.
- In response to a GENERATE data-name-1 statement, the RWCS
performs detail processing that includes certain processing that is specific
for the DETAIL report group designated by the GENERATE statement. Normally, the
execution of a GENERATE data-name-1 statement causes the RWCS to present the
designated DETAIL report group.
- During the execution of the chronologically first GENERATE
statement for a given report, the RWCS saves the values in the control data
items. During the execution of the second and subsequent GENERATE statements
for the same report, and until a control break is detected, the RWCS utilizes
this set of control values to determine whether a control break has occurred.
When a control break occurs, the RWCS saves the new set of control values,
which it thereafter uses to sense for a control break until another control
break occurs.
- During the report presentation, an automatic function of the RWCS
is to process PAGE HEADING and PAGE FOOTING report groups, if defined, when the
RWCS must advance the report to a new page for the purpose of presenting a body
group. (See the section
Presentation Rules Tables)
- When the chronologically first GENERATE statement for a given
report is executed, the RWCS processes, in order, the report groups that are
named below, provided that such report groups are defined in the report
description. The RWCS also processes PAGE HEADING and PAGE FOOTING report
groups as described in General Rule 4. The actions taken by the RWCS when it
processes each type of report group are explained under the appropriate
paragraph. (See the section
The TYPE Clause.)
- The REPORT HEADING report group is processed.
- The PAGE HEADING report group is processed.
- All CONTROL HEADING report groups are processed from major to
minor.
- If a GENERATE data-name-1 statement is being executed, the
processing for the designated DETAIL report group is performed. If a GENERATE
report-name-1 statement is being executed, certain of the steps that are
involved in the processing of a DETAIL report group are performed. (See the
section
The TYPE Clause.)
- When a GENERATE statement other than the chronologically first is
executed for a given report, the RWCS performs the steps enumerated below, as
applicable. The RWCS also processes PAGE HEADING and PAGE FOOTING report groups
as described in General Rule 4. The actions taken by the RWCS when it processes
each type of report group are explained under the appropriate paragraph. (See
the section
The TYPE Clause.)
- Sense for control break. The rules for determining the
equality of control data items are the same as those specified for relation
conditions. If a control break has occurred then:
- Enable the CONTROL FOOTING USE procedures and CONTROL
FOOTING SOURCE clauses to access the control data item values that the RWCS
used to detect a given control break. (See the section
The TYPE Clause.)
- Process the CONTROL FOOTING report groups in the order
minor to major. Only CONTROL FOOTING report groups that are not more major than
the highest level at which a control break occurred are processed.
- Process the CONTROL HEADING report groups in the order
major to minor. Only the CONTROL HEADING report groups that are not more major
than the highest level at which a control break occurred are processed.
- If a GENERATE data-name-1 statement is being executed, the
processing for the designated DETAIL report group is performed. If a GENERATE
report-name-1 statement is being executed, certain of the steps that are
involved in the processing of a DETAIL report group are performed. (See the
section
The TYPE Clause.)
- GENERATE statements for a report can be executed only after an
INITIATE statement for the report has been executed and before a TERMINATE
statement for the report has been executed.