Using IAM Alternate Index support


IAM Alternate Index support allows you to define and use IAM Alternate Indexes and Paths to Enhanced Format IAM KSDS or ESDS type of files. As with standard IAM support, there are no changes required to application programs and generally no changes to JCL, other than to indicate on the definition that the base cluster is to be an IAM data set. The DEFINE ALTERNATEINDEX and DEFINE PATH can be changed similarly, but there is no requirement to do so. The rest of the alternate index processing is essentially the same as done with VSAM alternate indexes. Some changes may be required when renaming or creating copies with different names, to synchronize all the related data sets with the new names.

Alternate index

An alternate index provides an additional index to an indexed type of data set (KSDS), or an index to an entry sequence data set (ESDS). Users can define one or more alternate indexes to any base data set. The alternate index data set itself is an IAM KSDS enhanced format type of data set that is indexed by the alternate key. The records in the alternate index contain some control information, the alternate key, and the primary key value for the record in the base data set with the corresponding alternate key. An alternate index is defined as containing UNIQUE keys when there is only one base record with any specific alternate key. Alternate indexes can also be defined as containing NONUNIQUE keys, where any particular alternate key can be contained in multiple base records. As with VSAM, the alternate index data set can be explicitly processed by programs without referencing the base cluster, or can be used to access the records in the base cluster. To use an alternate index data set to access the records in the base cluster, a PATH must be defined.

An additional attribute of alternate index data sets is being upgradeable. When an alternate index is defined with the UPGRADE attribute, IAM automatically updates the alternate index as needed whenever updates are made to the base cluster, either through the primary key or through an alternate key. Any alternate index defined with the NOUPGRADE attribute does not automatically updated by IAM, and it is the application program’s responsibility to ensure that the alternate index is updated in a manner to remain synchronized with the base data set.

Path

A PATH provides the mechanism to access a base cluster through an alternate index. When a path is defined, one must provide the name of the path and the name of the related alternate index to be used to access the base cluster, or the base cluster to be processed, whenever the path itself is referenced. The UPDATE or NOUPDATE attribute is specified for each path defined. When a path is defined with the NOUPDATE attribute, any upgradeable alternate indexes will not be updated automatically when this path is used to access a base cluster either directly or through an alternate index.

For VSAM data sets, a PATH is only a catalog entry that is quite similar to an ALIAS entry. With IAM, a PATH becomes a one-track data set containing the name of the related alternate index or base cluster and the UPDATE or NOUPDATE attribute of the PATH. A single track data set was chosen instead of an ALIAS type of catalog entry because of concerns about unavailability of adequate data set management utility program support for ALIAS entries, which might result in the loss of the entry.

Alternate index associations

For VSAM data sets, the associated data sets in an alternate index sphere are linked together by an association cell within the catalog entry for the data set. Because IAM data sets are cataloged as non-VSAM data sets, there are no association cells within the non-VSAM catalog entry. For this reason, IAM saves the association information within each of the associated IAM data sets. The association information consists of the data set name and type (Base, AIX, or Path) of data set, and includes the update or upgrade attribute. Whenever a LISTCAT is requested (or an IAM ISPF display) for an IAM data set that is part of an alternate index sphere, the association information will be included in the output. The information in the association cell is critical, because it will direct the processing during an open of a component of the sphere, and when deleting an alternate index sphere.

Warning

Important

Each data set includes the associated information as a self-describing association entry. The associations are always listed in the order that each are defined, beginning with the base cluster.

Base cluster associations

For a base cluster, the associations will include in addition to itself, all of the alternate indexes that have been defined for that base cluster, and all of the paths that have the base cluster as its path entry data set. Not included in the base cluster associations are the paths that have the alternate indexes as path entries. A base cluster could have several associations. The number of associations is limited by the block size of the IAM data set. For a typical 1/4 track blocked IAM data set, it can have a maximum of 204 associated data sets.

Alternate index associations

For an alternate index, the associations will include the related base cluster, its own self-entry, and any paths that have been defined with this particular alternate index as its path entry.

Path associations

The path associations will consist of the base cluster, the path, and if the path entry is an alternate index, then the alternate index.

Association maintenance

In general, data set management utility software products treat IAM files as non-VSAM data sets. Therefore, these products will not know the associations between these non-VSAM data sets, which will require some additional effort on the part of users. The main areas of concern are renaming one or more of the data sets in an alternate index sphere, or performing a copy or restore a new name of such a data set. After changing the name of one or more components of an IAM alternate index sphere, it will be necessary to perform a DEFINE RECATALOG on all of the components affected to insure that the data set names are all properly reflected in the saved association information. IAM includes special processing on a DEFINE RECATALOG to perform the renames on the internal association data. Procedures for performing this recatalog process are described in Special-considerations-with-IAM-Alternate-Indexes and Recataloging-IAM-Data-Sets. Also, an automatic recatalog function is invoked when an IAM AIX sphere is opened, provided the change in the names of the associations are consistent with the name of the component being opened.

Support to erase the associations from the base cluster is available, if for example, a base cluster has been copied or restored with a new name. To erase the associations, one can perform a DELETE AIX NOSCRATCH on the base cluster, which will clear out all related alternate index information.

Using an IAM alternate index

The procedure for defining and using IAM data sets with alternate indexes is identical to the VSAM process. The only difference is to specify on the DEFINE that the base cluster should be an IAM data set. This specification is typically done by either adding an OWNER($IAM) parameter to the define parameters, or changing the name to include the $IAM literal. Most applications that are going to be using IAM for their alternate index already have the general procedures established. To convert to IAM, the only change needed is in the 'define' step of the base cluster. The sequence of the process for using an IAM alternate index includes the following steps:

The first two steps of defining and loading the base cluster are described in prior sections the IAM space. Details and examples of those steps will not be presented here. This section describes the rest of the procedures for using IAM Alternate Indexes.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI Storage IAM 11.1