Using ENQ and DEQ commands without ENQMODEL resource definitions

The ENQ and DEQ commands are used to serialize access to a shared resource. These commands only work for CICS tasks running in the same region.

The ENQ and DEQ commands cannot be used to serialize access to a resource shared by tasks in different regions, unless they are supported by appropriate ENQMODEL resource definitions so that they have sysplex-wide scope. See Using ENQ and DEQ commands with ENQMODEL resource definitions and ENQMODEL resource definitions for a description of ENQMODELs.

Note that any ENQ that does not specify the LENGTH option is treated as an enqueue on an address and therefore has only local scope. The use of ENQ and DEQ for serialization (without ENQMODEL definitions to give sysplex-wide scope) is illustrated in Figure 1.
Figure 1. Illustration of inter-transaction affinity created by use of ENQ/DEQ commands. TRN2 must execute in the same target region as TRN1.
TRN1 executes in AOR!. It issues an ENQ command on the resource name of a shared resource and uses the resource. TRN2 executes in AOR1 and issues an ENQ on the same resource. It is suspended by CICS until TRN1 issues a DEQ.

If TRN2 shown in Figure 1 executed in a different target region from TRN1, TRN2 would not be suspended while TRN1 accessed the shared resource. For this reason, a dynamic or distributed routing program must ensure that all tasks that enqueue on a given resource name must execute in the same target region to preserve the application design. TRN2 would, of course, be serialized with other CICS tasks that issue ENQ commands on the same resource name in its target region.



dfhp3t5.html | Timestamp icon Last updated: Thursday, 27 June 2019