Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

General description of the Data Division

The output file to which the report is to be written must be declared in the Data Division by means of a file description (FD) entry, which also contains the names of the reports (see section "REPORT clause").

The REPORT SECTION, which defines the format and content of each report, must be specified as the last section of the Data Division. This section contains two types of entries:

  1. The report description (RD).
    It must specify the name of the report. A page format (PAGE LIMIT clause), a character (CODE clause) preceding each line of the report (not to be printed, however), and a hierarchy of control data items (CONTROL clause) may also be supplied here.

  2. The report group description entry.
    It describes, for instance, the print fields of a report group; that is, data items with line and column positioning into which data will be entered either directly (VALUE) or indirectly (sending field, sums).

The report description entry is used to specify the format of a page by defining the number of lines per page as well as the line numbers as vertical boundaries of the region within which each type of report group may be printed. These entries are used to control the positioning of the various report groups at the time the report is produced.

Detail report groups are structured by specifying control data items in their hierarchical order.

Detail report groups, which are functionally related to the hierarchical items, are combined into several groups in the order in which they are created, so that all detail report groups within a given group are assigned the same value of the hierarchically lowest item. Depending on whether a control heading and/or control footing is defined for this level of hierarchy, each group is introduced by the control heading and is terminated by the control footing (which generally contains information applicable only to the current group, e.g. subtotals).

Similarly, when another hierarchical item occurs, the above series of detail report groups is, in turn, combined into groups, now governed by the next highest item in the hierarchy, etc.

This structure is generated by the Report Writer as follows:

before creating a detail report group, the Report Writer tests the control data items in their hierarchical order, from top to bottom. As soon as it detects a change in value, i.e. a control break, all existing control footings are created in hierarchical order from bottom to top, up to the level where the first change in value was encountered. This is followed by all existing control headings on the same level in reversed hierarchical order, and finally, by the detail report group itself.

The specification of control data items in conjunction with the report groups "control heading" and "control footing" thus enables the user to have the report produced in a structured format.

The report group description entry, formally similar to a record description, is used to describe the properties of all data items in the report. Beyond the ordinary framework of COBOL language elements for the description of data items, a report data item is assigned line and column, i.e. a page position; in other words, the data item is declared to be a print field. Each of these fields receives information.

Three types of information may be supplied:

SOURCE information (SOURCE clause information), which is available through a data item defined outside the REPORT SECTION.

SUM information (SUM clause information), as a result of adding up data representing, in turn, SOURCE information and/or SUM information.

VALUE information (VALUE clause information), as a predefined information value.

Since a given report may contain several types of report groups, the report group description specifies the type of the report group. The seven types that may be used are shown in table 38.

With its report and all associated report group description entries, the report is completely described as to its format and content (including the summation operations required); that is, all prerequisites to writing the report are met.

Type

Definition

REPORT HEADING

A report group that is written only once, as the first group of the report.

REPORT FOOTING

A report group that is written only once, as the last group of the report.

PAGE HEADING

A report group written at the top of each page. Exceptions:

  1. The page heading is written after the report heading.

  2. The page heading is suppressed when the page is explicitly reserved for the report heading or footing.

PAGE FOOTING

A report group written at the bottom of each page (exceptions: same as page heading).

DETAIL

This report group type is the only one which is not produced automatically but must be specified in a GENERATE statement. Each execution of this statement produces the specified detail report group at object time.

CONTROL HEADING

This report group is generated as a heading group for a series of detail report groups, due to a control break.

CONTROL FOOTING

This report group is generated as a footing group for a series of detail report groups, due to a control break. It usually sums up data concerning the preceding series of detail report groups.

Table 38: Report group types used in report group description