DTL (Define the Lock) Macro

The macro generates a control block which is used by the LOCK/UNLOCK macros to queue and dequeue a resource access request.

The control block, commonly called 'DTL', is generated at the time of program assembly.

Format

Read syntax diagramSkip visual syntax diagramnameDTL NAME= resourcename,CONTROL=E,CONTROL=S,KEEP=NO,KEEP=YES,LOCKOPT=1,LOCKOPT=24,OWNER=TASK,OWNER=PARTITION,SCOPE=INT,SCOPE=EXT,VOLID= volume_id

Requirements for the caller

AMODE:
24 or 31
RMODE:
ANY
ASC Mode:
Primary

Parameters

NAME=resourcename
Specifies the name by which the resource is known to the system for access share control. It is by this name that the system controls shared access of the resource as requested by active tasks via the LOCK macro. These tasks can all be active in one partition, or they might be distributed over several partitions; the resource-share control extends across partitions.

The name can be up to 12 bytes long. If it is shorter, it is padded with blanks. The name must not begin with any of the characters A through I or V, because these characters are reserved for IBM® usage.

CONTROL=E | S
Defines how the named resource can be shared while your program owns it, which is determined by this specification and your specification for the operand LOCKOPT. A specification of E means that the resource is queued for exclusive use; a specification of S means that the resource is queued as shareable.
KEEP=NO | YES
This operand can be used to lock the named resource beyond job step boundaries. Only a main task should use this operand. KEEP=NO indicates that the named resource once locked, is to be released automatically at the end of the particular job step. With KEEP=YES, a named resource that is locked remains locked across job steps; it is automatically released at end of job.

If a job terminates abnormally, all resources with KEEP=YES are unlocked by the abnormal termination routine.

LOCKOPT=1 | 2 | 4
This operand, together with the CONTROL operand, determines how the system controls shared access in response to a LOCK request.
LOCKOPT=1 and CONTROL=E
No other task is allowed to use the resource concurrently.
LOCKOPT=1 and CONTROL=S
Other 'S' users are allowed concurrent access, but no concurrent 'E' user is allowed.
LOCKOPT=2 and CONTROL=E
No other 'E' user gets concurrent access; however, other 'S' users can have access to the resource.
LOCKOPT=2 and CONTROL=S
Other 'S' users can have concurrent access and, in addition, one 'E' user is allowed.
LOCKOPT=4 and CONTROL=E
No other 'E' user from another system is allowed concurrent access. However, other 'S' users from other systems can use the resource concurrently. (Within his own system, the user always has access to the resource.)
LOCKOPT=4 and CONTROL=S
Other 'S' users can have concurrent access and, in addition, one 'E' user from another system is allowed.
Note: If the DASDSHR support is not generated in the supervisor, the LOCK request for the resource is always granted.

All users of a particular resource must use the same LOCKOPT specification when they lock the resource. Exception: if LOCKOPT=1 and CONTROL=E, the lock status can be modified.

OWNER=TASK | PARTITION
Defines whether the named resource, once locked, can be unlocked only by the task, which issued the corresponding LOCK request (OWNER=TASK), or whether it can be unlocked by any task within the partition (OWNER=PARTITION).

When OWNER is defined as PARTITION, a LOCK request for the resource must not specify FAIL=WAIT, FAIL=WAITC, or FAIL=WAITECB, because deadlock prevention (return code 16) is not supported by OWNER=PARTITION.

SCOPE=INT | EXT
This operand can be used for locking resources across systems. SCOPE=EXT specifies that the lock is used across systems. You can omit the operand, if you want to lock your resources only on one system since the default is SCOPE=INT (that is, the locking applies to one system only).
VOLID=volume-id
Specifies the 6-byte identifier of a disk volume which (at the time of the LOCK request) is to be checked whether it is mounted on an I/O device that is defined as being shared across systems. If the device is a shared disk, the LOCK request is treated as being defined with SCOPE=EXT; otherwise, SCOPE=INT is assumed, and a SCOPE=EXT specification is ignored.