RTVOBJLCK( library_name => '*LIBL', object_name => 'object-name', object_type => '*FILE' )
The Retrieve Object Locks (RTVOBJLCK) User Defined Table Function returns one row for each type of lock placed on the object. More than one row per job can be returned if the job has a lock on the object and if the object is a file, on one or more
members in that file. This is similar to what the WRKOBJLCK CL command returns.
select objname,objlib, objtype, job, user, lockstate
FROM TABLE( iQuery.RTVOBJLCK( 'PRODDATA','ORDERS','*FILE')) locks;
||The name of the object
||VARCHAR(10)||The library name of the object
||VARCHAR(10)||The object type of the object
||VARCHAR(10)||The extended object attributes, such as PF, RPGLE, DSPF, etc. for the object.
|MBRNAME||VARCHAR(10)||The locked member name or blank if member locks are not be returned.
||The fully qualified 3-part job name of the job that holds the object lock.
||VARCHAR(10)||The user profile that holds the lock.
||The lock state: *NONE, *SHRRD, *SHRUPD, *SHRNUP, *EXCLRD, *EXCL
||The lock status: HELD, WAIT, REQ
||VARCHAR(10)||The lock type: OBJECT, MEMBER, ACCPTH, DATA
||VARCHAR(10)||The scope of the lock: *JOB, *THREAD, *LOCKSPACE
||VARCHAR(10)||Indicates if the lock is shared. *SHARED or blank if not shared.
||VARCHAR(8)||If the lock scope is *THREAD, this column contains the 8-byte thread ID.