Work with Object Locks (WRKOBJLCK)
|Where allowed to run: All environments (*ALL)
The Work with Object Locks (WRKOBJLCK) command allows you to work with the object lock requests in the system for a specified object. You can work with both held locks and locks waiting to be applied.
- The user must have *EXECUTE authority to the library containing the object and to the ASP device description. Otherwise, the user must have *JOBCTL special authority.
- This command does not show record locks for database files.
- Work station message queues cannot be allocated, and therefore, they will not have any locks. A work station message queue is associated with a work station device description of the same name. Therefore, to determine why an operation that requires the work station message queue to be allocated does not work, the user should see if there are any locks on the device description of the same name.
|OBJ||Object||Qualified object name||Required, Positional 1|
|Qualifier 1: Object||Name|
|Qualifier 2: Library||Name, *LIBL, *CURLIB|
|OBJTYPE||Object type||*ALRTBL, *AUTL, *BNDDIR, *CFGL, *CHTFMT, *CLD, *CLS, *CMD, *CNNL, *COSD, *CRG, *CRQD, *CSI, *CSPMAP, *CSPTBL, *CTLD, *DEVD, *DOC, *DTAARA, *DTADCT, *DTAQ, *EDTD, *EXITRG, *FCT, *FILE, *FLR, *FNTRSC, *FNTTBL, *FORMDF, *FTR, *GSS, *IGCDCT, *IGCSRT, *IGCTBL, *IMGCLG, *IPXD, *JOBD, *JOBQ, *JOBSCD, *JRN, *JRNRCV, *LIB, *LIND, *LOCALE, *MEDDFN, *MENU, *MGTCOL, *MODD, *MODULE, *MSGF, *MSGQ, *M36, *M36CFG, *NODL, *NTBD, *NWID, *NWSCFG, *NWSD, *OUTQ, *OVL, *PAGDFN, *PAGSEG, *PDFMAP, *PDG, *PGM, *PNLGRP, *PRDAVL, *PRDDFN, *PRDLOD, *PSFCFG, *QMFORM, *QMQRY, *QRYDFN, *SBSD, *SCHIDX, *SPADCT, *SQLPKG, *SQLUDT, *SQLXSR, *SRVPGM, *SSND, *S36, *TBL, *TIMZON, *USRIDX, *USRPRF, *USRQ, *USRSPC, *VLDL, *WSCST||Required, Positional 2|
|MBR||Member||Name, *NONE, *FIRST, *ALL||Optional, Positional 3|
|ASPDEV||ASP device||Name, *, *SYSBAS||Optional|
Specifies the name and library of the object for which locks are being displayed.
This is a required parameter.
- Specify the name of the object.
- All libraries in the thread's library list are searched until a match is found.
- The current library for the thread is used to locate the object. If no library is specified as the current library for the thread, the QGPL library is used.
- Specify the name of the library where the object is located.
If a file member is specified for a file, and the file's library value is *LIBL, the first occurrence of the file in the thread's library search list is searched for the member. For object types that exist only in library QSYS (for example, *DEVD), QSYS and *LIBL are the only library names that are accepted. When specifying a value other than * for the ASP device (ASPDEV), *LIBL can not be specified.
Object type (OBJTYPE)
Specifies the object type of the object for which locks are being displayed. Specify the predefined value that identifies the object type.
This is a required parameter.
- Specify the object type. Refer to the Object type (OBJTYPE) parameter of the Work with Objects (WRKOBJ) command for more information.
Specifies the member name of a database file. This parameter is valid only when a database file has been specified for the Object (OBJ) parameter.
- No member locks are displayed, but file level locks are displayed. (The display of member locks for all the members in the file can be requested from the file locks display.)
- The first member in the named database file is displayed.
- Member locks for all the members in the database file are displayed.
- Specify the name of the database file member for which locks are displayed.
ASP device (ASPDEV)
Specifies the auxiliary storage pool (ASP) device name where the library that contains the object (specified for the Object (OBJ) parameter) is located. If the object's library resides in an ASP that is not part of the library name space associated with the thread, this parameter must be specified to ensure the correct object is used as the target of the operation.
- The ASPs that are currently part of the thread's library name space will be searched to locate the object. This includes the system ASP (ASP number 1), all configured basic user ASPs (ASP numbers 2-32), and, if the thread has an ASP group, all independent ASPs in the ASP group.
- The system ASP and all basic user ASPs will be searched to locate the object. No independent ASPs will be searched, even if the thread has an ASP group.
- The device name of the independent ASP to be searched to locate the object. The independent ASP must have been activated (by varying on the ASP device) and have a status of 'Active' or 'Available'. The system ASP and basic user ASPs will not be searched.
Specifies whether the output from the command is displayed at the requesting work station or printed with the job's spooled output.
- The output is displayed for interactive jobs or printed with the job's spooled output for non-interactive jobs.
- The output is printed with the job's spooled output.
Example 1: Printing Object Lock Information for a File
WRKOBJLCK OBJ(*LIBL/LOCKEDFILE) OBJTYPE(*FILE) MBR(LOCKEDMBR) OUTPUT(*PRINT)
This command prints the lock information for the member named LOCKEDMBR in the file named LOCKEDFILE. The file is located using the library list.
Example 2: Working With Object Locks for a Library on an Independent ASP
WRKOBJLCK OBJ(QSYS/LIBNAME) OBJTYPE(*LIB) ASPDEV(PRODXX)
This command allows you to work with the lock information for the library LIBNAME located on the independent auxiliary storage pool (ASP) device PRODXX.
- Device description &1 not correct for operation.
- Library in library list damaged.
- Cannot use library in library list.
- Cannot use member name for object type *&2.
- Object &3 type &2 was not found in library &4.
- Member &1 file &3 in library &4 not found.
- Value for ASPDEV not valid with special value for library.
- &2 &3 in library &4 not found.
- QSYS only valid library for object type &2.
- Library &4 not found for &2 &3.
- Library in library list previously deleted.
- &2 &3 in library &4 saved with storage freed.
- Library &4 damaged.
- Override of file device type not valid.
- Damage found on file &1 in library &3.
- Cannot allocate object &2 in library &3.
- Object &2 in library &3 damaged.
- Device &1 not found.
- Not authorized to use library &1.
- Not authorized to device &1.
- Error occurred while opening file &1.
- Error while processing file &1 in library &2.
- Error occurred while closing file &1 in library &2.
- Override of printer file &1 not allowed.
- Overflow value for file &1 in &2 too small.
- Error occurred while processing.