[an error occurred while processing this directive]

HP OpenVMS Systems Documentation

Content starts here

HP COBOL
Reference Manual


Previous Contents Index

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

  1. level-number in Format 1 can be any number from 01 to 49, or 77.
  2. 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.
  3. The EXTERNAL clause can appear in a level 01 or 77 data description entry in the Working-Storage Section.
  4. 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.
  5. The EXTERNAL and REDEFINES clauses cannot be in the same data description entry.
  6. 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.
  7. 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.
  8. The words THRU and THROUGH are equivalent.
  9. The SYNCHRONIZED, PICTURE, JUSTIFIED, and BLANK WHEN ZERO clauses can appear only in Data Description entries for elementary items.

General Rules

  1. 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
  2. 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

  1. The report group description entry can appear only in the Report Section.
  2. Except for the group-data-name clause, which when present must immediately follow level-number, the clauses may be in any sequence.
  3. The description of a report group may consist of one, two, or three hierarchical levels:
    1. The first entry that describes a report group must be a Format 1 entry.
    2. Both Format 2 and Format 3 entries may be immediately subordinate to a Format 1 entry.
    3. At least one Format 3 entry must be immediately subordinate to a Format 2 entry.
    4. Format 3 entries must define elementary data items.
  4. In the Report Section, the USAGE clause is used only to declare the usage of printable items.
    1. If the USAGE clause appears in a Format 1 or Format 2 entry, at least one subordinate entry must define a printable item.
    2. In Format 3, the USAGE clause must define a printable item.
  5. An entry containing a LINE NUMBER clause must not have a subordinate entry that also contains a LINE NUMBER clause.

Format 1

  1. group-data-name is required only when:
    1. A GENERATE statement references a DETAIL report group.
    2. An UPON phrase of a SUM clause references a DETAIL report group.
    3. A USE BEFORE REPORTING sentence references a DETAIL report group.
    4. 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

  1. level-number can be any integer from 02 to 48 inclusive.
  2. A Format 2 entry must contain at least one optional clause.
  3. In a Format 2 entry, group-data-name is optional. It can only qualify a sum counter reference.

Format 3

  1. level-number can be any integer from 02 to 49 inclusive.
  2. A GROUP INDICATE clause can appear only in a DETAIL report group.
  3. A SUM clause can appear only in a CONTROL FOOTING report group.
  4. An entry containing a COLUMN NUMBER clause but no LINE NUMBER clause must be subordinate to an entry containing a LINE NUMBER clause.
  5. 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.
  6. A LINE NUMBER clause must not be the only clause specified. Refer to Syntax Rule 3d.
  7. An entry containing a VALUE clause must also have a COLUMN NUMBER clause.
  8. A printable item is a data item whose size and content are specified by an elementary report entry.
  9. An elementary report entry contains a COLUMN NUMBER clause, a PICTURE clause, and a SOURCE, SUM, or VALUE clause.
  10. 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

  1. Format 1 is the Report Group entry. The report group 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 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

  1. level-number can be any number from 01 to 49.
  2. Each elementary screen description entry must contain at least one of the following clauses:
    BELL
    BLANK
    COLUMN
    LINE
    PICTURE
    VALUE
  3. 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.
  4. 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.
  5. 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.
  6. Each level 01 item must have a screen name.
  7. A screen item can be referenced only in an ACCEPT or DISPLAY statement.
  8. 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
  9. The USING phrase is equivalent to the combination of FROM and TO phrases, each specifying the same identifier.
  10. identifier-3, identifier-4 and identifier-5 must be defined in the File, Working-Storage, or Linkage Section.
  11. identifier-1 and identifier-2 must be described as elementary unsigned numeric integer data items.
  12. literal-1 must be a nonnumeric literal.
  13. For a description of picture-string-1, see the Section 5.3.37 Clause section of this chapter.


Previous Next Contents Index