## 3.7 Data set open/close performance 

Currently, a maximum of 200,000 open data sets is allowed per Db2 subsystem. Opening a large number of data sets can be time consuming. z/OS release Version 2 Release 2 made some improvements to data set open (and close) processing to enhance data set allocation/deallocation time. 

## 3.7.1 DFSMS changes in z/OS V2R2 

DFSMS was enhanced to allow more and faster data set open (and close) processing. 

## Faster search for Access Method Block List 

The Access Method Block List (AMBL) is a VSAM internal control block that is associated with opened clusters. Within VSAM, the AMBLs are organized in sequential chains. These chains can be long when many clusters are opened. Then, going through the chain to locate an AMBL (mainly during close processing) takes a long time and performance can be affected. 

z/OS V2R2 addresses this issue with large AMBL chains and improved performance for Db2 linear clusters. VSAM now builds a binary tree to track the opens and closes for each cluster. In a sense, it looks similar to the volume table of contents (VTOC) Index, which is a binary tree that is pointing to VTOC. With this binary tree, a faster search can be done to determine the last open processing. With many open data sets, a significant improvement can be expected, though performance is not expected to improve when there are only a few open clusters. 

## Moving VSAM control blocks above the bar 

Although the limit of open data sets in Db2 is 200,000, the practical number can be much less, depending on the virtual storage that is available below the bar. Having many open VSAM data sets (in the DBM1 address space) uses a large amount of virtual storage that must be in 31-bit addressable private storage in z/OS V2R1. 

In DFSMS V2R2, some of the control blocks for linear clusters (VSAM LDS) are moved above the bar, if requested so by the Media Manager caller. This new feature can free up virtual storage that is allocated below the bar and allows media manager interface users to open more clusters than they did previously because the required storage is now allocated in 64-bit addressable memory. 

The Media Manager interface for this improvement is not an externally documented interface. Only authorized callers (such as Db2) can request to use this feature. 

## 3.7.2 Db2 for z/OS changes 

Db2 12 uses this enhancement to allow more control blocks to be allocated above the bar. 

With the PTF for APAR PI73101, changes were also made in Db2 12 to reduce the storage cushion to 10% of the region size and to reduce the amount of storage that is reserved for MVS usage to allow for more usable storage below the bar. This enhancement is also available in Db2 11 with APAR PI71764. 

Use z/OS Version 2 Release 2 or higher with Db2 12 to take advantage of these performance enhancements. 

