The ACCEPT IDMS STATISTICS statement copies system runtime statistics located in the program's statistics block to program variable storage. While a run unit executes, your program can issue ACCEPT IDMS STATISTICS as many times as required. For example, you might want to request database statistics after storing a variable-length record. This allows you to determine whether the entire record was stored in one place, or fragments were placed in an overflow area.
The ACCEPT IDMS STATISTICS statement does not reset any of the statistics fields to zero. IDMS statistics block fields are reset only when you issue a FINISH command.
You can use the ACCEPT IDMS STATISTICS statement in both the navigational and Logical Record Facility (LRF) environments.
►►─── ACCEPT IDMS_STATISTICS INTO (db-statistics-field);──────────────────────► ►─┬───────────────────────────────────┬─ ; ──────────────────────────────────►◄ └─EXTENDED (db-stat-extended)───────┘
Identifies the field (in program variable storage) the system runtime statistics contained in IDMS_STATISTICS are to be copied to. Db-statistics-field is defined as an aligned, 100-byte field.
The DBMS copies IDMS_STATISTICS data to db-statistics-field according to the following format:
DECLARE
01 DB_STATISTICS,
03 DATE_TODAY CHAR(8),
03 TIME_TODAY CHAR(8),
03 PAGES_READ FIXED BINARY(31),
03 PAGES_WRITTEN FIXED BINARY(31),
03 PAGES_REQUESTED FIXED BINARY(31),
03 CALC_TARGET FIXED BINARY(31),
03 CALC_OVERFLOW FIXED BINARY(31),
03 VIA_TARGET FIXED BINARY(31),
03 VIA_OVERFLOW FIXED BINARY(31),
03 LINES_REQUESTED FIXED BINARY(31),
03 RECS_CURRENT FIXED BINARY(31),
03 CALLS_TO_IDMS FIXED BINARY(31),
03 FRAGMENTS_STORED FIXED BINARY(31),
03 RECS_RELOCATED FIXED BINARY(31),
*03 LOCKS_REQUESTED FIXED BINARY(31),
*03 SEL_LOCKS_HELD FIXED BINARY(31),
*03 UPD_LOCKS_HELD FIXED BINARY(31),
*03 RUN_UNIT_ID FIXED BINARY(31),
*03 TASK_ID FIXED BINARY(31),
*03 LOCAL_ID CHAR(8),
03 FILLER CHAR(8);
*Applies to CA IDMS/DB 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 binary value) assigned to the run unit by that interface. For batch and z/VM run units, this identifier specifies the internal machine time. For 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, you can move the LOCAL-ID field to a work field:
01 WORK_LOCAL_ID, 02 WORK_LOCAL_ORIGIN CHAR(4), 02 WORK_LOCAL_NUMBER FIXED BINARY(31);
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 INCLUDE IDMS (DB_STATISTICS);
Identifies the field (in program variable storage) the extended system runtime statistics contained in IDMS_STATISTICS are to be copied to Db-stat-extended is defined as an aligned, 100-byte field.
The DBMS copies IDMS_STATISTICS data to db-stat-extended according to the following format:
01 DB-STAT-EXTENDED 03 SR8-SPLITS FIXED BINARY (31), 03 SR8-SPAWNS FIXED BINARY (31), 03 SR8-STORES FIXED BINARY (31), 03 SR8-ERASES FIXED BINARY (31), 03 SR7-STORES FIXED BINARY (31), 03 SR7-ERASES FIXED BINARY (31), 03 BINARY-SEARCHES-TOTAL FIXED BINARY (31), 03 LEVELS-SEARCHED-TOTAL FIXED BINARY (31), 03 ORPHANS-ADOPTED FIXED BINARY (31), 03 LEVELS-SEARCHED-BEST FIXED BINARY (31), 03 LEVELS-SEARCHED-WORST FIXED BINARY (31), 03 FILLER0001 FIXED BINARY (31);
This record layout can be copied from the data dictionary. Code the following statement in program variable storage:
01 INCLUDE IDMS (DB_STAT_EXTENDED).
Note: For more information about the CA IDMS statistics blocks, see the CA IDMS Database Administration Guide.
The following statements:
EMP_ID_0415 = EMP_ID_IN; FIND CALC RECORD (EMPLOYEE); SKILL_ID_IN = SKILL_ID_0455; FIND CALC RECORD (SKILL); STORE RECORD (EXPERTISE); ACCEPT IDMS_STATISTICS INTO (DB_STATISTICS);
Upon completion of the ACCEPT IDMS STATISTICS function, the ERROR_STATUS field in the IDMS DB communications block indicates the outcome of the operation:
The request was serviced successfully.
The database statistics location was not a valid address.
|
Copyright © 2014 CA.
All rights reserved.
|
|