Work with Object Locks (WRKOBJLCK)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

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.

Restrictions:

  1. 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.

  2. This command does not show record locks for database files.

  3. 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.

Top


 

Parameters

Keyword Description Choices Notes
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, *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
OUTPUT Output *, *PRINT Optional

Top

 

Object (OBJ)

Specifies the name and library of the object for which locks are being displayed.

This is a required parameter.

Qualifier1: Object

name

Specify the name of the object.

Qualifier2: Library

*LIBL

All libraries in the thread's library list are searched until a match is found.

*CURLIB

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.

name

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.

Top

 

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.

Object-type

Specify the object type. Refer to the Object type (OBJTYPE) parameter of the Work with Objects (WRKOBJ) command for more information.

Top

 

Member (MBR)

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.

*NONE

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.)

*FIRST

The first member in the named database file is displayed.

*ALL

Member locks for all the members in the database file are displayed.

name

Specify the name of the database file member for which locks are displayed.

Top

 

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.

*SYSBAS

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.

name

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.

Top

 

Output (OUTPUT)

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.

*PRINT

The output is printed with the job's spooled output.

Top


 

Examples

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.

Top


 

Error messages

*ESCAPE Messages

CPFB8ED

Device description &1 not correct for operation.

CPF0919

Library in library list damaged.

CPF0924

Cannot use library in library list.

CPF0935

Cannot use member name for object type *&2.

CPF0939

Object &3 type &2 was not found in library &4.

CPF0948

Member &1 file &3 in library &4 not found.

CPF095B

Value for ASPDEV not valid with special value for library.

CPF0950

&2 &3 in library &4 not found.

CPF0951

QSYS only valid library for object type &2.

CPF0952

Library &4 not found for &2 &3.

CPF0953

Library in library list previously deleted.

CPF0958

&2 &3 in library &4 saved with storage freed.

CPF0988

Library &4 damaged.

CPF1093

Override of file device type not valid.

CPF3285

Damage found on file &1 in library &3.

CPF9803

Cannot allocate object &2 in library &3.

CPF9804

Object &2 in library &3 damaged.

CPF9814

Device &1 not found.

CPF9820

Not authorized to use library &1.

CPF9825

Not authorized to device &1.

CPF9845

Error occurred while opening file &1.

CPF9846

Error while processing file &1 in library &2.

CPF9847

Error occurred while closing file &1 in library &2.

CPF9850

Override of printer file &1 not allowed.

CPF9851

Overflow value for file &1 in &2 too small.

CPF9871

Error occurred while processing.

Top