V5R2 brought a large number of new APIs to OS/400. Among these are the Retrieve Lock Information (QWCRLCKI) API and the Retrieve Lock Request Information (QWCRLRQI) API. In this installment of APIs by Example, I show you how you can put these challenging APIs to work.
The QWCRLCKI API requires thorough research to code. This is partially because it is capable of returning many different types of lock information. Depending on the input parameters, it can return any of the following:
- Object and file level locks
- File member locks
- File record locks
Using the API’s filter parameter, you can limit the returned list of lock information to the following lock types:
- Lock space locks
- Job or thread locks
A lock space is an internal object used by other objects to hold object or record locks. For example, if you look at the V5R2 or later version of the ALCOBJ (Allocate Object) command, you notice that it has a SCOPE parameter that defaults to *LCKSPC. Several of the APIs introduced with V5R2 deal with this entity. I have included a list of lock space APIs at the end of this article, in case you’d like to investigate further.
APIs by Example: Lock Information APIs, PTF Available
reported in a previous installment of APIs by Example that the Retrieve Lock Information (QWCRLCKI) API would enter a looping state under certain conditions. IBM has now released PTF SI20375 for V5R3 to correct this problem.
Thank you, IBM, for the speedy response to the problem that I reported!