Previous Topic: Retrieve Data Using Alternate Indexes

Next Topic: Work with Files

Control UDB Availability

As described earlier, UDBs are made available to NCL procedures through the UDBCTL command, which assigns a logical file ID. For more information about the UDBCTL command, see the Online Help.

For a variety of reasons you might want to change the availability of UDBs from time to time. The UDBCTL command provides the following facilities:

Stop a UDB

This logically blocks all further attempts to access the specified UDB from any procedure, so that no further &FILE statements which specify the ID for this UDB will be allowed. The physical data set remains open. STOP is rejected if there is any current user of the file.

Close a UDB

Implies a STOP and physically closes the file. This might be necessary if external updating of the UDB is required while the file is still allocated to your product.

Reset a closed UDB

In VSAM terms, RESET causes your product to open the VSAM ACB with the RST option, which has the effect of emptying the entire file. VSAM constraints mean that RESET cannot be used on UDBs unless they are sub allocated (in those levels of VSAM that support sub allocation) and is not allowed if the cluster is defined with KEYRANGES or has alternate indexes associated with it.

Open a UDB

Reopens a previously-closed UDB. If the UDB had also been RESET and has not been loaded externally before re-opening, Your product will initialize the file. A UDB that is OPENED requires re-assignment of its logical file ID before it becomes available for processing again.

These UDBCTL options provide operational control over the availability of UDBs to the product region. UDBCTL can itself be issued from within NCL procedures by suitably-authorized users.