CL Command Reference - DLCOBJ

CL Command List > DLCOBJ Reference

Description:

The Deallocate Object (DLCOBJ) command releases the allocations of the specified objects. The objects, allocated earlier by one or more Allocate Object (ALCOBJ) commands, are freed for use by other jobs, or threads. If the DLCOBJ command is used when a lock does not exist, no error occurs.

If the DLCOBJ command is not used, the objects may be automatically deallocated. Allocated job-scoped locks are automatically released when the job ends. Allocated thread-scoped locks are automatically released when the thread ends. If a thread received a job-scoped lock, the job will continue to hold that lock after the requesting thread ends. Lock-space-scoped locks are not automatically released.

The DLCOBJ command should not be issued for an object that was not explicitly allocated by the ALCOBJ command. If the DLCOBJ command is used this way, internal locks on the object are released, making the object capable of being deleted.

To release more than one lock for an object with a single DLCOBJ command, the object name, type, and lock state must be repeated in the list for each lock you want to release.

NOTES:

1. When deallocating distributed data management (DDM) files and distributed files, additional time is required for the command to complete because of the time required for establishing communication and for deallocating files on remote systems.

2. Allocating an object by specifying *LIBL for the object¡¯s library, changing the thread¡¯s library list, and then attempting to deallocate the object by specifying *LIBL for the object¡¯s library can result in issuing the deallocate against the wrong object. This could release internal locks.

Restrictions:

1. This command cannot be used to deallocate a device description, *DEVD, for an advanced program-to-program communications (APPC) device or for an intrasystem (INTRA) device.

2. This command can be used to deallocate only the following database *FILE types:
. Physical files
. Logical files
. Distributed files
This deallocates the piece of the file on each node in the node group.
. DDM files
This deallocates both the DDM file on the local system and the file on the remote system that is identified in the DDM file.

3. In multithreaded jobs, this command is not threadsafe for distributed files. This command is also not threadsafe for distributed data management (DDM) files of type *SNA.


Examples:

Example 1: Deallocate a File for the Job

DLCOBJ OBJ((LIBB/FILEA *FILE *SHRRD))

This command releases the shared-for-read allocation of the first member of file FILEA in library LIBB that was held by the job.



Example 2: Deallocate a Data Area for the Thread

DLCOBJ OBJ((LIBY/DATAAREAX *DTAARA *SHRRD )) SCOPE(*THREAD)

This command releases the shared-for-read allocation of the data area DATAAREAX in library LIBY that was held by the thread.



Example 3: Deallocate File for Lock Space

DLCOBJ OBJ((LIBB/FILEA *FILE *EXCL MEMBERA))
SCOPE(*LCKSPC)

This command deallocates member MEMBERA of file FILEA in library LIBB from the lock space attached to the current thread.