The TYPE Clause (Report Writer)

The TYPE clause specifies the particular type of report group that is described by this entry and indicates the time at which the report group is to be processed by the RWCS.

General Format


Syntax for the General format of the TYPE clause

Syntax Rules

  1. RH is an abbreviation for REPORT HEADING. PH is an abbreviation for PAGE HEADING. CH is an abbreviation for CONTROL HEADING. DE is an abbreviation for DETAIL. CF is an abbreviation for CONTROL FOOTING. PF is an abbreviation for PAGE FOOTING. RF is an abbreviation for REPORT FOOTING.
  2. REPORT HEADING, PAGE HEADING, CONTROL HEADING FINAL, CONTROL FOOTING FINAL, PAGE FOOTING, and REPORT FOOTING report groups can each appear no more than once in the description of a report.
  3. PAGE HEADING and PAGE FOOTING report groups can be specified only if a PAGE clause is specified in the corresponding report description entry.
  4. Data-name-1, data-name-2, and FINAL, if present, must be specified in the CONTROL clause of the corresponding report description entry.

    OSVS  This rule is not enforced with regard to FINAL.

    At most, one CONTROL HEADING report group and one CONTROL FOOTING report group can be specified for each data-name or FINAL in the CONTROL clause of the report description entry. However, neither a CONTROL HEADING report group nor a CONTROL FOOTING report group is required for a data-name or FINAL specified in the CONTROL clause of the report description entry.

  5. In CONTROL FOOTING, PAGE HEADING, PAGE FOOTING, AND REPORT FOOTING report groups, SOURCE clauses and USE statements must not reference any of the following:
    1. Group data items containing a control data item.
    2. Data items subordinate to a control data item.
    3. A redefinition or renaming of any part of a control data item.

    In PAGE HEADING and PAGE FOOTING report groups, SOURCE clauses and USE statements must not reference control data-names.

  6. When a GENERATE report-name statement is specified in the Procedure Division, the corresponding report description entry must include no more than one DETAIL report group. If no GENERATE data-name statements are specified for such a report, a DETAIL report group is not required.
  7. The description of a report must include at least one body group.

