ACCEPT DATABASE STATISTICS (COBOL)

The ACCEPT DATABASE STATISTICS statement copies system runtime statistics from the IDMS statistics block to program variable storage. This statement can be issued multiple times during the execution of a run unit. For example, you can request database statistics after storing a variable-length record to determine whether the entire record was stored in one place or whether fragments were placed in an overflow area.
idmscu19
The ACCEPT DATABASE STATISTICS statement copies system runtime statistics from the IDMS statistics block to program variable storage. This statement can be issued multiple times during the execution of a run unit. For example, you can request database statistics after storing a variable-length record to determine whether the entire record was stored in one place or whether fragments were placed in an overflow area.
The ACCEPT DATABASE STATISTICS statement does not reset any statistics fields to zero. Resetting of the IDMS statistics block fields occurs only upon issuing a FINISH command.
The ACCEPT DATABASE STATISTICS statement is used in both navigational and nonnavigational environments.
Syntax
►►─── ACCEPT
db-statistics
FROM IDMS-STATISTICS ─────────────────────────────► ►─┬───────────────────────────────────┬─ . ──────────────────────────────────►◄ └─ EXTENDED
db-stat-extended
───────┘
Parameters
  • db-statistics
    Specifies a fullword-aligned 100-byte field in program variable storage.
    The data that is copied from IDMS-STATISTICS to
    db-statistics
    is formatted as follows:
    01 DB-STATISTICS 03 DATE-TODAY PIC X(8). 03 TIME-TODAY PIC X(8). 03 PAGES-READ PIC S9(8) COMP. 03 PAGES-WRITTEN PIC S9(8) COMP. 03 PAGES-REQUESTED PIC S9(8) COMP. 03 CALC-TARGET PIC S9(8) COMP. 03 CALC-OVERFLOW PIC S9(8) COMP. 03 VIA-TARGET PIC S9(8) COMP. 03 VIA-OVERFLOW PIC S9(8) COMP. 03 LINES-REQUESTED PIC S9(8) COMP. 03 RECS-CURRENT PIC S9(8) COMP. 03 CALLS-TO-IDMS PIC S9(8) COMP. 03 FRAGMENTS-STORED PIC S9(8) COMP. 03 RECS-RELOCATED PIC S9(8) COMP. *03 LOCKS-REQUESTED PIC S9(8) COMP. *03 SEL-LOCKS-HELD PIC S9(8) COMP. *03 UPD-LOCKS-HELD PIC S9(8) COMP. *03 RUN-UNIT-ID PIC S9(8) COMP. *03 TASK-ID PIC S9(8) COMP. *03 LOCAL-ID PIC X(8). 03 FILLER PIC X(8). *Applies to the central version only
    The LOCAL-ID field consists of the 4-byte identifier of the interface in which the run unit originated (for example, BATC, DBDC, or CICS) and a unique identifier (fullword) assigned to the run unit by that interface. For batch and CMS run units, this identifier specifies the internal machine time. For the CICS run units, this identifier specifies the CICS transaction number assigned to the run unit.
    To display the originating interface identifier and the run unit identifier for a program, move LOCAL-ID to a work field:
    01 WORK-LOCAL-ID. 02 WORK-LOCAL-ORIGIN PIC X(4). 02 WORK-LOCAL-NUMBER PIC S9(8) COMP.
    Alternatively, your DBA can modify the DB-STATISTICS record from the data dictionary to define two subordinate fields for the LOCAL-ID field. The DB-STATISTICS record describes the IDMS statistics block. To use this record, code the following statement in program variable storage:
    01 COPY IDMS DB-STATISTICS.
  • db-stat-extended
    Specifies the name of a fullword-aligned 100-byte field in program variable storage.
    The data that is copied from IDMS-STATISTICS to
    db-stat-extended
    is formatted as follows:
    01 DB-STAT-EXTENDED 03 SR8-SPLITS PIC S9(8) COMP. 03 SR8-SPAWNS PIC S9(8) COMP. 03 SR8-STORES PIC S9(8) COMP 03 SR8-ERASES PIC S9(8) COMP. 03 SR7-STORES PIC S9(8) COMP 03 SR7-ERASES PIC S9(8) COMP. 03 BINARY-SEARCHES-TOTAL PIC S9(8) COMP. 03 LEVELS-SEARCHED-TOTAL PIC S9(8) COMP. 03 ORPHANS-ADOPTED PIC S9(8) COMP. 03 LEVELS-SEARCHED-BEST PIC S9(4) COMP. 03 LEVELS-SEARCHED-WORST PIC S9(4) COMP. 03 FILLER PIC X(60).
    This record layout can be copied from the data dictionary. Code the following statement in program variable storage:
    01 COPY IDMS DB_STAT_EXTENDED.
For more information about the CA IDMS statistics blocks, see the
CA IDMS Database Administration
section
.
Example
The following statements perform the following tasks:
  • Establish currency for the sets in which a new EXPERTISE record will participate as a member.
  • Store the EXPERTISE record.
  • Move statistics regarding the stored EXPERTISE record to the DB-STATISTICS location in main storage.
MOVE EMP-ID-IN TO EMP-ID-0415. FIND CALC EMPLOYEE. MOVE SKILL-ID-IN TO SKILL-ID-0455. FIND CALC SKILL. STORE EXPERTISE. ACCEPT DB-STATISTICS FROM IDMS-STATISTICS.
Status Codes
After completion of the ACCEPT DATABASE STATISTICS function, the ERROR-STATUS field in the IDMS communications block indicates the outcome:
Status code
Meaning
0000
The request has been serviced successfully.
1518
The database statistics location has not been bound properly.