[an error occurred while processing this directive]

HP OpenVMS Systems Documentation

Content starts here

HP COBOL
Reference Manual


Previous Contents Index

D.8 PAGE FOOTING Group Presentation Rules

Figure D-4 shows the appropriate presentation rules for all permissible combinations of LINE NUMBER and NEXT GROUP clauses in a PAGE FOOTING report group.

Figure D-4 PAGE FOOTING Group Presentation Rules


The PAGE FOOTING Group Presentation Rules are:

  1. Upper-limit rule:
    The first line number on which the PAGE FOOTING report group can be presented is the line number obtained by adding:
    • The integer 1
    • The value of footing-line in the FOOTING phrase of the PAGE clause
  2. Lower-limit rule:
    The last line number on which the PAGE FOOTING report group can be presented is the line number specified by page-size of the PAGE clause.
  3. First print line position rules:
    1. The first print line of the PAGE FOOTING report group is presented on the line specified by the integer of its LINE NUMBER clause.
    2. The PAGE FOOTING report group is not presented.
  4. Next group rules:
    1. The NEXT GROUP integer must be greater than the line number on which the final print line of the PAGE FOOTING report group is presented. In addition, the NEXT GROUP integer must not be greater than the line number specified by the page-size value of the PAGE clause.
    2. The sum of the following two items must not be greater than the line number specified by page-size of the PAGE clause:
      • The NEXT GROUP integer
      • The line number on which the final print line of the PAGE FOOTING report group is presented
  5. Final LINE-COUNTER setting rules:
    1. The final LINE-COUNTER setting after the RWCS presents the PAGE FOOTING report group is the NEXT GROUP integer.
    2. The final LINE-COUNTER setting after the RWCS presents the PAGE FOOTING report group is the sum of:
      • The NEXT GROUP integer
      • The line number on which the final print line of the PAGE FOOTING report group was presented
    3. After the PAGE FOOTING report group is presented, the final LINE-COUNTER setting is the line number on which the final print line of the PAGE FOOTING report group was presented.
    4. LINE-COUNTER is unaffected by the processing of a nonprintable report group.

D.9 REPORT FOOTING Group Presentation Rules

Figure D-5 points to the appropriate presentation rules for all permissible combinations of LINE NUMBER and NEXT GROUP clauses in a REPORT FOOTING report group.

Figure D-5 REPORT FOOTING Group Presentation Rules


REPORT FOOTING Group Presentation Rules

  1. Upper-limit rules:
    1. The first line number on which the REPORT FOOTING report group can be presented is one greater than the final LINE-COUNTER setting established by the PAGE FOOTING report group if a PAGE FOOTING report group has been presented on the page on which the report is positioned.
      Otherwise, the first line number on which the REPORT FOOTING report group can be presented is the line number obtained by adding 1 and the footing-line value of the PAGE clause.
    2. The first line number on which the REPORT FOOTING 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 REPORT FOOTING report group can be presented is the line number specified by the page-size value of the PAGE clause.
  3. First print line position rules:
    1. The first print line of the REPORT FOOTING report group is presented on the line specified by the integer of its LINE NUMBER clause.
    2. If the RWCS presents a PAGE FOOTING report group on the page to which the report is positioned, then the sum of the following two items defines the line number on which the RWCS presents the first print line of the REPORT FOOTING report group:
      • The final LINE-COUNTER setting established by the PAGE FOOTING report group
      • The integer of the first LINE NUMBER clause of the REPORT FOOTING report group

      Otherwise, the sum of the following two items defines the line number on which the RWCS presents the first print line of the REPORT FOOTING report group:
      • The integer of the first LINE NUMBER clause of the REPORT FOOTING report group
      • The line number specified by the footing-line value of the FOOTING phrase of the PAGE clause
    3. The NEXT PAGE phrase in the first absolute LINE NUMBER clause directs the REPORT FOOTING report group to appear on a page on which no other report group has been presented. The first print line of the REPORT FOOTING report group is presented on the line number specified by the integer of its LINE NUMBER clause.
    4. The line number on which the RWCS presents the first print line is the sum of:
      • The contents of LINE-COUNTER
      • The integer of the first LINE NUMBER clause
    5. The REPORT FOOTING report group is not presented.
  4. Final LINE-COUNTER setting rules:
    1. The final LINE-COUNTER setting is the line number on which the RWCS presents the final print line of the REPORT FOOTING report group.
    2. LINE-COUNTER is unaffected by the processing of a nonprintable report group.


Appendix E
RTL Routines for Accessing the RAB and FAB Structures (OpenVMS Alpha and I64 Only)

In HP COBOL for OpenVMS Alpha and OpenVMS I64, when a file is successfully opened, the file's RAB pointer is placed in its RMS_STV field and its FAB pointer is placed in the FABPTR field of the RAB. The two RTL routines documented here (DCOB$RMS_CURRENT_RAB and DCOB$RMS_CURRENT_FAB) enable HP COBOL programmers to access the RAB and FAB data structures on OpenVMS Alpha and I64. However, the content and format of the RAB and FAB are not covered by any external standards (such as the ANSI standard for COBOL) and are subject to change.


DCOB$RMS_CURRENT_FAB


RETURNS

VMS usage: fab
type: longword (unsigned)
access: write only
mechanism: by reference

Arguments

None.

Description

DCOB$RMS_CURRENT_FAB returns the address of the RMS FAB structure for the most recently used COBOL file connector. Some fields of the FAB are filled in by the RMS SYS$OPEN routine.

This routine can be used to obtain the address of the RMS FAB structure. The FAB is filled in by SYS$OPEN to reflect the actual attributes of the file in the cases where the actual attributes differ from the attributes specified by the COBOL file connector.

