IMS Sparse Index Exits

Sparse index exits suppress secondary index generation. This is an emulation of a mainframe feature.

Invocation
IMS sparse index exits are invoked at run time.
Coding Requirements
When an application program issues a call of a segment serving as an index source segment for one or more indexing relationships, the DL/I index maintenance routine is invoked. Enterprise Server supports the following segment calls:
DLET
An indexing segment is built corresponding to the existing index source segment. If it passes the null value test, the index exit routine is invoked. This routine indicates whether this indexing segment should appear in the index. If it should appear, the actual indexing segment is retrieved and deleted; otherwise, no delete is attempted.
ISRT
The indexing segment is built to correspond to the segment to be inserted, and the null value test and the exit routine tests are performed. If no suppression of indexing is indicated by either, it is inserted into the index.
REPL
Can be a combination of a DLET call and an ISRT call, a simple replace, or a NOP, depending on the fields changed in the replace. If a field in the Index Source Segment (ISS) is changed by a REPL call that changes the indexed data or subsequent data, the existing indexing segment is deleted and a new one inserted. The index edit routine is invoked for each operation. If the change in the ISS affects a source data field, a replace operation on the indexing segment is executed, unless the index exit routine indicated that indexing was suppressed. If the ISS replace made no changes in the indexing segment, no action is taken.
Index Supression
The suppression of indexing by the exit routine must be consistent. The same indexing segment cannot be examined at two different times and have suppression indicated only once. If the indexing segment contains user data, this user data cannot be used to evaluate suppression, since the actual indexing segment is seen by the exit routine just before the insertion of a new one. In the cases of replace and delete, only a prototype is passed. The prototype contains the constant, indexed data, subsequence data, duplicate data, and any symbolic pointer that was added. Therefore, index suppression must not be based on any user data.

The sparse index exit routine issues a return code and indicates either that the present index pointer segment belongs in the index or that it should be suppressed. The exit routine must not change any IMS control blocks, or any fields in the indexing segment.

Example
Enterprise Developer provides a sample sparse index exit, SPARSRTN.cbl, which is located by default in your %PUBLIC%\Documents\Micro Focus\Enterprise Developer\Samples\Mainframe\IMS\Classic\Examples directory.