[an error occurred while processing this directive]

HP OpenVMS Systems Documentation

Content starts here

HP COBOL
Reference Manual


Previous Contents Index

Report Section

  1. The Report Section defines report files. It begins with the Report Section header: the reserved words REPORT SECTION, followed by a period (.) separator character.
  2. Report description entries follow the Report Section header.
  3. The report description entry consists of a level indicator (RD), a report name, and a series of independent clauses.
  4. An RD clause specifies the following:
    • Identifying characters to be prefixed to each print line in a report
    • The physical structure and organization of a report
    • The name of the report
  5. An RD entry, followed by one or more report group description entries, defines a report. Report group description entries must immediately follow the associated report description entry.
  6. A report group description entry defines a report group. It specifies the characteristics of a report group and the individual items within a report group.

Screen Section (Alpha, I64)

  1. The Screen Section describes a video form and specifies the attributes, behavior, size, and location of each screen item within the video form. The Screen Section is for use with ACCEPT and DISPLAY statements. <>

Additional References

5.3.1 FD (File Description) Sequential, Line Sequential (Alpha, I64), Relative, Indexed, and Report File Descriptions

Function

A file description entry describes the physical structure, identification, record names, and names for sequential, line sequential (Alpha, I64), relative, indexed, and report files. It also specifies the internal or external attributes of a file connector and the local or global attributes of a file-name.



*Clauses marked with an asterisk (*) can be in either the SELECT clause of the Environment Division or the file description entry of the Data Division. They cannot be in both places for the same file.

Syntax Rules

Formats 1, 2, 3, and 4---All Files

  1. The level indicator FD identifies the start of a file description entry. It must precede file-name.
  2. The clauses following file-name can appear in any order.
  3. A period (.) separator character must terminate a file description entry.
  4. On OpenVMS, the file name written to disk (see the ASSIGN clause in Chapter 4) has the file type .DAT added if no other file type is specified in the corresponding file specification. <>

Format 1---Sequential or Line Sequential (Alpha, I64) Files

  1. file-name can refer only to a sequential file.
  2. One or more record description entries must follow the file description entry.

Format 2---Relative Files

  1. file-name can refer only to a relative file.
  2. If a START statement refers to file-name, the file description must include the RELATIVE KEY phrase within the ACCESS MODE clause.
  3. One or more record description entries must follow the file description entry.

Format 3---Indexed Files

  1. file-name can refer only to an indexed file.
  2. On Tru64 UNIX, for information on file-names for indexed files, see the ASSIGN clause in Chapter 4.<>
  3. alt-key cannot have the same leftmost character position as that of rec-key or any other alt-key for the same file.
  4. One or more record description entries must follow the file description entry.

Format 4---Report Files

  1. file-name can refer only to a report file.
  2. No record description entries may follow the file description entry for a report file.
  3. Only the CLOSE statement and the OPEN statement with the OUTPUT or EXTEND phrase may reference this file description entry.

General Rules

Formats 1, 2, 3, and 4---All Files

  1. A file description entry associates file-name with a file connector.
  2. On OpenVMS, if the file description entry contains the EXTERNAL clause, the RMS special registers RMS-STS, RMS-STV, and RMS-FILENAME are external registers.
  3. If the file description entry contains the GLOBAL clause, the RMS special registers RMS-STS, RMS-STV, and RMS-FILENAME are global registers. <>

Format 1---Sequential and Line Sequential (Alpha, I64) Files

  1. If the file description entry contains the LINAGE clause and the EXTERNAL clause, the LINAGE-COUNTER special register is an external data item.
  2. If the file description entry contains the LINAGE clause and the GLOBAL clause, the special register LINAGE-COUNTER is a global name.

Format 3---Indexed Files

  1. If the file description entry contains the EXTERNAL clause, the segmented key seg-key has the external attribute.
  2. If the file description entry contains the GLOBAL clause, the segmented key seg-key is a global name.

Refer to the HP COBOL User Manual for examples of the file description entry formats.

5.3.2 SD (Sort-Merge File Description)

Function

A sort-merge file description entry describes a sort or merge file's physical structure, identification, and record names.


Syntax Rules

  1. The level indicator SD identifies the start of a sort-merge file description. It must precede file-name.
  2. The clauses following file-name can appear in any order.
  3. A period (.) separator character must terminate a sort-merge file description entry.
  4. One or more record description entries must follow the sort-merge file description entry.

General Rule

No input-output statements can refer to a file-name in a sort-merge file description.

Examples

Refer to the HP COBOL User Manual for examples of the sort-merge file description entry.

5.3.3 RD (Report Description)

Function

The Report Description names a report, specifies any identifying characters to be prefixed to each print line in the report, and describes the physical structure and organization of that report. It also determines whether a report-name is a local name or global name.


Syntax Rules

  1. report-name must appear in one and only one REPORT clause.
  2. The clauses following report-name may appear in any order. report-name is the highest permissible qualifier that can be specified for LINE-COUNTER, PAGE-COUNTER, and all data-names in the Report Section.

General Rules

  1. If the Report Description entry contains the GLOBAL clause, report-name and the special registers LINE-COUNTER and PAGE-COUNTER are global names.
  2. The reserved word PAGE-COUNTER references a special register that the compiler creates for each report in the Report Section.
  3. 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 anywhere an integer data item can appear.
  4. If more than one PAGE-COUNTER exists in a program, PAGE-COUNTER must be qualified by a report-name wherever 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 containing the reference. Whenever the PAGE-COUNTER of a different report is referenced, PAGE-COUNTER must be explicitly qualified by the other report's report-name.
  5. The INITIATE statement causes the Report Writer Control System to set the PAGE-COUNTER of the referenced report to one.
  6. PAGE-COUNTER is automatically incremented by one each time the Report Writer Control System executes a page advance.
  7. Procedure Division statements may alter the contents of PAGE-COUNTER.
  8. The reserved word LINE-COUNTER references a special register that the compiler creates for each report in the Report Section.
  9. 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 anywhere a data item with an integer value can appear. However, only the Report Writer Control System can change the contents of LINE-COUNTER.
  10. If there is more than one LINE-COUNTER in a program, Procedure Division references to LINE-COUNTER must be qualified by a report-name.
    In the Report Section, an unqualified reference to LINE-COUNTER is qualified implicitly by the name of the report containing the reference. Whenever the LINE-COUNTER of a different report is referenced, LINE-COUNTER must be explicitly qualified by the other report's report-name.
  11. The INITIATE statement causes the Report Writer Control System to set the LINE-COUNTER of the referenced report to zero. The Report Writer Control System also automatically resets LINE-COUNTER to zero each time it executes a page advance.
  12. The execution of SUPPRESS statements and the processing of nonprintable report groups do not change the value of LINE-COUNTER.
  13. At the time each print line is presented, the value of LINE-COUNTER represents the line number on which the print line is presented. After the presentation of the report group, the value of LINE-COUNTER is governed by the Report Writer Presentation Rules and Tables.


Previous Next Contents Index