Data Division in the Report Writer Module [ COBOL/HP-UX Language Reference for the Series 700 and 800 ] MPE/iX 5.0 Documentation
COBOL/HP-UX Language Reference for the Series 700 and 800
Data Division in the Report Writer Module
The File Description Entry
Function
The file description entry furnishes information concerning the physical
structure, identification, and record names pertaining to a given file.
________________________________________________________________________
|(ANS85) |
|It determines the internal or external attributes of a file connector,|
|of the associated data records, and of the associated data items. The|
|file description entry also determines whether a file-name is a local |
|name or a global name. |
________________________________________________________________________
General Format
Syntax Rules
1. The level indicator FD identifies the beginning of the file
description entry for a report file and must precede the file-name
of the report file.
2. The clauses which follow file-name-1 can appear in any order.
3. File-name-1 can only reference a sequential file.
4. No record description entries can follow the file description
entry for a report file.
________________________________________________________________________
|Record description entries are permitted. (OSVS) (MF) |
________________________________________________________________________
5. The subject of a file description entry that specifies a REPORT
clause can be referenced in the procedure division only by the USE
statement, the CLOSE statement, or the OPEN statement with the
OUTPUT or EXTEND phrase.
General Rules
1. With the exception of the REPORT clause, all clauses within the
file description entry for a report file are presented within the
sequential I-O module.
2. Details on the REPORT clause are presented below.
The REPORT Clause
Function
The REPORT clause specifies the names of reports that comprise a report
file.
General Format
Syntax Rules
1. Each report-name specified in a REPORT clause must be the subject
of a RD entry in the report section of the same program. The
order of appearance of the report-names is not significant.
2. A report-name must appear in only one REPORT clause.
3. The subject of a file description entry that specifies a REPORT
clause can be referenced in the procedure division only by the USE
statement, the CLOSE statement, or the OPEN statement with the
OUTPUT or EXTEND phrase.
General Rules
1. The presence of more than one report-name in a REPORT clause
indicates that the file contains more than one report.
2. After execution of an INITIATE statement and before the execution
of a TERMINATE statement for the same report file, the report file
is under the control of the RWCS. While a report file is under the
control of the RWCS, no input-output statement can be executed
which references that report file.
________________________________________________________________________
|(ANS85) |
| |
| |
| |
|3. If the associated file connector is an external file connector, |
| every file description entry in the run unit which is associated |
| with that file connector must describe it as a report file. |
| |
________________________________________________________________________
Report Section
The Report Section is located in the Data Division of a source program.
The Report Section describes the reports to be written onto report files.
The description of each report must begin with a RD entry and be followed
by one or more report group description entries.
General Format
REPORT SECTION.
[report-description-entry {report-group-description-entry}...]...
Report Description Entry.
In addition to naming the report, the RD entry defines the format of each
page of the report by specifying the vertical
boundaries of the region within which each type of report group can be
printed. The RD entry also specifies the control data items. When the
report is produced, changes in the values of the control data items cause
the detail information of the report to be processed in groups called
control groups.
Each report named in the REPORT clause of a file description entry in the
file section must be the subject of a RD entry in the report section.
Furthermore, each report in the report section must be named in one and
only one file description entry.
Report Group Description Entry.
The report groups that will comprise the report are
described following the RD entry. The description of each report group
begins with a report group description entry; that is an entry that has a
01 level-number and a TYPE clause. Subordinate to the report group
description entry, there can appear group and elementary entries that
further describe the characteristics of the report group.
The Report Description Entry
Function
The RD entry names a report, specifies any identifying characters to be
appended to each print line in the report and describes the physical
structure and organization of that report.
________________________________________________________________________
|[REV BEG](ANS85) |
|It also determines whether a report-name is a local name or a global |
|name.[REV END] |
________________________________________________________________________
General Format
Syntax Rules
1. Report-name-1 must appear in one and only one REPORT clause.
2. The order of appearance of the clauses following report-name-1 is
immaterial.
3. Report-name-1 is the highest permissible qualifier that can be
specified for LINE-COUNTER, PAGE-COUNTER, and all data-names
defined within the report section.
General Rules
1. The CODE clause, the CONTROL clause, and the PAGE clause are
presented in alphabetical order below.
________________________________________________________________________
|[REV BEG](ANS85) |
| |
| |
| |
|2. If the RD entry contains the GLOBAL clause, the special registers |
| LINE-COUNTER and PAGE-COUNTER are global names. |
| |
|[REV END] |
________________________________________________________________________
PAGE-COUNTER Rules
1. PAGE-COUNTER is the reserved word used to reference a special
register that is automatically created for each report specified
in the report section. (See "Special Register PAGE-COUNTER"
earlier in this chapter.)
2. In the report section, a reference to PAGE-COUNTER can appear only
in a SOURCE clause. In the procedure division, PAGE-COUNTER can
be used in any context in which a data item with an integer value
can appear.
3. If more than one PAGE-COUNTER exists in a program, PAGE-COUNTER
must be qualified by a report-name whenever it is referenced in
the Procedure Division.
In the report section an unqualified reference to PAGE-COUNTER is
qualified implicitly by the name of the report in whose RD entry
the reference is made. Whenever the PAGE-COUNTER of a different
report is referenced, PAGE-COUNTER must be explicitly qualified by
the report-name associated with the different report.
4. Execution of the INITIATE statement causes the RWCS to set the
PAGE-COUNTER of the referenced report to one.
5. PAGE-COUNTER is automatically incremented by one each time the
RWCS executes a page advance.
6. PAGE-COUNTER can be altered by Procedure Division statements.
LINE-COUNTER Rules
1. LINE-COUNTER is the reserved word used to reference a special
register that is automatically created for each report specified
in the Report Section. (See the section "Special Register
LINE-COUNTER" earlier in this chapter.)
2. In the report section a reference to LINE-COUNTER can appear only
in a SOURCE clause. In the Procedure Division, LINE-COUNTER can
be used in any context in which a data item with an integral value
can appear. However, only the RWCS can change the content of
LINE-COUNTER.
3. If more than one LINE-COUNTER exists in a program, LINE-COUNTER
must be qualified by a report-name whenever it is referenced in
the Procedure Division.
In the Report Section an unqualified reference to LINE-COUNTER is
qualified implicitly by the name of the report in whose
description entry the reference is made. Whenever the
LINE-COUNTER of a different report is referenced, LINE-COUNTER
must be explicitly qualified by the report-name associated with
the different report.
4. Execution of an INITIATE statement causes the RWCS to set the
LINE-COUNTER of the referenced report to zero. The RWCS also
automatically resets LINE-COUNTER to zero each time it executes a
page advance.
5. The value of LINE-COUNTER is not affected by the processing of
nonprintable report groups nor by the processing of a printable
report group whose printing is suppressed by means of the SUPPRESS
statement.
6. At the time each print line is presented, the value of
LINE-COUNTER represents the line number on which the print line is
presented. The value of LINE-COUNTER after the presentation of a
report group is governed by the presentation rules for the report
group. (See the section "Presentation Rules Tables" later in
this chapter.)
The CODE Clause
Function
The CODE clause specifies a two-character literal that identifies each
print line as belonging to a specific report.
General Format
Syntax Rules
1. Literal-1 must be a two-character nonnumeric literal.
________________________________________________________________________
|(OSVS) |
|Literal-1 must be replaced by a mnemonic specified in the |
|special-names paragraph. |
________________________________________________________________________
2. If the CODE clause is specified for any report in a file, it must
be specified for all reports in that file.
General Rules
1. When the CODE clause is specified, literal-1 is automatically
placed in the first two character positions of each report writer
logical record.
2. The positions occupied by literal-1 are not included in the
description of the print line, but are included in the logical
record size.
The CONTROL Clause
Function
The CONTROL clause establishes the levels of the control hierarchy for
the report.
General Format
Syntax Rules
1. Data-name-1 must not be defined in the Report Section.
Data-name-1 can be qualified.
2. Each recurrence of data-name-1 must identify a different data
item.
3. Data-name-1 must not have subordinate to it a variable occurrence
data item.
General Rules
1. 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.
2. 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" later in this chapter.)
3. 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. T he RWCS applies the inequality
relation test as follows:
a. If the control data item is a numeric data item, the
relation test is for the comparison of two numeric
operands.
b. If the control data item is an index data item, the
relation test is for the comparison of two index data
items.
c. 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 inequality relation test is further explained in the
appropriate paragraph. See the section Relation Condition in the
chapter The Nucleus.)
4. FINAL is used when the most inclusive control group in the report
is not associated with a control data-name.
The PAGE Clause
Function
The PAGE clause defines the length of a page and the vertical
subdivisions within which report groups are presented.
General Format
Syntax Rules
1. The HEADING, FIRST DETAIL, LAST DETAIL, and FOOTING
phrases can be written in any order.
2. Integer-1 must not exceed three significant digits in length.
3. Integer-2 must be greater than or equal to one.
4. Integer-3 must be greater than or equal to integer-2.
5. Integer-4 must be greater than or equal to integer-3.
6. Integer-5 must be greater than or equal to integer-4.
7. Integer-1 must be greater than or equal to integer-5.
8. The following rules indicate the vertical subdivision of the page
in which each type of report group can appear when the PAGE clause
is specified. (See the section "Page Regions" later in this
chapter.)
a. A report heading report group that is to be presented on a
page by itself, if defined, must be defined such that it
can be presented in the vertical subdivision of the page
that extends from the line number specified by integer-2 to
the line number specified by integer-1, inclusive.
A report heading report group that is not to be presented
on a page by itself, if defined, must be defined such that
it can be presented in the vertical subdivision of the page
that extends from the line number specified by integer-2 to
the line number specified by integer-3 minus 1, inclusive.
b. A page heading report group, if defined, must be defined
such that it can be presented in the vertical subdivision
of the page that extends from the line number specified by
integer-2 to the line number specified by integer-3 minus
1, inclusive.
c. A control heading or detail report group, if defined, must
be defined such that it can be presented in the vertical
subdivision of the page that extends from the line number
specified by integer-3 to the line number specified by
integer-4, inclusive.
d. A control footing report group, if defined, must be defined
such that it can be presented in the vertical subdivision
of the page that extends from the line number specified by
integer-3 to the line number specified by integer-5,
inclusive.
e. A page footing report group, if defined, must be defined
such that it can be presented in the vertical subdivision
of the page that extends from the line number specified by
integer-5 plus 1 to the line number specified by integer-1,
inclusive.
f. A report footing report group that is to be presented on a
page by itself, if defined, must be defined such that it
can be presented in the vertical subdivision of the page
that extends from the line number specified by integer-2 to
the line number specified by integer-1, inclusive.
A report footing report group that is not to be presented
on a page by itself, if defined, must be defined such that
it can be presented in the vertical subdivision of the page
that extends from the line number specified by integer-5
plus 1 to the line number specified by integer-1,
inclusive.
9. All report groups must be described such that they can be
presented on one page. The RWCS never splits a multi-line report
group across page boundaries.
General Rules
1. The vertical format of a report page is established using the
integer values specified in the PAGE clause.
a. Integer-1 defines the size of a report page by specifying
the number of lines available on each page.
b. HEADING integer-2 defines the first line number on which a
report heading or page heading report group can be
presented.
c. FIRST DETAIL integer-3 defines the first line number on
which a body group can be presented. Report heading and
page heading report groups cannot be presented on or beyond
the line number specified by integer-3.
d. LAST DETAIL integer-4 defines the last line number on which
a control heading or detail report group can be presented.
e. FOOTING integer-5 defines the last line number on which a
control footing report group can be presented. Page
footing and report footing report groups must follow the
line number specified by integer-5.
2. If the PAGE clause is specified the following implicit values are
assumed for any omitted phrases:
a. If the HEADING phrase is omitted, a value of one is assumed
for integer-2.
b. If the FIRST DETAIL phrase is omitted, a value equal to
integer-2 is given to integer-3.
c. If the LAST DETAIL and the FOOTING phrases are both
omitted, the value of integer-1 is given to both integer-4
and integer-5.
d. If the FOOTING phrase is specified and the LAST DETAIL
phrase is omitted, the value of integer-5 is given to
integer-4.
e. If the LAST DETAIL phrase is specified and the FOOTING
phrase is omitted, the value of integer-4 is given to
integer-5.
3. If the PAGE clause is omitted, the report consists of a single
page of indefinite length.
4. The presentation rules for each type of report group are specified
in the appropriate paragraph. (See the section "Presentation
Rules Tables" later in this chapter.)
Page Regions
Page regions that are established by the PAGE clause are described in the
table below.
Table 10-1. Page Regions
------------------------------------------------------------------------------
| | | |
| Report Groups that can be | First line no. | Last line no. of |
| presented in the Region | of the Region | the Region |
| | | |
------------------------------------------------------------------------------
| | | |
| Report heading described with NEXT | integer-2 | integer-1 |
| GROUP NEXT PAGE | | |
| | | |
| Report footing described with LINE | | |
| integer-1 NEXT PAGE | | |
| | | |
------------------------------------------------------------------------------
| | | |
| Report heading not described with | integer-2 | integer-3 |
| NEXT GROUP NEXT PAGE | | minus 1 |
| | | |
| Page heading | | |
| | | |
------------------------------------------------------------------------------
| | | |
| Control footing | integer-3 | integer-4 |
| | | |
| Detail | | |
| | | |
------------------------------------------------------------------------------
| | | |
| Control footing | integer-3 | integer-5 |
| | | |
------------------------------------------------------------------------------
| | | |
| Page footing | integer-5 plus 1 | integer-1 |
| | | |
| Report footing not described with | | |
| LINE integer-1 NEXT PAGE | | |
| | | |
------------------------------------------------------------------------------
The Report Group Description Entry
Function
The report group description entry specifies the characteristics of a
report group and of the individual items within a report group.
General Formats
Format 1
Format 2
Format 3
Syntax Rules
All Formats
1. The report group description entry can appear only in the Report
Section.
2. Except for the data-name clause, which when present must
immediately follow the level-number, the clauses can be written in
any sequence.
3. In Format 2 the level-number can be any integer from 02 to 48
inclusive. In Format 3 the level-number can be any integer from
02 to 49 inclusive.
4. A description of a report group can consist of one, two, three or
four hierarchic levels:
a. The first entry that describes a report group must be a
Format 1 entry.
b. Both Format 2 and Format 3 entries can be immediately
subordinate to a format 1 entry.
c. At least one Format 3 entry must be immediately subordinate
to a Format 2 entry.
d. Format 3 entries must define elementary data items.
5. In a Format 1 entry, data-name-1 is required only when:
a. A detail report group is referenced by a GENERATE
statement.
b. A detail report group is referenced by the UPON phrase of a
SUM clause.
c. A report group is referenced in a USE BEFORE REPORTING
sentence.
d. The name of a control footing report group is used to
qualify a reference to a sum counter.
If specified, data-name-1 can be referenced only by a GENERATE
statement, the UPON phrase of a SUM clause, a USE BEFORE REPORTING
sentence, or as a sum counter qualifier.
6. A Format 2 entry must contain at least one optional clause.
7. In a Format 2 entry, data-name-1 is optional. If present it can
be used only to qualify a sum counter reference.
8. In the Report Section, the USAGE clause is used only to declare
the usage of printable items.
a. If the USAGE clause appears in a Format 3 entry, that entry
must define a printable item.
b. If the USAGE clause appears in a Format 1 or Format 2
entry, at least one subordinate entry must define a
printable item.
9. An entry that contains a LINE NUMBER clause must not have a
subordinate entry that also contains a LINE NUMBER clause.
________________________________________________________________________
|(OSVS) |
|However an entry containing the LINE NUMBER NEXT PAGE clause can have |
|a subordinate entry containing a LINE NUMBER clause but without the |
|NEXT PAGE option. |
________________________________________________________________________
10. In Format 3:
a. A GROUP INDICATE clause can appear only in a type detail
report group.
b. A SUM clause can appear only in a type control footing
report group.
c. An entry that contains a COLUMN NUMBER clause but no LINE
NUMBER clause must be subordinate to an entry that contains
a LINE NUMBER clause.
d. Data-name-1 is optional but can be specified in any entry.
Data-name-1 can be referenced only if the entry defines a
sum counter.
e. An entry that contains a VALUE clause must also have a
COLUMN NUMBER clause.
11. The following table shows all permissible clause combinations for
a Format 3 entry. The table is read from left to right along the
selected row.
An "M" indicates that the presence of the clause is mandatory.
A "P" indicates that the presence of the clause is permitted, but
not required.
A blank indicates that the clause is not permitted.
Table 10-2. Permissible Clause Combinations in Format 3 Entries
------------------------------------------------------------------------------------------------------------------
| | | | | | | | | | | |
| PIC | COLUMN | SOURCE | SUM | VALUE | JUST | BLANK | GROUP | USAGE | SIGN | LINE |
| | | | | | | WHEN | INDICATE | | | |
| | | | | | | ZERO | | | | |
| | | | | | | | | | | |
------------------------------------------------------------------------------------------------------------------
| | | | | | | | | | | |
| M | | | M | | | | | | P | P |
| | | | | | | | | | | |
------------------------------------------------------------------------------------------------------------------
| | | | | | | | | | | |
| M | M | | M | | | P | | P | P | P |
| | | | | | | | | | | |
------------------------------------------------------------------------------------------------------------------
| | | | | | | | | | | |
| M | M | | M | | | P | | P | P | P |
| | | | | | | | | | | |
------------------------------------------------------------------------------------------------------------------
| | | | | | | | | | | |
| M | P | M | | | P | | P | P | P | P |
| | | | | | | | | | | |
------------------------------------------------------------------------------------------------------------------
| | | | | | | | | | | |
| M | P | M | | | | P | P | P | P | P |
| | | | | | | | | | | |
------------------------------------------------------------------------------------------------------------------
| | | | | | | | | | | |
| M | M | | | M | P | | P | P | P | P |
| | | | | | | | | | | |
------------------------------------------------------------------------------------------------------------------
General Rules
1. Format 1 is the report group entry. The report is defined by the
contents of this entry and all of its subordinate entries.
2. The BLANK WHEN ZERO clause, the JUSTIFIED clause, and the PICTURE
clause for the Report Writer module are the same as the BLANK WHEN
ZERO clause, the JUSTIFIED clause, and the PICTURE clause in the
nucleus. See the chapter The Nucleus for specifications. The
other clauses of the report group description entry are presented
in alphabetical order later in this chapter.
Presentation Rules Tables
Description.
The tables and rules on the following pages specify:
1. The permissible combinations of LINE NUMBER and NEXT GROUP clauses
for each type of report group.
2. The requirements that are placed on the use of these clauses, and
3. The interpretation that the RWCS gives to these clauses.
Organization.
There is an individual presentation rules table for each of the following
types of report groups: report heading, page heading, page footing,
report footing. In addition, detail report groups, control heading
report groups, or control footing report groups are treated jointly in
the body group presentation rules table. (See the section "Body Group
Presentation Rules" later in this chapter.)
Columns 1 and 2 of a presentation rules table list all of the permissible
combinations of LINE NUMBER and NEXT GROUP clauses for the designated
report group type. Consequently, for the purpose of identifying the set
of presentation rules that apply to a particular combination of LINE
NUMBER and NEXT GROUP clauses, a presentation rules table is read from
left to right, along the selected row.
The applicable rules columns of a presentation rules table are
partitioned into two parts. The first part specifies the rules that
apply if the report description contains a PAGE clause, and the second
part specifies the rules that apply if the PAGE clause is omitted. The
purpose of the rules named in the applicable rules columns is discussed
below:
1. Upper limit rules and lower limit rules.
These rules specify the vertical subdivisions of the page within
which the specified report group can be represented.
In the absence of a PAGE clause the printed report is not
considered to be partitioned into vertical subdivisions.
Consequently, within the tables no upper limit rule or lower limit
rule is specified for a report description in which the PAGE
clause is omitted.
2. Fit test rules.
The fit test rules are applicable only to body groups, and hence
fit test rules are specified only within the body group
presentation rules table. At object time the RWCS applies the fit
test rules to determine whether the designated body group can be
presented on the page to which the report is currently positioned.
However, even for body groups there are no fit test rules when the
PAGE clause is omitted from the report description entry.
3. First print line position rules.
The first print line position rules specify where on the report
medium the RWCS shall present the first print line of the given
report group.
The presentation rules tables do not specify where on the report
medium the RWCS shall present the second and subsequent print
lines (if any) of a report group. Certain general rules determine
where the second and subsequent print lines of a report group
shall be presented. Refer to the LINE NUMBER clause general rules
for this information.
4. Next group rules.
The next group rules relate to the proper use of the NEXT GROUP
clause.
5. Final LINE-COUNTER setting rules.
The terminal values that the RWCS places in LINE-COUNTER after
presenting report groups are specified by the final LINE-COUNTER
setting rules.
Line Number Clause Notation.
Column 1 of the presentation rules table uses
a shorthand notation to describe the sequence of LINE NUMBER clauses that
can appear in the description of a report group. The meaning of the
abbreviations used in column 1 is as follows.
1. The letter "A" represents one or more absolute LINE NUMBER
clauses, none of which has the NEXT PAGE phrase, that appear in
consecutive order within the sequence of LINE NUMBER clauses in
the report group description entry.
2. The letter "R" represents one or more relative LINE NUMBER clauses
that appear in consecutive order within the sequence of LINE
NUMBER clauses in the report group description entry.
3. The letters "NP" represent one or more absolute LINE NUMBER
clauses that appear in consecutive order within the sequence of
LINE NUMBER clauses in the report group description entry with the
phrase NEXT PAGE appearing in the first and only in the first LINE
NUMBER clause.
________________________________________________________________________
|(OSVS) |
|This entry can appear without a line number. |
________________________________________________________________________
When two abbreviations appear together, they refer to a sequence of LINE
NUMBER clauses that consists of the two specified consecutive sequences.
For example "A R" refers to a report group description entry within which
the "A" sequence (defined in rule 1 above) is immediately followed by the
"R" sequence (defined in rule 2 above).
Line Number Clause Sequence Substitutions.
Where "A R" is shown to be a permissible sequence in the presentation
rules table, "A" is also permissible and the same presentation rules are
applicable.
Where "NP R" is shown to be a permissible sequence in the presentation
rules table, "NP" is also permissible and the same presentation rules are
applicable.
Saved Next Group Integer Description.
Saved next group integer is a data item that is addressable only by the
RWCS. When an absolute NEXT GROUP clause specifies a vertical positioning
value which cannot be accommodated on the current page, the RWCS stores
that value in saved next group integer. After page advance processing,
the RWCS positions the next body group using the value stored in saved
next group integer.
Report Heading Group Presentation Rules.
Table 10-3 points to the appropriate presentation rules for all
permissible combinations of LINE NUMBER and NEXT GROUP clauses in a
report heading report group. The report heading group presentation rules
are as follows:
1. Upper limit rule.
The first line number on which the report heading report group can
be presented is the line number specified by the HEADING phrase of
the PAGE clause.
2. Lower limit rules.
a. The last line number on which the report heading report
group can be presented is the line number that is obtained
by subtracting 1 from the value of integer-3 of the FIRST
DETAIL phrase of the PAGE clause.
b. The last line number on which the report heading report
group can be presented is the line number specified by
integer-1 of the PAGE clause.
3. First print line position rules.
a. The first print line of the report heading report group is
presented on the line number specified by the integer of
its LINE NUMBER clause.
b. The first print line of the report heading report group is
presented on the line number obtained by adding the integer
of the first LINE NUMBER clause and the value obtained by
subtracting 1 from the value of integer-2 of the HEADING
phrase of the PAGE clause.
c. The report heading report group is not presented.
d. The first print line of the report heading report group is
presented on the line number obtained by adding the content
of its LINE-COUNTER (in this case, zero) to the integer of
the first LINE NUMBER clause.
4. Next group rules.
a. The NEXT GROUP integer must be greater than the line number
on which the final print line of the report heading report
group is presented. In addition, the NEXT GROUP integer
must be less than the line number specified by the value of
integer-3 of the FIRST DETAIL phrase of the PAGE clause.
b. The sum of the NEXT GROUP integer and the line number on
which the final print line of the report heading report
group is presented must be less than the value of integer-3
of the FIRST DETAIL phrase of the PAGE clause.
c. NEXT GROUP PAGE signifies that the report heading report
group is to be presented entirely by itself on the first
page of the report. The RWCS processes no other report
group while positioned to the first page of the report.
5. Final LINE-COUNTER setting rules.
a. After the report heading report group is presented, the
RWCS places the NEXT GROUP integer into LINE-COUNTER as the
final LINE-COUNTER setting.
b. After the report heading report group is presented, the
RWCS places the sum of the NEXT GROUP integer and the line
number on which the final print line of the report heading
report group was presented into LINE-COUNTER as the final
LINE-COUNTER setting.
c. After the report heading report group is presented, the
RWCS places zero into LINE-COUNTER as the final
LINE-COUNTER setting.
d. After the report heading report group is presented, the
final LINE-COUNTER setting is the line number on which the
final print line of the report heading report group was
presented.
e. LINE-COUNTER is unaffected by the processing of a
non-printable report group.
Table 10-3. Report Heading Group Presentation Rules
* See the section "Line Number Clause Notation" for a description
of the abbreviations used in column 1.
** A blank entry in column 1 or column 2 indicates that the named
clause is totally absent from the report group description entry.
*** A blank entry in an applicable rules column indicates the absence
of the named rule for the given combination of LINE NUMBER and NEXT
GROUP clauses.
+ See the "The LINE NUMBER Clause" .
++ See "The NEXT GROUP Clause" .
Page Heading Group Presentation Rules.
Table 10-4 below points to the appropriate presentation rules for all
permissible combinations of LINE NUMBER and NEXT GROUP clauses in a page
heading report group.
Table 10-4. Page Heading Group Presentation Rules
--------------------------------------------------------------------------------------------
| | |
| | Appliable Rules*** |
| | |
--------------------------------------------------------------------------------------------
| | |
| ** | If the PAGE clause is specified**** |
| | |
--------------------------------------------------------------------------------------------
| | | | | | | |
| Sequence | NEXT | Upper | Lower | First | Next | Final |
| of LINE | GROUP | Limit | Limit | Print | Group | LINE- |
| NUMBER | clause | | | Line | | COUNTER |
| clause* | | | | Position | | Setting |
| | | | | | | |
--------------------------------------------------------------------------------------------
| | | | | | | |
| AR | | 1 | 2 | 3a | | 4a |
| | | | | | | |
--------------------------------------------------------------------------------------------
| | | | | | | |
| R | | 1 | 2 | 3b | | 4a |
| | | | | | | |
--------------------------------------------------------------------------------------------
| | | | | | | |
| | | | | 3c | | 4b |
| | | | | | | |
--------------------------------------------------------------------------------------------
* See the section "Line Number Clause Notation" for a description
of the abbreviations used in column 1.
** A blank entry in column 1 or column 2 indicates that the named
clause is totally absent from the report group description entry.
*** A blank entry in an applicable rules column indicates the absence
of the named rule for the given combination of LINE NUMBER and NEXT
GROUP clauses.
**** If the PAGE clause is omitted from the report description entry,
then a page heading report group can not be defined. (See the
section "The TYPE Clause" .)
The page heading group presentation rules are as follows:
1. Upper limit rule.
If a report heading report group has been presented on the page on
which the page heading report group is to be presented, then the
first line number on which the page heading report group can be
presented is one greater than the final LINE-COUNTER setting
established by the REPORT HEADING.
Otherwise the first line number on which the page heading report
group can be presented is the line number specified by the HEADING
phrase of the PAGE clause.
2. Lower limit rule.
The last line number on which the page heading report group can be
presented is the line number that is obtained by subtracting one
from the value of integer-3 of the FIRST DETAIL phrase of the PAGE
clause.
3. First print line position rules.
a. The first print line of the page heading report group is
presented on the line number specified by the integer of
its LINE NUMBER clause.
b. If a report heading report group has been presented on the
page on which the page heading report group is to be
present, then the sum of the final LINE-COUNTER setting
established by the report heading report group and the
integer of the first LINE NUMBER clause of the page heading
report group defines the line number on which the first
print line of the page heading report group is presented.
Otherwise the sum of the integer of the first LINE NUMBER
clause of the page heading report group and the value
obtained by subtracting one from the value of integer-2 of
the HEADING phrase of the PAGE clause defines the line
number on which the first print line of the page heading
report group is presented.
c. The page heading report group is not presented.
4. Final LINE-COUNTER setting rules.
a. The final LINE-COUNTER setting is the line number on which
the final print line of the page heading report group was
presented.
b. LINE-COUNTER is unaffected by the processing of a
nonprintable report group.
Body Group Presentation Rules.
Table 10-5 below points to the appropriate presentation rules for all
permissible combinations of LINE NUMBER and NEXT GROUP clauses in control
heading, detail, and control footing report groups. The body group
presentation rules are as follows:
1. Upper limit rule. The first line number on which a body group can
be presented is the line number specified by the FIRST DETAIL
phrase of the PAGE clause.
2. Lower limit rules.
The last line number on which a control heading report group or
detail report group can be presented is the line number specified
by the LAST DETAIL phrase of the PAGE clause.
The last line number on which a control footing report group can
be presented is the line number specified by the FOOTING phrase of
the PAGE clause.
3. Fit test rules.
a. If the value in LINE-COUNTER is less than the integer of
the first absolute LINE NUMBER clause, then the body group
is presented on the page to which the report is currently
positioned.
If the value in LINE-COUNTER is not less than the integer
of the first absolute LINE NUMBER clause, the RWCS executes
page advance processing. After the page heading report
group (if defined) has been processed, the RWCS determines
whether the saved next group integer location was set when
the final body group was presented on the preceding page.
(See final LINE-COUNTER setting rule 6a.) If saved next
group integer was not set, the body group shall be
presented on the page to which the report is currently
positioned. If saved next group integer was set, the RWCS
moves the saved next group integer into LINE-COUNTER,
resets saved next group integer to zero, and reapplies fit
test rule 3a.
b. If a body group has been presented on the page to which the
report is currently positioned, the RWCS computes a trial
sum in a work location. The trial sum is computed by
adding the content of LINE-COUNTER to the integers of all
LINE NUMBER clauses of the report group. If the trial sum
is not greater than the body group's lower limit integer,
then the report group is presented on the current page. If
the trial sum exceeds the body group's lower limit integer,
then the RWCS executes page advance processing. After the
page heading report group (if defined) has been processed,
the RWCS reapplies fit test rule 3b.
If no body group has yet been presented on the page to
which the report is currently positioned, the RWCS
determines whether the saved next group integer location
was set when the final body group was presented on the
preceding page. (See final LINE-COUNTER setting rule 6a.)
If saved next group integer was not so set, the body group
shall be presented on the page to which the report is
currently positioned.
If saved next group integer was so set, the RWCS moves the
saved next group integer into LINE-COUNTER, resets saved
next group integer to zero, and computes a trial sum in a
work location.
The trial sum is computed by adding the content of
LINE-COUNTER to the integer one and the integers of all but
the first LINE NUMBER clause of the body group. If the
trial sum is not greater than the body group's lower limit
integer, then the body group is presented on the current
page. If the trial sum exceeds the body group's lower
limit integer, the RWCS executes page advance processing.
After the page heading report group (if defined) has been
processed, the RWCS presents the body group on that page.
Table 10-5. Body Group Presentation Rules
* See the section "Line Number Clause Notation" for a description
of the abbreviations used in column 1.
** A blank entry in column 1 or column 2 indicates that the named
clause is totally absent from the report group description entry.
*** A blank entry in an applicable rules column indicates the absence
of the named rule for the given combination of LINE NUMBER and NEXT
GROUP clauses.
+ See the section "The LINE NUMBER Clause" .
++ See the section "The NEXT GROUP Clause" .
c. If a body group has been presented on the page to which the
report is currently positioned, the RWCS executes page advance
processing. After the page heading report group (if defined)
has been processed, the RWCS reapplies fit test rule 3c.
If no body group has yet been presented on the page to which
the report is currently positioned, the RWCS determines whether
the saved next group integer location was set when the final
body group was presented on the preceding page. (See final
LINE-COUNTER setting rule 6a.) If saved next group integer was
not so set, the body group shall be presented on the page to
which the report is currently positioned. If saved next group
integer was so set, the RWCS moves the saved next group integer
into LINE-COUNTER and resets saved next group integer to zero.
If then the value in LINE-COUNTER is less than the integer of
the first absolute LINE NUMBER clause, the body group shall be
presented on the page to which the report is currently
positioned. Otherwise the RWCS executes page advance
processing. After the page heading report group (if defined)
has been processed, the RWCS presents the body group on that
page.
4. First print line position rules.
a. The first print line of the body group is presented on the line
number specified by the integer of its LINE NUMBER clause.
b. If the value in LINE-COUNTER is equal to or greater than the
line number specified by the FIRST DETAIL phrase of the PAGE
clause, and if no body group has previously been presented on
the page to which the report is currently positioned, then the
first print line of the current body group is presented on the
line immediately following the line indicated by the value
contained on LINE-COUNTER.
If the value in LINE-COUNTER is equal to or greater than the
line number specified by the FIRST DETAIL phrase of the PAGE
clause, and if a body group has previously been presented on
the page to which the report is currently positioned, then the
first print line of the current body group is presented on the
line that is obtained by adding the content of LINE-COUNTER and
the integer of the first LINE NUMBER clause of the current body
group.
If the value in LINE-COUNTER is less than the line number
specified by the FIRST DETAIL phrase of the PAGE clause, then
the first printer line of the body group is presented on the
line specified by the FIRST DETAIL phrase.
c. The body group is not presented.
d. The sum of the content of LINE-COUNTER and the integer of the
first LINE NUMBER clause defines the line number on which the
first print line is presented.
5. Next group rule.
The integer of the absolute NEXT GROUP clause must specify a line
number that is not less than that specified in the FIRST DETAIL
phrase of the PAGE clause, and that is not greater than that
specified in the FOOTING phrase of the PAGE clause.
6. Final LINE-COUNTER setting rules.
a. If the body group that has just been presented is a control
footing report group and if the control footing report group is
not associated with the highest level at which the RWCS
detected a control break, then the final LINE-COUNTER setting
is the line number on which the final print line of the control
footing report group was presented.
For all other cases the RWCS makes a comparison of the line
number on which the final print line of the body group was
presented and the integer of the NEXT GROUP clause. If the
former is less than the latter, then the RWCS places the NEXT
GROUP integer into LINE-COUNTER as the final LINE-COUNTER
setting. If the former is equal to or greater than the latter,
then the RWCS places the line number specified by the FOOTING
phrase of the PAGE clause into LINE-COUNTER as the final
LINE-COUNTER setting; in addition the RWCS places the NEXT
GROUP integer into the saved next group integer location.
b. If the body group that has just been presented is a control
footing report group, and if the control footing report group
is not associated with the highest level at which the RWCS
detected a control break, then the final LINE-COUNTER setting
is the line number on which the final print line of the control
footing report group was presented.
For all other cases the RWCS computes a trial sum in a work
location. The trial sum is computed by adding the integer of
the NEXT GROUP clause to the line number on which the final
print line of the body group was presented. If the sum is less
than the line number specified by the FOOTING phrase of the
PAGE clause, then the RWCS places that sum into LINE-COUNTER as
the final LINE-COUNTER setting. If the sum is equal to or
greater than the line number specified by the FOOTING phrase of
the PAGE clause, then the RWCS places the line number specified
by the FOOTING phrase of the PAGE clause into LINE-COUNTER as
the final LINE-COUNTER setting.
c. If the body group that has just been presented is a control
footing report group, and if the control footing report group
is not associated with the highest level at which the RWCS
detected a control break, then the final LINE-COUNTER setting
is the line number on which the final print line of the control
footing report group was presented.
For all other cases the RWCS places the line number specified
by the FOOTING phrase of the PAGE clause into LINE-COUNTER as
the final LINE-COUNTER setting.
d. The final LINE-COUNTER setting is the line number on which the
final print line of the body group was presented.
e. LINE-COUNTER is unaffected by the processing of a nonprintable
body group.
f. If the body group that has just been presented is a control
footing report group, and if the control footing report group
is not associated with the highest level at which the RWCS
detected a control break, then the final LINE-COUNTER setting
is the line number on which the final print line of the control
footing report group was presented.
For all other cases the RWCS places the sum of the line number
on which the final print line was presented and the NEXT GROUP
integer into LINE-COUNTER as the final LINE-COUNTER setting.
Page Footing Presentation Rules.
MPE/iX 5.0 Documentation