Explicit enqueuing (by the application programmer)

CICS provides enqueuing commands that can be useful in applications when you want to protect data and prevent transaction deadlocks.

CICS® provides the following explicit enqueuing commands:
  • EXEC CICS ENQ RESOURCE
  • EXEC CICS DEQ RESOURCE
You can use these commands to perform the following functions:
  • Protect data written into the common work area (CWA), which is not automatically protected by CICS
  • Prevent transaction deadlock by enqueuing on records that might be updated by more than one task concurrently
  • Protect a temporary storage queue from being read and updated concurrently.

To be effective, however, all transactions must adhere to the same convention. A transaction that accesses the CWA without using the agreed ENQ and DEQ commands is not suspended, and protection is violated.

After a task has issued an ENQ RESOURCE(data-area) command, any other task that issues an ENQ RESOURCE command with the same data-area parameter is suspended until the task issues a matching DEQ RESOURCE(data-area) command, or until the unit of work ends.

Note: Enqueueing on more than one resource concurrently might create a deadlock between transactions.