Use DI

PURPOSE:  The command USE DI declares a Data Index (DI) for use with a master data set (DS).  USE NO DI closes any active DI.

Syntax

USE DI name [IN DBL dbl_name]

USE NO DI

USE DI name

declares an existing DI for the current DS and sets that name to @DI_NAME.  The DI must, of course, be associated with the current DS.  A DS must be declared before a DI can be declared.

IN DBL dbl_name

is used to invoke a DI in a Data Base Library (DBL) other than the current one.

USE NO DI

causes any active index to be closed and clears @DI_NAME.  Further commands that affect the DS will process it without an index, until an index is activated with a USE DI command.

EXAMPLE

*USE DS DISCOUNTS
*USE DI DISCOUNTS

Lines in a command module:

00110   USE DS DISCOUNTS DI DISCOUNTS
or
00200   USE DS DISCOUNTS
00210   USE DI DISCOUNTS

NOTES:  A following USE DS or USE DI command closes the currently declared DI.

A DI can be used with all Data Manipulation commands except SORT, APPEND, and MERGE.

When a DI is declared, records are retrieved from the DS in the order of a domain of the index.  A DI to a master DS is activated by the USE DI command or the DI clause of the USE DS command.

Once an index is active, by default, the first domain in the Data Index (DI) is assumed, and retrieval is in the sequence determined by that domain.  This default option can be overridden by using the optional clause USE DOMAIN in a Data Manipulation command.

DI’s can also be declared with ENTER and LOAD.  In this case, the domains of the DI are automatically updated during command execution.

If a REMOVE command specified the current DI for removal, ACCENT R sets the USE NO DI condition.