Compaq COBOL AAQ2G1FTK User Manual

Page 341

Advertising
background image

Producing Printed Reports

10.8 Programming a Report Writer Report

If no GENERATE statement has been executed for the report, the TERMINATE
statement does not produce any report groups.

A second TERMINATE statement for the report must not be executed before a
second INITIATE statement for the report has been executed.

The TERMINATE statement does not close the report file; a CLOSE statement
must be executed after the TERMINATE statement.

Figure 10–13 shows the sequence of operations for TERMINATE.

Figure 10–13 TERMINATE Statement

add and save

all SUM

sum−names

save

control

values

write control
footing from

minor to major

set controls

to new values

reset SUM

operands up

to major level

produce CF

FINAL group

ZK−1554−GE

produce

PF group

produce

RF group

TERMINATE

10.8.13.5 Applying the USE BEFORE REPORTING Statement

In a COBOL program, you specify a Declarative section to define procedures
that supplement the standard procedures of the program. Note that in a Report
Writer program, you can specify the USE BEFORE REPORTING statement. This
USE BEFORE REPORTING statement gives you more control over the data to be
printed in a Report Writer program.

The USE BEFORE REPORTING statement:

Allows you to define declarative procedures

Causes those procedures to be executed just before a specified report group is
printed (this specified report group name is written with the USE statement)

Lets you modify the data to be printed (for example, where simple sum
operations must be augmented by more complex operations involving
multiplication, division, and subtraction)

Lets you suppress printing the report group

Producing Printed Reports 10–41

Advertising