ENQ
An enqueue: the way z/OS reserves a resource, such as a dataset, so two pieces of work do not change it at the same time.
Also written enqueue, GRS, global resource serialisation, dataset contention, waiting for datasets
An ENQ, short for enqueue, is a reservation. Before a job or user works with a resource, z/OS records that they are using it. A shared ENQ lets others use it too. An exclusive ENQ keeps everyone else out until it is released.
The most common case is datasets. A job step with DISP=SHR asks for a shared ENQ on the dataset name. DISP=OLD, MOD or NEW asks for an exclusive one. Editing a dataset in ISPF also holds one. If a job needs exclusive use of a dataset that someone else is using, it waits, and the job log shows a message that it is waiting for datasets.
In a sysplex, a component called GRS, global resource serialisation, shares ENQs across all the systems, so a dataset reserved on one system is protected on all of them.
When something is "stuck waiting", ENQ contention is a good first guess. Operators can display it with D GRS,C, and the fix is usually to find who holds the resource and wait for them, or ask them to release it.
Where can I learn this hands-on?
Right here, at ZedBank. You take a junior job at a simulated bank and learn each part of the work by doing it, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- DispositionThe DISP parameter, which says whether a dataset already exists, and what to do with it when the step ends normally or fails.
- JobA unit of batch work submitted to the system, made up of one or more steps that run in order.
- SysplexA group of mainframe systems joined together so they behave as one, sharing work and data so that no single failure stops the service.
- DatasetWhat a mainframe calls a file: a named collection of records with a defined structure, rather than a loose stream of bytes.
- System consoleThe screen where z/OS shows its messages to operators and accepts system commands.
- SDSFThe tool for looking at what jobs are running, what has finished, and what output they produced.