DEQ

Schedule use of a resource by a task (dequeue).

DEQ

Read syntax diagramSkip visual syntax diagramDEQRESOURCE( data-area)LENGTH( data-value)UOWMAXLIFETIME( cvda)TASK

Conditions: INVREQ, LENGERR

This command is threadsafe if it is defined as LOCAL. It is non-threadsafe if it is defined as GLOBAL.

Note for dynamic transaction routing:  Using this command could create inter-transaction affinities that adversely affect the use of dynamic transaction routing, unless the name specified in RESOURCE matches the name specified in an installed ENQMODEL resource definition, that has sysplex-wide scope. See Affinity for more information about transaction affinities.

Description

DEQ causes a resource currently enqueued on by the task to be released for use by other tasks.

If a task enqueues on, but does not dequeue from, a resource, CICS automatically releases the resource during syncpoint processing or when the task is terminated. A resource in the context of this command is any string of 1–255 bytes, established by in-house standards, to protect against conflicting actions between tasks, or to cause single-threading within a program.

When issuing the DEQ command, the resource to be dequeued from must be identified by the method used when enqueuing on the resource. If no enqueue has been issued for the resource, the dequeue is ignored.

If more than one ENQ command is issued for a resource by a task, that resource remains owned by the task until the task issues a matching number of DEQ commands.

When an EXEC CICS DEQ (or ENQ) command is issued for a resource whose name matches that of an installed ENQMODEL resource definition, CICS checks the value of the ENQSCOPE attribute to determine whether the scope is local or sysplex-wide. If the ENQSCOPE is non-blank, CICS treats the ENQ or DEQ as sysplex-wide, and passes a queue name and the resource name to z/OS® global resource serialization to manage the enqueue. If the ENQSCOPE attribute is left blank (the default value), CICS treats the DEQ as local to the issuing CICS region. If no ENQMODEL matches the resource name, the scope of the DEQ command is local. For more information on ENQMODEL resources, see ENQMODEL resources.

Options

LENGTH(data-value)
specifies that the resource to be dequeued from has a length given by the data value. The data value is a halfword binary value in the range 1 through 255. If the value you specify is outside this range, a LENGERR condition occurs. If the LENGTH option is specified in an ENQ command, it must also be specified in the DEQ command for that resource, and the values of these options must be the same.
MAXLIFETIME(cvda)
specifies the duration of the ENQ being released. CVDA values are:
UOW
The enqueue was acquired with a duration of a unit of work. This is the default value.
Note: For compatibility with previous releases of CICS, a CVDA value of LUW is also supported.
TASK
ENQ was acquired with a duration of a task.
RESOURCE(data-area)
specifies either an area whose address represents the resource to be dequeued from, or a variable that contains the resource (an employee name, for example). In the latter case, you must use the LENGTH option.

Conditions

16 INVREQ
RESP2 values:
2
The MAXLIFETIME option is set with an incorrect CVDA.

Default action: terminate the task abnormally.

22 LENGERR
RESP2 values:
1
The value you specified for the LENGTH option is outside the range 1 through 255.

Default action: terminate the task abnormally.

Examples

The following examples show how to dequeue from a resource:
EXEC CICS DEQ
     RESOURCE(RESNAME)
 
EXEC CICS DEQ
     RESOURCE(SOCSECNO)
     LENGTH(9)