General Rules

  1. DETAIL report groups are processed by the RWCS as a direct result of GENERATE statements. If a report group is other than TYPE DETAIL its processing is an automatic RWCS function.
  2. The REPORT HEADING phrase specifies a report group that is processed by the RWCS only once, per report, as the first report group of that report. The REPORT HEADING report group is processed during the execution of the chronologically first GENERATE statement for that report.
  3. The PAGE HEADING phrase specifies a report group that is processed by the RWCS as the first report group on each page of that report except under the following conditions:
    1. A PAGE HEADING report group is not processed on a page that is to contain only a REPORT HEADING report group or only a REPORT FOOTING report group.
    2. A PAGE HEADING report group is processed as the second report group on a page when it is preceded by a REPORT HEADING report group that is not to be presented on a page by itself.

    (See the section Presentation Rules Tables.)

  4. The CONTROL HEADING phrase specifies a report group that is processed by the RWCS at the beginning of a control group for a designated control data-name or, in the case of FINAL, is processed during the execution of the chronologically first GENERATE statement for that report. During the execution of any GENERATE statement at which the RWCS detects a control break, any CONTROL HEADING report groups associated with the highest control level of the break and lower levels are processed.
  5. The DETAIL phrase specifies a report group that is processed by the RWCS when a corresponding GENERATE statement is executed.
  6. The CONTROL FOOTING phrase specifies a report group that is processed by the RWCS at the end of a control group for a designated control data-name.

    In the case of FINAL, the CONTROL FOOTING report group is processed only once per report as the last body group of that report. During the execution of any GENERATE statement in which the RWCS detects a control break, any CONTROL FOOTING report group associated with the highest level of the control break or more minor levels is presented. All CONTROL FOOTING report groups are presented during the execution of the TERMINATE statement if there has been at least one GENERATE statement executed for the report. (See the section The TERMINATE Statement.)

  7. The PAGE FOOTING phrase specifies a report group that is processed by the RWCS as the last report group on each page except under the following conditions:
    1. A PAGE FOOTING report group is not processed on a page that is to contain only a REPORT HEADING report group or only a REPORT FOOTING report group.
    2. A PAGE FOOTING report group is processed as the second to last report group on a page when it is followed by a REPORT FOOTING report group that is not to be processed on a page by itself.

    (See the section Presentation Rules Tables.)

  8. The REPORT FOOTING phrase specifies a report group that is processed by the RWCS only once per report and as the last report group of that report. The REPORT FOOTING report group is processed during the execution of a corresponding TERMINATE statement, if there has been at least one GENERATE statement executed for the report. (See the section The TERMINATE Statement.)
  9. The sequence of steps that the RWCS executes when it processes a REPORT HEADING, PAGE HEADING, CONTROL HEADING, PAGE FOOTING, or REPORT FOOTING report group is described below.
    1. If a USE BEFORE REPORTING procedure references the data-name of the report group, the USE procedure is executed.
    2. If a SUPPRESS statement has been executed or if the report group is not printable, no further processing is done for the report group.
    3. If a SUPPRESS statement has not been executed and the report group is printable, the RWCS formats the print lines and presents the report group according to the presentation rules for that type of report group. (See the section Presentation Rules Tables.)
  10. The sequence of steps that the RWCS executes when it processes a CONTROL FOOTING report group is described below.

    The GENERATE rules specify that when a control break occurs, the RWCS produces the CONTROL FOOTING report groups beginning at the minor level, and proceeding upwards, through the level at which the highest control break was sensed. In this regard, it should be noted that even though no CONTROL FOOTING report group has been defined for a given control data-name, the RWCS will still have to execute the step described in rule 10f below if a RESET phrase in the report description specifies that control data-name.

    1. Sum counters are crossfooted; that is, all sum counters defined in this report group that are operands of SUM clauses in the same report group are added to their sum counters. (See the section The SUM Clause.)
    2. Sum counters are rolled forward; that is, all sum counters defined in the report group that are operands of SUM clauses in higher level CONTROL FOOTING report groups are added to the higher level sum counters. (See the section The SUM Clause.)
    3. If a USE BEFORE REPORTING procedure references the data-name of the report group the USE procedure is executed.
    4. If a SUPPRESS statement has been executed or if the report group is not printable, the RWCS next executes the step described in rule 10e below.
    5. If a SUPPRESS statement has not been executed and the report group is printable, the RWCS formats the print lines and presents the report group according to the presentation rules of CONTROL FOOTING report groups.
    6. Then the RWCS resets those sum counters that are to be reset when the RWCS processes this level in the control hierarchy. (See the section The SUM Clause.)
  11. The DETAIL report group processing that the RWCS system executes in response to a GENERATE data-name statement is described in rules 11a through 11e below.

    When the description of a report includes exactly one DETAIL report group, the detail-related processing that the RWCS executes in response to a GENERATE report-name statement is described in rules 11a through 11e below. These steps are performed as though a GENERATE data-name statement were being executed.

    When the description of a report includes no DETAIL report groups, the detail-related processing that the RWCS executes in response to a GENERATE report-name statement is described in rule 11a below. This step is performed as though the description of the report included exactly one DETAIL report group, and a GENERATE data-name statement were being executed.

    1. The RWCS performs any subtotalling that has been designated for the DETAIL report group. (See the section The SUM Statement.)
    2. If a USE BEFORE REPORTING procedure refers to the data-name of the report group, the USE procedure is executed.
    3. If a SUPPRESS statement has been executed or if the report group is not printable no further processing is done for the report group.
    4. If the DETAIL report group is being processed as a consequence of a GENERATE report-name statement, no further processing is done for the report group.
    5. If neither 11c nor 11d above applies, the RWCS formats the print lines and presents the report group according to the presentation rules for DETAIL report groups. (See the section Presentation Rules Tables.)
  12. When the RWCS is processing a CONTROL HEADING, CONTROL FOOTING, or DETAIL report group, as described in General Rules 9, 10, and 11, the RWCS may have to interrupt the processing of that body group after determining that the body group is to be presented, and execute a page advance ( and process PAGE FOOTING and PAGE HEADING report groups) before actually presenting the body group.
  13. During control break processing, the values of control data items that the RWCS used to detect a given control break are referred to as prior values.
    1. During control break processing of a CONTROL FOOTING report group, any references to control data items in a USE procedure or SOURCE clause associated with that CONTROL FOOTING report group are supplied with prior values.
    2. When a TERMINATE statement is executed, the RWCS makes the prior control data item values available to SOURCE clause or USE procedure references in CONTROL FOOTING and REPORT FOOTING report groups as though a control break had been detected in the highest control data-name.
    3. All other data item references in report groups and their USE procedures access the current values that are contained in the data items at the time the report group is processed.