RTVRCDLCK2 RETRIEVE RECORD LOCK 2 TAADBJL |
The Retrieve Record Lock 2 command retrieves counts of the record
locks held by a job. The system CHKRCDLCK command only checks for
locks within the current job. RTVRCDLCK2 can check in any job.
The API QDBRJBRL is used.
A typical command would be:
DCL &LCKHELD *DEC LEN(7 0)
.
RTVRCDLCK2 JOB(xxx) LCKHELD(&LCKHELD)
Considerations
--------------
There are exceptions where the API may be unable to return the proper
information.
A diagnostic message will be sent in this case. You can check for
this situation in your own code by comparing the sum of LCKHELD and
LCKWAIT with the TOTLCK return value.
The API has a limit (as of V4R5) of 32,767 locks. A program may lock
more than this, but the API will make it appear that only 32,767
exist.
RTVRCDLCK2 escape messages you can monitor for
----------------------------------------------
TAA9894 No jobs exist for the qualified job name.
TAA9895 Duplicate job names exist.
TAA9896 The job is not active
Escape messages from based on functions will be re-sent.
Command parameters *CMD
------------------
JOB The qualified name of the job to retrieve record
locks for. The default is * meaning the current
job. A specific job, user, and job number may be
entered.
TOTLCK The total number of locks held and waiting for the
job. This is an optional return variable that if
used must be specified as *DEC LEN(7 0).
LCKHELD The total number of locks held for the job. This is
an optional return variable that if used must be
specified as *DEC LEN(7 0).
LCKWAIT The total number of locks waiting to be accessed by
the job. This is an optional return variable that
if used must be specified as *DEC LEN(7 0).
Restrictions
------------
Because the command returns a value, it may only be used in a CL
program.
See the previous comments about exceptions in the Considerations
section.
Prerequisites
-------------
The following TAA Tools must be on your system:
EDTVAR Edit variable
RTVJOBSTS Retrieve job status
SNDDIAGMSG Send diagnostic message
SNDESCMSG Send escape message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
RTVRCDLCK2 *CMD TAADBJL QATTCMD
TAADBJLC *PGM CLP TAADBJLC QATTCL
TAADBJLR *PGM RPG TAADBJLR QATTRPG
|
Added to TAA Productivity tools February 1, 2001