Using VSAM files
When using VSAM files, increase the number of data buffers (BUFND) for sequential access or index buffers (BUFNI) for random access.
Also, select a control interval size (CISZ) that is appropriate for the application. A smaller CISZ results in faster retrieval for random processing at the expense of inserts, whereas a larger CISZ is more efficient for sequential processing. In general, using large CI and buffer space VSAM parameters may help to improve the performance of the application.
In general, sequential access is the most efficient, dynamic access the next, and random access is the least efficient. However, for relative record VSAM (ORGANIZATION IS RELATIVE), using ACCESS IS DYNAMIC when reading each record in a random order can be slower than using ACCESS IS RANDOM, since VSAM may prefetch multiple tracks of data when using ACCESS IS DYNAMIC. ACCESS IS DYNAMIC is optimal when reading one record in a random order and then reading several subsequent records sequentially.
Access mode | CPU Time (seconds) | Elapsed (seconds) | EXCP counts |
---|---|---|---|
ACCESS IS SEQUENTIAL | 100% | 100% | 100% |
ACCESS IS DYNAMIC with READ NEXT | 134% | 143% | 193% |
ACCESS IS DYNAMIC with READ | 713% | 1095% | 7189% |
ACCESS IS RANDOM | 1405% | 3140% | 15190% |
If you use alternate indexes, it is more efficient to use the Access Method Services to build them than to use the AIXBLD runtime option. Avoid using multiple alternate indexes when possible since updates will have to be applied through the primary paths and reflected through the multiple alternate paths.
Refer to Chapter 4.1 about the location of VSAM buffers.
- AMP='ACCBIAS=DO': optimize for only random record access
- AMP='ACCBIAS=SO': optimize for only sequential record access
- AMP='ACCBIAS=DW': optimize for mainly random record access with some sequential access
- AMP='ACCBIAS=SW': optimize for mainly sequential record access with some random access
Refer to Tuning your program in the Enterprise COBOL for z/OS® Programming Guide for additional coding techniques and best practices.