Previous Topic: Restrictions When Using UDBs

Next Topic: VSAM Considerations for Alternate Indexes

Create UDBs with Alternate Indexes

The description of UDB usage in the preceding sections has been restricted to the processing of records that are identified by a record key starting at position 0 in the record. This is referred to as the base key for the file.

The base key allows an NCL procedure to position a UDB to a particular record or group of records within the file, based on the comparison of a key provided as an argument against the keys of records present on the file.

This method of accessing records is adequate for many NCL applications. However, there are other applications which might require access to records within the UDB based on more than one argument.

The use of alternate indexes provides a means by which many arguments can be used to position a UDB to a particular record or record group and allows many different views of the same data held in a single UDB.

As an example, an installation that runs EASINET to provide access to all VTAM applications within its network uses the special LOGPROC NCL procedure to monitor the passing of EASINET controlled terminals to different applications. Each time a logon request is processed, a message is written to the activity log. It is intercepted by LOGPROC and a record written to a UDB that records the time, target application, and name of the terminal concerned.

This information is built up over time and NCL procedures are written to analyze the activity represented by the data on the UDB, where analysis is required by time, by application and by terminal name.

If the base key of the UDB starts with, for example, a time stamp, then the UDB is seen by NCL as being sorted in ascending time stamp order. In this case UDB processing using the time as an argument is very simple; however, if an analysis of the UDB by terminal name is required, the UDB can still be positioned only by the time argument, which is not what is required.

Alternate indices which allow the UDB to be viewed by NCL as being sorted in orders other than by time (for example, by terminal name or by target application name), simplify the processing required in procedures that need to analyze the UDB using arguments that are not satisfied by the base key of the file.

The following sections describe the steps required to create alternate indices for a UDB, the use of alternate indices within NCL procedures and the considerations associated with their use.