Retrieve Object Locks (RTVOBJLCK) UDTF

Index

Schema IQUERY

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.

Parameters

LIBRARY_NAME

The library name of the object. If unspecified, *LIBL is used.

OBJECT_NAME

The name of the object whose locks are to be returned. This is a required parameter.

OBJECT_TYPE

The object type of the object. If unspecified *FILE is used. The object type may be specified with or without the leading asterisk.

MEMBER

The member name or *FIRST or *FILE whose locks should be returned. If unspecified only the Object locks are returned, member locks are not.

Examples

select objname,objlib, objtype, job, user, lockstate 
FROM TABLE( iQuery.RTVOBJLCK( 'PRODDATA','ORDERS','*FILE')) locks;

Column Data Type Description
OBJNAME
VARCHAR(10)
The name of the object
OBJLIB
VARCHAR(10) The library name of the object
OBJTYPE
VARCHAR(10) The object type of the object
OBJATTR
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.
JOB
VARCHAR(28)
The fully qualified 3-part job name of the job that holds the object lock.
USER
VARCHAR(10) The user profile that holds the lock.
LOCKSTATE
VARCHAR(10)
The lock state: *NONE, *SHRRD, *SHRUPD, *SHRNUP, *EXCLRD, *EXCL
LOCKSTATUS
VARCHAR(10)
The lock status: HELD, WAIT, REQ
LOCKTYPE
VARCHAR(10) The lock type: OBJECT, MEMBER, ACCPTH, DATA
LOCKSCOPE
VARCHAR(10) The scope of the lock: *JOB, *THREAD, *LOCKSPACE
SHARED
VARCHAR(10) Indicates if the lock is shared. *SHARED or blank if not shared.
THREADID
VARCHAR(8) If the lock scope is *THREAD, this column contains the 8-byte thread ID.