The Connect:Direct® for z/OS® statistics facility logs statistics to a series of VSAM file pairs. Each pair consists of an entry-sequenced file and a key-sequenced file, both with the REUSE attribute.
File Pair Configuration
The minimum configuration is two file pairs, or four files, however you can configure more than two file pairs. Specify the file pairs in the initialization parameters, STAT.DSN.BASE and STAT.FILE.PAIRS, as data set name high level qualifiers and the number of pairs. This specification determines the configuration of the statistics file pair list.
Within each file pair, IBM Connect:Direct writes the statistics records to the entry-sequenced file, while the key-sequenced file maintains index information about the records. On average, IBM Connect:Direct writes records to the key-sequenced file at the rate of about one for every two records written to the entry-sequenced file.
Retrieving Statistics with the SELECT STATISTICS Command
When you issue SELECT STATISTICS commands, the system locates the requested records by using the key-sequenced file as an index to the entry-sequenced file. All the file pairs defined to the DTF are available to SELECT STATISTICS command processing. IBM Connect:Direct searches any file pair that contains records satisfying the SELECT STATISTICS command, not just the files currently being written.
How Records Are Written
IBM Connect:Direct writes the statistics records to the entry-sequenced VSAM files in chronological order, starting at the beginning of the file and proceeding until the file or its paired key-sequenced file is full. The oldest record is always at the beginning of the file and the newest record is last. The system records each statistics record as a single VSAM record. The system does not compress the records or add control information.
When a file pair is full, the system switches to the next in the sequence, and begins writing to it. When the last file pair in the list is full, the system wraps back to the first pair in the sequence.
You can also specify the time of a file switch by using the STAT.SWITCH.TIME initialization parameter. For example, you can specify that statistics files switch at midnight every day, which limits a file pair to records from a single day. IBM Connect:Direct also provides a statistics switch API command that directs the DTF to perform a switch at any time.
When the system has written to all the pairs in the list, the system reuses the pairs. When a switch is made, the system closes the active pair and makes the pair with the oldest data the new active pair. When the system switches to a file, or a file becomes active, IBM Connect:Direct for z/OS does a VSAM RESET. This VSAM RESET erases any records and index information in the active file. The system then writes new records starting at the beginning of the file.