Almost 11 years has passed since I wrote a tip about an ISPF utility named ISRDDN. This utility has been integrated into ISPF for many years and is officially started with the ISPF command DDLIST. Fortunately TSO ISRDDN still works and the other tips I wrote about ISRDDN still works. Some of the links does not work anymore so please use this instead.
One of the interesting things about ISRDDN is its ability to display enqueues which is done using the commands ENQ and CON. An enqueue is the same as a semaphore. The command ENQ displays as default all the enqueues on datasets allocated to your TSO session. The command CON displays all the enqueues on which on or more address spaces are waiting. Please note that DB2 does not use enqueues to process its locks, but uses its own implementation. The same is true for IMS (which DB2 has copied) and CICS. You can also use the command ALL to display all enqueues on the MVS you are logged on to, but this is a very long list. Use command RESET to return to the default display. The online help describes all this and more.
An enqueue is divided into a type (major name) and a name (minor name). An enqueue may be connected to one or more address spaces (address id). The most common type of enqueues is SYSDSN and there exists one SYSDSN enqueue for each allocated dataset. In the prefix fields you can type in the first letters of one or more of the enqueues you are looking for. You can also remove the contents of a field in order to display all enqueues for that prefix. Enqueues created by the MVS system and MVS related tasks all has a major name starting with SYS. The SYSDSN enqueues form the vast majority of MVS related enqueues so it is nice to know that most other MVS related enqueues starts with SYSZ. Other types of enqueues are created by different program products. For instance ISPF uses enqueues to control editing of members with a major name of SPFEDIT.
Unfortunately COBOL, REXX or PL/I does not have any functions to process enqueues. It can on ly be done by using ASSEMBLER. Most installations has made their own ASSEMBLER modules to display and control enqueues. Those modules can be used from the mentioned programming languages. Unfortunately it is often the case that these modules were made so long ago that no-one knows what their names are, how they work and where they are documented.