|
HP COBOL Reference Manual
Additional References
Example
The following is an example of a global Report Description entry:
FILE SECTION.
FD WEEKLY-REPORTS...
REPORTS ARE PAYROLL-REPORT
PAYROLL-IRS.
REPORT SECTION.
RD PAYROLL-REPORT
IS GLOBAL
CODE "AA"
CONTROL GRAND-TOT
SITE-TOT
DEPT-TOT
GROUP-TOT
PAGE LIMITS ARE 60 LINES
HEADING 2
FIRST DETAIL 9
LAST DETAIL 55
FOOTING 58.
RD PAYROLL-IRS
CODE "BB"...
|
The previous example uses the CODE clause to flag PAYROLL-REPORT
records from other records (see PAYROLL-IRS) included in the same file
(WEEKLY-REPORTS). The entry defines four control totals. GRAND-TOT is
the most major control total; it will be printed only at the end of the
report. SITE-TOT, DEPT-TOT, and GROUP-TOT are major, intermediate, and
minor control totals, respectively. These totals are printed whenever
the Report Writer Control System (RWCS) processes a control break. The
entry also defines a report page with 60 lines. On each page the RWCS
is to print PAYROLL-REPORT headings beginning on line 2, detail lines
from lines 9 to 55, and footings beginning on line 58.
5.3.4 Data Description
Function
A data description entry specifies the characteristics of a data item.
Syntax Rules
- level-number in Format 1 can be any number from 01 to 49,
or 77.
- Data description clauses can appear in any order, with two
exceptions:
- The optional data-name or FILLER clause must immediately
follow level-number.
- The optional REDEFINES clause must immediately follow the optional
data-name or FILLER clause.
- The EXTERNAL clause can appear in a level 01 or 77 data description
entry in the Working-Storage Section.
- The GLOBAL clause can appear in a level 01 or 77 data description
entry in the Working-Storage Section, or in a level 01 data description
entry in the File Section.
- The EXTERNAL and REDEFINES clauses cannot be in the same data
description entry.
- data-name must appear in any Format 1 entry that contains
the EXTERNAL clause or GLOBAL clause, or in the record descriptions of
a file description entry that contains the EXTERNAL or GLOBAL clause.
- There must be a PICTURE clause for all elementary items except the
following:
- An index data item
- A COMP-1 or COMP-2 data item
- The subject of a RENAMES clause
- A POINTER data item
In these cases, there must be no PICTURE clause.
- The words THRU and THROUGH are equivalent.
- The SYNCHRONIZED, PICTURE, JUSTIFIED, and BLANK WHEN ZERO clauses
can appear only in Data Description entries for elementary items.
General Rules
- Each condition-name requires a separate Format 3 entry.
The level 88 entry associates one or more values, or ranges of values,
with condition-name.
All condition-name entries
for an associated data item (the conditional variable) must immediately
follow that item's data description entry. Any
condition-name associated with a global conditional variable
is global. A condition-name can be associated with a data
item at any level except:
- Another condition-name
- A level 66 item
- A group that contains items with JUSTIFIED, SYNCHRONIZED, or USAGE
(other than USAGE IS DISPLAY) clauses
- An index data item
- Multiple level 01 data description entries subordinate to an FD or
SD entry implicitly redefine the same area.
5.3.5 Report Group Description
Function
The report group description entry specifies the characteristics of a
report group and of the individual items within a report group.
Syntax Rules
All Formats
- The report group description entry can appear only in the Report
Section.
- Except for the group-data-name clause, which when present
must immediately follow level-number, the clauses may be in
any sequence.
- The description of a report group may consist of one, two, or three
hierarchical levels:
- The first entry that describes a report group must be a Format 1
entry.
- Both Format 2 and Format 3 entries may be immediately subordinate
to a Format 1 entry.
- At least one Format 3 entry must be immediately subordinate to a
Format 2 entry.
- Format 3 entries must define elementary data items.
- In the Report Section, the USAGE clause is used only to declare the
usage of printable items.
- If the USAGE clause appears in a Format 1 or Format 2 entry, at
least one subordinate entry must define a printable item.
- In Format 3, the USAGE clause must define a printable item.
- An entry containing a LINE NUMBER clause must not have a
subordinate entry that also contains a LINE NUMBER clause.
Format 1
- group-data-name is required only when:
- A GENERATE statement references a DETAIL report group.
- An UPON phrase of a SUM clause references a DETAIL report group.
- A USE BEFORE REPORTING sentence references a DETAIL report group.
- The name of a CONTROL FOOTING report group qualifies a reference to
a sum counter.
If specified, group-data-name can be used as a sum counter
qualifier and can be referenced only by:
- GENERATE statements
- UPON phrases of the SUM clause
- USE BEFORE REPORTING declaratives
Format 2
- level-number can be any integer from 02 to 48 inclusive.
- A Format 2 entry must contain at least one optional clause.
- In a Format 2 entry, group-data-name is optional. It can
only qualify a sum counter reference.
Format 3
- level-number can be any integer from 02 to 49 inclusive.
- A GROUP INDICATE clause can appear only in a DETAIL report group.
- A SUM clause can appear only in a CONTROL FOOTING report group.
- An entry containing a COLUMN NUMBER clause but no LINE NUMBER
clause must be subordinate to an entry containing a LINE NUMBER clause.
- group-data-name is optional but can be specified in any
entry. group-data-name can be referenced only if the entry
defines a sum counter.
- A LINE NUMBER clause must not be the only clause specified. Refer
to Syntax Rule 3d.
- An entry containing a VALUE clause must also have a COLUMN NUMBER
clause.
- A printable item is a data item whose size and content are
specified by an elementary report entry.
- An elementary report entry contains a COLUMN NUMBER clause, a
PICTURE clause, and a SOURCE, SUM, or VALUE clause.
- Figure 5-7 shows all permissible clause combinations for Format
3. You read the table from left to right along the selected row.
Figure 5-7 Format 3 Clause Combinations
General Rules
- Format 1 is the Report Group entry. The report group is defined by
the contents of this entry and all of its subordinate entries.
- The BLANK WHEN ZERO clause, the JUSTIFIED clause, and the PICTURE
clause for Report Writer are the same as those in the Data Description
Section.
Examples
The HP COBOL User Manual contains examples of each report group description
entry format.
5.3.6 Screen Description (Alpha, I64)
Function
A screen description entry describes a video form or a portion of a
video form and specifies the attributes, behavior, size, and location
of screen items within the video form. The screen description entry is
referenced in the Procedure Division by the ACCEPT and DISPLAY
statements.
Syntax Rules
All Formats
- level-number can be any number from 01 to 49.
- Each elementary screen description entry must contain at least one
of the following clauses:
BELL
BLANK
COLUMN
LINE
PICTURE
VALUE
- If the FOREGROUND-COLOR, BACKGROUND-COLOR, or SIGN clauses are
specified in both the group screen description entry and the
subordinate description entry for a screen item, then the subordinate
screen description entry's clauses will take effect.
- screen-name assigns a name to the screen item described in
the screen description entry and must conform to the rules for
user-defined names. If either the optional screen-name or the
key word FILLER is specified, it must be the first word following the
level number in each screen description entry.
- If both screen-name and FILLER are omitted, the screen
item being described is treated as though FILLER had been specified,
and cannot be referenced in an ACCEPT or DISPLAY statement.
- Each level 01 item must have a screen name.
- A screen item can be referenced only in an ACCEPT or DISPLAY
statement.
- color-num-1 and color-num-2 are integers in the
range 0--7. color-num-1 and color-num-2 represent
specific colors as described in Table 5-5:
Table 5-5 Color Table
Color |
Color Value |
Color |
Color Value |
Black
|
0
|
Red
|
4
|
Blue
|
1
|
Magenta
|
5
|
Green
|
2
|
Yellow/Brown
|
6
|
Cyan
|
3
|
White
|
7
|
- The USING phrase is equivalent to the combination of FROM and TO
phrases, each specifying the same identifier.
- identifier-3, identifier-4 and
identifier-5 must be defined in the File, Working-Storage, or
Linkage Section.
- identifier-1 and identifier-2 must be described
as elementary unsigned numeric integer data items.
- literal-1 must be a nonnumeric literal.
- For a description of picture-string-1, see the
Section 5.3.37 Clause section of this chapter.
|