Display the lock states for objects

You can use the Work with Object Locks (WRKOBJLCK) command or the Work with Job (WRKJOB) command to display the lock states for objects.

The Work with Object Locks (WRKOBJLCK) command displays all the lock state requests in the system for a specified object. It displays both the held locks and the locks being waited for. For a database file, the Work with Object Locks (WRKOBJLCK) command displays the locks at the file level (the object level) but not at the record level. For example, if a database file is open for update, the lock on the file is displayed, but the lock on any records within the file is not. Locks on database file members can also be displayed using the Work with Object Locks (WRKOBJLCK) command.

If you use the Work with Job (WRKJOB) command, you can select the locks option on the Display Job menu. This option displays all the lock state requests outstanding for the specified active job, the locks being held by the job, and the locks for which the job is waiting. However, if a job is waiting for a database record lock, this does not appear on the object locks display.

The following command displays all the lock state requests in the system for the logical file ORDFILL:

WRKOBJLCK  OBJ(QGPL/ORDFILL)  OBJTYPE(*FILE)

The resulting display is:

                            Work with Object Locks
                                                             
System:   SYSTEM01
 Object:   ORDFILL        Library:   QGPL           Type:   *FILE-LGL
 
 Type options, press Enter.
   4=End job   5=Work with job   8=Work with job locks
 
 Opt     Job            User           Lock        Status     Scope      Thread
  _      WORKST04       QSECOFR        *SHRRD       HELD      *JOB
                                       *SHRRD       HELD      *JOB
                                       *SHRRD       HELD      *JOB
                                       *SHRRD       HELD      *JOB
                                       *SHRRD       HELD      *JOB
                                       *SHRRD       HELD      *JOB
                                       *SHRRD       HELD      *JOB
                                       *SHRRD       HELD      *JOB
                                       *SHRRD       HELD      *JOB
                                       *SHRRD       HELD      *JOB
                                       *SHRRD       HELD      *JOB
                                       *SHRRD       HELD      *JOB
                                       *SHRRD       HELD      *JOB
                                                               
         More...
 F3=Exit   F5=Refresh   F6=Work with member locks   F12=Cancel
 
Related information
Work with Object Locks (WRKOBJLCK) command
Work with Job (WRKJOB) command