The FAB is a structure used internally by the HP COBOL run-time system to implement COBOL semantics. Modification of the FAB can result in abnormal program behavior, including unexpected program termination.


Example

See the example for DCOB$RMS_CURRENT_RAB.


DCOB$RMS_CURRENT_RAB


RETURNS

VMS usage: rab
type: longword (unsigned)
access: write only
mechanism: by reference

Arguments

None.

Description

DCOB$RMS_CURRENT_RAB returns the address of the RMS RAB structure for the most recently used COBOL file connector.

This routine can be used to obtain the address of the RMS RAB structure. The RAB describes attributes of the connection to a file.

The RAB is a structure used internally by the HP COBOL run-time system to implement COBOL semantics. Modification of RAB fields can result in abnormal program behavior, including unexpected program termination.


Example


*+
* PROGRAM : RMSEXAMPLE
*
* PROGRAM DESCRIPTION:
*
*       This program is an example of use of DCOB$RMS_CURRENT_FAB
*   and DCOB$RMS_CURRENT_RAB.
*
*-
IDENTIFICATION DIVISION.
PROGRAM-ID. RMSEXAMPLE.

ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
    SELECT EMPLOYEE-FILE
     ASSIGN TO "employee.dat"
     ORGANIZATION IS SEQUENTIAL.


DATA DIVISION.
FILE SECTION.
FD EMPLOYEE-FILE
    BLOCK CONTAINS 2048 CHARACTERS.
01 EMPLOYEE.
    03 NAME PIC X(30).
    03 OFFICE PIC X(10).
    03 PHONE PIC X(10).

WORKING-STORAGE SECTION.
01  EMPLOYEE-FAB USAGE IS POINTER.
01  EMPLOYEE-RAB USAGE IS POINTER.

PROCEDURE DIVISION.
P0.
*
* Open the file to establish EMPLOYEE-FILE as the current file.
*
    OPEN INPUT EMPLOYEE-FILE.

*
* Get the pointer to the RMS FAB structure for EMPLOYEE-FILE.  Store
* the pointer in EMPLOYEE-FAB.  Do the same for the RAB.
*
    CALL "DCOB$RMS_CURRENT_FAB" GIVING EMPLOYEE-FAB.
    CALL "DCOB$RMS_CURRENT_RAB" GIVING EMPLOYEE-RAB.

*
* Pass the address of the FAB to a subroutine that will use
* the contents.
*
    CALL "PRINT-FIELDS" USING BY VALUE EMPLOYEE-FAB EMPLOYEE-RAB.

*
* CLOSE the file before exiting.
*
    CLOSE EMPLOYEE-FILE.
    STOP RUN.
END PROGRAM RMSEXAMPLE.
IDENTIFICATION DIVISION.
PROGRAM-ID. PRINT-FIELDS.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 TEMP-W.
    03 TEMP-WORD PIC S9(4) COMP.
01 TEMP-W1 REDEFINES TEMP-W.
    03 TEMP-B1 PIC X.
    03 TEMP-B2 PIC X.

LINKAGE SECTION.
01 FAB.
  05 FAB_ID     PIC S9(9) COMP VALUE 20483.
  05 FOP        PIC S9(9) COMP.
  05 STS        PIC S9(9) COMP.
  05 STV        PIC S9(9) COMP.
  05 ALQ        PIC S9(9) COMP.
  05 DEQ        PIC S9(4) COMP.
  05 FAC        PIC X.
  05 SHR        PIC X.
  05 CTX        PIC S9(9) COMP.
  05 RTV        PIC X.
  05 ORG        PIC X.
  05 RAT        PIC X.
  05 RFM        PIC X.
  05 JNL        PIC S9(9) COMP.
  05 XAB-ADD    USAGE IS POINTER.
  05 NAM-ADD    USAGE IS POINTER.
  05 FNA        USAGE IS POINTER.
  05 DNA        USAGE IS POINTER.
  05 FNS        PIC X.
  05 DNS        PIC X.
  05 MRS        PIC S9(4) COMP.
  05 MRN        PIC S9(9) COMP.
  05 BLS        PIC S9(4) COMP.
  05 FILLER     PIC X(18).
01 RAB.
  05 RAB_ID PIC S9(9) COMP VALUE 17409.
  05 ROP PIC S9(9) COMP.
  05 STS PIC S9(9) COMP.
  05 STV PIC S9(9) COMP.
  05 RFA PIC S9(4) COMP OCCURS 3 TIMES.
  05 RESERVED   PIC S9(4) COMP.
  05 CTX PIC S9(9) COMP.
  05 RAC PIC X.
  05 TMO PIC X.
  05 USZ PIC S9(4) COMP.
  05 RSZ PIC S9(4) COMP.
  05 UBF PIC S9(9) COMP.
  05 RBF PIC S9(9) COMP.
  05 RHB PIC S9(9) COMP.
  05 KBF PIC S9(9) COMP.
  05 KSZ PIC X.
  05 KRF PIC X.
  05 MBF        PIC X.
  05 MBC PIC X.
  05 BKT PIC S9(9) COMP.
  05 FABPTR PIC S9(9) COMP.
  05 XAB PIC S9(9) COMP.

PROCEDURE DIVISION USING FAB RAB.
*
* Convert the MBF PIC X value to a PIC S9(5) COMP VALUE.
*
    MOVE 0 TO TEMP-WORD.
    MOVE MBF TO TEMP-B1.

*
* Display the multibuffer count and file allocation.
*
    DISPLAY "Multibuffer count is "
       TEMP-WORD WITH CONVERSION " blocks".
    DISPLAY "File allocation is " ALQ WITH CONVERSION.

    EXIT PROGRAM.
END PROGRAM PRINT-FIELDS.

      


Previous Next Contents Index