  | 
		
HP COBOL Reference Manual
 
 
Report Section 
 
 
  - The Report Section defines report files. It begins with the Report
  Section header: the reserved words REPORT SECTION, followed by a period
  (.) separator character.
  
 - Report description entries follow the Report Section header.
  
 - The report description entry consists of a level indicator (RD), a
  report name, and a series of independent clauses.
  
 - 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
  
  
   - 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.
  
 - 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) 
 
 
  - 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
 
 
  - The level indicator FD identifies the start of a file description
  entry. It must precede file-name.
  
 - The clauses following file-name can appear in any order.
  
 - A period (.) separator character must terminate a file description
  entry.
  
 -  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
 
 
  - file-name can refer only to a sequential file.
  
 - One or more record description entries must follow the file
  description entry.
  
Format 2---Relative Files
 
 
  - file-name can refer only to a relative file.
  
 - If a START statement refers to file-name, the file
  description must include the RELATIVE KEY phrase within the ACCESS MODE
  clause.
  
 - One or more record description entries must follow the file
  description entry.
  
Format 3---Indexed Files
 
 
  - file-name can refer only to an indexed file.
  
 -  On Tru64 UNIX, for information on file-names for indexed
  files, see the ASSIGN clause in Chapter 4.<>
  
 - alt-key cannot have the same leftmost character position
  as that of rec-key or any other alt-key for the same
  file.
  
 - One or more record description entries must follow the file
  description entry.
  
Format 4---Report Files
 
 
  - file-name can refer only to a report file.
  
 - No record description entries may follow the file description entry
  for a report file.
  
 - 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
 
 
  - A file description entry associates file-name with a file
  connector.
  
 - 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.
  
 - 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
 
 
  - If the file description entry contains the LINAGE clause and the
  EXTERNAL clause, the LINAGE-COUNTER special register is an external
  data item.
  
 - 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
 
 
  - If the file description entry contains the EXTERNAL clause, the
  segmented key seg-key has the external attribute.
  
 - 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
 
 
  - The level indicator SD identifies the start of a sort-merge file
  description. It must precede file-name.
  
 - The clauses following file-name can appear in any order.
  
 - A period (.) separator character must terminate a sort-merge file
  description entry.
  
 - 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
 
 
  - report-name must appear in one and only one REPORT clause.
  
 - 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
 
 
  - If the Report Description entry contains the GLOBAL clause,
  report-name and the special registers LINE-COUNTER and
  PAGE-COUNTER are global names.
  
 - The reserved word PAGE-COUNTER references a special register that
  the compiler creates for each report in the Report Section.
  
 - 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.
  
 - 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.
   - The INITIATE statement causes the Report Writer Control System to
  set the PAGE-COUNTER of the referenced report to one.
  
 - PAGE-COUNTER is automatically incremented by one each time the
  Report Writer Control System executes a page advance.
  
 - Procedure Division statements may alter the contents of
  PAGE-COUNTER.
  
 - The reserved word LINE-COUNTER references a special register that
  the compiler creates for each report in the Report Section.
  
 - 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.
  
 - 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.
   - 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.
  
 - The execution of SUPPRESS statements and the processing of
  nonprintable report groups do not change the value of LINE-COUNTER.
  
 - 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.
  
  
  
		 |