Using ENQ and DEQ commands with ENQMODEL resource definitions

The ENQ and DEQ commands are used to serialize access to a shared resource.

In earlier releases of CICS, these commands were limited to the scope of CICS tasks running in the same region, and could not be used to serialize access to a resource shared by tasks in different regions. Now, if the ENQs and DEQs are supported by appropriate ENQMODEL resource definitions (see ENQMODEL resource definitions for a description of ENQMODELs) they can have sysplex-wide scope.

This is primarily of interest to the system programmer who determines transaction routing decisions, but application programmers should be aware of the advantages now available.

Overview of sysplex enqueue and dequeue

Changes to the CICS enqueue/dequeue function extend the CICS application programming interface to provide an enqueue mechanism that serializes access to a named resource across a specified set of CICS regions operating within a sysplex. This applies equally to a CICSplex within a single MVS™ image and to a CICSplex that resides in more than one MVS. Sysplex-wide enqueue is supported only for a resource, and not for an enqueue on an address.

Local enqueues within a single CICS region are managed within the CICS address space. Sysplex-wide enqueues that affect more than one CICS region are managed by Global Resource Services (GRS). The main points of the changes to the CICS enqueue/dequeue mechanism are as follows:
  • Sysplex enqueue and dequeue expands the scope of an EXEC CICS ENQ|DEQ command from region to sysplex, by introducing a new CICS resource definition type, ENQMODEL, to define resource names that are to be sysplex-wide.
  • ENQSCOPE, an attribute of the ENQMODEL resource definition, defines the set of regions that share the same enqueue scope.
  • When an EXEC CICS ENQ (or DEQ) 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, as follows:
    • If the ENQSCOPE attribute remains blank (the default value), CICS treats the ENQ|DEQ as local to the issuing CICS region.
    • If the ENQSCOPE is non-blank, CICS treats the ENQ|DEQ as sysplex-wide, and passes a queue name and the resource name to GRS to manage the enqueue. The resource name is as specified on the EXEC CICS ENQ|DEQ command, and the queue name is made up by prefixing the four-character ENQSCOPE with the letters DFHE.
  • The CICS regions that need to use sysplex-wide enqueue/dequeue function must all have the required ENQMODELs defined and installed.

    The recommended way to ensure this is for the CICS regions to share a CSD, and for the initialization group lists to include the same ENQMODEL groups.

Existing applications can use sysplex enqueues by defining appropriate ENQMODELs, without any change to the application programs.

Benefits of sysplex enqueue

Sysplex enqueue provides the following benefits:
  • Eliminates one of the most common causes of inter-transaction affinity.
  • Enables better exploitation of a parallel sysplex providing better price/performance, capacity, and availability.
  • Reduces the need for inter-transaction affinity rules in dynamic and distributed routing programs lowering the Systems Management cost of using parallel sysplex.
  • Enables serialization of concurrent updates to shared temporary storage queues, performed by multiple CICS tasks across the sysplex.
  • Makes it possible to prevent interleaving of records written by concurrent tasks in different CICS regions to a remote transient data queue.
  • Allows the single-threading and synchronization of tasks across the sysplex. It is not designed for the locking of recoverable resources.


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