Automatic DASD space functions
The desired amount of space to reserve will be calculated by using either the value specified for Overflow records on a CREATE IAM Override card or by using the CA% free space value specified on the Define of the file. Basically, the CA% free space value is cut in half, and then that percentage of the total DASD space required for the data set as loaded will be set as the desired reserve quantity.
When the program loading the file issues the close, IAM looks at how much DASD space is allocated to the data set, but is not yet used. If the allocated but unused space is less than the desired reserve quantity, then no space will be released. However, if the allocated but unused space is greater than the desired reserve quantity, then space will be released down to the desired reserve quantity. In all cases, the end of file is set at the end of the used area, and is indicated in the VTOC LSTAR field. This will allow a DASD space management utility, such as BMC’s FDR/CPK product, to release the unused space that was reserved, if it has not yet been used.
Space reserve and release example
For example, consider a file where CA% Free space is defined as 20%, and the file ends up using 300 tracks of space. A DASD reserve value of 30 tracks is calculated by taking half of the CA% free space, or 10% of the 300 tracks. Any allocated space over 330 tracks will be released. If the data set is allocated to less than 330 tracks, then no space will be released. If the file was allocated initially with 600 tracks, then 270 tracks of space will be released, leaving a total of 330 tracks allocated to the IAM data set.
If CA% free space is 0 and there is no Overflow override, then no space reserve will be done, and all excess allocated space will be released. In the example cited above, the data set would end up with only 300 tracks allocated. If the desired space reserve quantity is less than one cylinder, then no space reserve will be done, because most files are cylinder allocated, and the space release is done at a cylinder boundary.
Automatic space release summary
RELEASE is an important IAM feature. IAM files generally take 30 to 70% less disk space than VSAM. If the original VSAM IDCAMS DEFINE space allocation values were left unchanged without auto-RELEASE, a lot of disk space would continue to go to waste.
RELEASE is IAM's default and as most other IAM defaults it can be changed in the IAM Global Options table using the program IAMZAPOP, see IAM-Global-Option-Change-Facility of the IAM space.
Dynamic secondary space adjustment
IAM will dynamically adjust the secondary space quantity for IAM files that are in standard non-extended format or in Large Sequential format. This function is provided because such data sets are limited to 16 extents per volume. The algorithm will take effect once a file has used five extents on a volume. At that point in time, IAM will increase the secondary space allocation by a multiplication factor specified in the Global Options Table, or from IAM Overrides. The default secondary space multiplication factor as IAM is shipped is ten for file loads, and five for file updates. The Secondary Space Adjustment feature is subject to the following rules:
- The secondary space quantity will not be increased to a value that exceeds the original primary space quantity.
The secondary space quantity will not be increased to a value that exceeds the size of the largest contiguous available extent on the volume.
- If the original secondary space quantity is higher than the original primary space quantity, the secondary space quantity will not be adjusted.
- For single volume files, the original secondary may be decreased from the original value to the largest extent available on the volume, just to try to keep it running as long as possible.
- Secondary space adjustment is not used for DFSMS Extended Format data sets because they are able to obtain up to 123 extents per volume instead of 16.
- Secondary space adjustment of DFSMS managed data sets may yield unanticipated results, particularly for multi-volume data sets. It appears that during the process of extending to an additional candidate volume that DFSMS will stop picking up revised secondary quantities from the JFCB. Subsequent job steps may result in this feature working again until another volume is added.
For example, if a file is Defined with a primary quantity of 500 cylinders, and a secondary of 10 cylinders, after five extents have been acquired, the secondary space during a file load will be adjusted up to 100 cylinders. During a file load, the maximum space that will be used for this file is:
- 1 extent of 500 cylinders
- 4 extents of 10 cylinders each
- 11 extents of 100 cylinders
This will bring the total maximum space up to 1,640 cylinders, which is slightly less than the VSAM maximum of 1,720 cylinders. Although, IAM allocated less DASD space than VSAM, the amount of user data kept in the IAM file will generally be larger due to IAM's space savings capabilities. This is due to IAM’s efficient use of DASD devices and Data Compression feature. So, by providing the Dynamic Secondary Space Adjustment feature, IAM files have the potential to grow in size as large as VSAM files will, although it will be done in fewer extents.
For this same allocation, the secondary will be adjusted up to 50 cylinders during a file update run. However, if the primary space is 20 cylinders, and the secondary space is 10 cylinders, then the maximum value that will be used for the secondary space is limited to 20 cylinders. The maximum secondary space quantity that will be requested for any particular file is included on the IAMPRINT LISTCAT output.
Dynamic secondary space adjustment overrides
The secondary extent multiplication factor can be changed by IAM Overrides on a file-by-file basis, using the MAXSECONDARY keyword. Regardless of the value set, the basic rules for modifying the secondary space quantity remain as explained above. The factor can be specified on the IAM CREATE override during the file definition or file load, and on file updates with an IAM ACCESS override. The values permitted are from zero to ten. Values of zero or one will prevent IAM from increasing secondary allocation. The secondary allocation value may be reduced for single-volume files when there is insufficient space for the secondary. When the secondary factor is specified on a CREATE override during file definition, the value is stored with the file. That value will be used for subsequent file loading and file updates unless overridden at run time.
Multi-volume considerations
With the IAM Dynamic Secondary Space Adjustment feature, there is an additional option for multi-volume files that are defined without guaranteed space. Again, this function does not apply to DFSMS Extended Format IAM data sets. When it appears to IAM that the EOV request will result in the next volume being allocated, then IAM will request the primary space value, rather than the normal secondary quantity that is used for non-VSAM files. This feature can be controlled by either IAM Overrides, or by the IAM Global Options table. This feature is provided to offer an alternative so that IAM space allocations will be similar to VSAM. The IAM Override keyword is:
- IX_MULTIVOLUME_2 • MULTIVOLUME=PRIMARY or
- MULTIVOLUME=SECONDARY
These IAM Override keywords can be used on the CREATE Override statement. When specified on the CREATE keyword during file definition, the value specified is saved with the file control information and will remain the applicable option, unless overridden by a particular job step.
The rules for IAM files defined on DFSMS managed volumes with the Guaranteed Space attribute are different. This is because DFSMS will automatically allocate the primary space quantity on each volume when the file is defined. The secondary allocation quantity will be modified as described above for single volume files.
Another special multi-volume circumstance is, when a file is defined with no secondary space specified. For most circumstances, IAM will set the secondary allocation value to the primary value. For data sets on DFSMS managed volumes with Guaranteed Space, the secondary is left as zero, with the primary being allocated on each volume when the file is defined. For systems where DFSMS is active, but the data sets are on non-SMS managed volumes, IAM will leave the secondary as zero, and allocate the primary space on each volume when the file is defined. This is to mimic the DFSMS Guaranteed Space and will prevent any secondary extents from being taken.