Improving VSAM performance
Your system programmer is most likely responsible for tuning the performance of COBOL and VSAM. As an application programmer, you can control the aspects of VSAM that are listed in the following table.
About this task
Aspect of VSAM | What you can do | Rationale and comments |
---|---|---|
Invoking access methods service | Build your alternate indexes in advance, using IDCAMS. | |
Buffering | For sequential access, request more data buffers;
for random access, request more index buffers. Specify both BUFND and BUFNI if ACCESS
IS DYNAMIC . Avoid coding additional buffers unless your application will run interactively; then code buffers only when response-time problems arise that might be caused by delays in input and output. |
The default is one index (BUFNI )
and two data buffers (BUFND ). |
Loading records, using access methods services | Use the access methods service REPRO command
when:
If you use a COBOL program to load the file, use |
The REPRO command can update
an indexed data set as fast or faster than any COBOL program under
these conditions. |
File access modes | For best performance, access records sequentially. | Dynamic access is less efficient than sequential
access, but more efficient than random access. Random access results
in increased EXCP s because VSAM must access the index
for each request. |
Key design | Design the key in the records so that the high-order portion is relatively constant and the low-order portion changes often. | This method compresses the key best. |
Multiple alternate indexes | Avoid using multiple alternate indexes. | Updates must be applied through the primary paths and are reflected through multiple alternate paths, perhaps slowing performance. |
Relative file organization | Use VSAM fixed-length relative data sets rather than VSAM variable-length relative data sets. | Although not as space efficient, VSAM fixed-length relative data sets are more run time efficient than VSAM variable-length relative data sets. |
Control interval sizes (CISZ ) |
Provide your system programmer with information
about the data access and future growth of your VSAM data sets. From
this information, your system programmer can determine the best control
interval size (CISZ ) and FREESPACE size (FSPC ).
Choose proper values for |
VSAM calculates CISZ to best
fit the direct-access storage device (DASD) usage algorithm, which
might not, however, be efficient for your application. An average Many control area (CA) splits are unfavorable for VSAM performance. The FREESPACE value can affect CA splits, depending on how the file is used. |
Specifying access modes for VSAM files
z/OS® DFSMS: Using Data Sets (Building a resource pool, Selecting the optimal
percentage of free space)
z/OS DFSMS: Access Method Services for Catalogs