Start of change

IFS_OBJECT_LOCK_INFO table function

The IFS_OBJECT_LOCK_INFO table function returns a result table that contains a row for each job that is known to be holding a reference, or lock, on the object.

This information is similar to what is returned by the Retrieve Object References (QP0LROR) API.

The list of object usages may be incomplete for objects residing in file systems other than the root (/), QOpenSys, and user-defined file systems. Objects in some of the other file systems can be locked with interfaces that do not use the integrated file system. Therefore, rows are only returned for references that were obtained as part of an integrated file system operation, or an operation that cause the integrated file system operation to occur.

Authorization: The user must have:
  • Execute (*X) data authority to each directory preceding the object whose references are to be obtained and
  • Read (*R) data authority to the object whose references are to be obtained.
Read syntax diagramSkip visual syntax diagram IFS_OBJECT_LOCK_INFO ( PATH_NAME => path-name,IGNORE_ERRORS => ignore-errors)
path-name
An expression that defines the path name to the object whose reference information is to be returned. If the last element of the path is a symbolic link, the reference information will be for the symbolic link itself. If an absolute path name is not specified, the current working directory is used in combination with the relative path name to resolve to the object.
ignore-errors

A character or graphic string expression that identifies what to do when an error is encountered.

NO

An error is returned.

YES
A warning is returned.
No row is returned when an error is encountered. This is the default.

The result of the function is a table containing multiple rows with the format shown in the following table. All the columns are nullable.

Table 1. IFS_OBJECT_LOCK_INFO table function
Column Name Data Type Description
PATH_NAME DBCLOB(16M) CCSID 1200 The full path name of the object.
JOB_NAME VARCHAR(28) The qualified job name holding the reference.
RO_COUNT INTEGER Total number of read only access references for this job.
WO_COUNT INTEGER Total number of write only access references for this job.
RW_COUNT INTEGER Total number of read and write access references for this job.
XO_COUNT INTEGER Total number of execute only access references for this job.
SHARE_R_COUNT INTEGER Total number of references for this job where the sharing mode allows sharing with read and execute access intents only.
SHARE_W_COUNT INTEGER Total number of references for this job where the sharing mode allows sharing with write access intents only.
SHARE_RW_COUNT INTEGER Total number of references for this job where the sharing mode allows sharing with read, execute, and write access intents.
SHARE_NONE_COUNT INTEGER Total number of references for this job where the sharing mode allows sharing with no other access intents.
ATTRIBUTE_LOCK VARCHAR(3) Indicates whether attribute changes are prevented for this job.
NO
Attribute changes are not prevented.
YES
Attribute changes are prevented.
SAVE_LOCK VARCHAR(3) Indicates whether the object is being referenced by an object save operation by this job.
NO
Object is not being referenced by an object save operation.
YES
Object is being referenced by an object save operation.
INTERNAL_SAVE_LOCK VARCHAR(3) Indicates whether the object is being referenced internally during a save operation on a different object by this job.
NO
The object is not being referenced internally during a save operation on a different object.
YES
The object is being referenced internally during a save operation on a different object.
LINK_CHANGES_LOCK VARCHAR(3) Indicates whether changes to links in the directory are prevented for this job.
NO
Changes to links in the directory are not prevented.
YES
Changes to links in the directory are prevented.
CHECKED_OUT VARCHAR(3) Indicates whether the object is currently checked out by this job.
NO
The object is not checked out.
YES
The object is checked out.
CHECKED_OUT_USER_NAME VARCHAR(10) The name of the user who has the object checked out.

Contains the null value if CHECKED_OUT is NO.

RO_SHARE_R_COUNT INTEGER Number of read only accesses for the job where the sharing mode allows sharing with read and execute access intents only.
RO_SHARE_W_COUNT INTEGER Number of read only accesses for the job where the sharing mode allows sharing with write access intents only.
RO_SHARE_RW_COUNT INTEGER Number of read only accesses for the job where the sharing mode allows sharing with read, execute, and write access intents.
RO_SHARE_NONE_COUNT INTEGER Number of read only accesses for the job where the sharing mode allows sharing with no other access intents.
WO_SHARE_R_COUNT INTEGER Number of write only accesses for the job where the sharing mode allows sharing with read and execute access intents only.
WO_SHARE_W_COUNT INTEGER Number of write only accesses for the job where the sharing mode allows sharing with write access intents only.
WO_SHARE_RW_COUNT INTEGER Number of write only accesses for the job where the sharing mode allows sharing with read, execute, and write access intents.
WO_SHARE_NONE_COUNT INTEGER Number of write only accesses for the job where the sharing mode allows sharing with no other access intents.
RW_SHARE_R_COUNT INTEGER Number of read and write accesses for the job where the sharing mode allows sharing with read and execute access intents only.
RW_SHARE_W_COUNT INTEGER Number of read and write accesses for the job where the sharing mode allows sharing with write access intents only.
RW_SHARE_RW_COUNT INTEGER Number of read and write accesses for the job where the sharing mode allows sharing with read, execute, and write access intents.
RW_SHARE_NONE_COUNT INTEGER Number of read and write accesses for the job where the sharing mode allows sharing with no other access intents.
XO_SHARE_R_COUNT INTEGER Number of execute only accesses for the job where the sharing mode allows sharing with read and execute access intents only.
XO_SHARE_W_COUNT INTEGER Number of execute only accesses for the job where the sharing mode allows sharing with write access intents only.
XO_SHARE_RW_COUNT INTEGER Number of execute only accesses for the job where the sharing mode allows sharing with read, execute, and write access intents.
XO_SHARE_NONE_COUNT INTEGER Number of execute only accesses for the job where the sharing mode allows sharing with no other access intents.
XR_SHARE_R_COUNT INTEGER Number of execute and read accesses for the job where the sharing mode allows sharing with read and execute access intents only.
XR_SHARE_W_COUNT INTEGER Number of execute and read accesses for the job where the sharing mode allows sharing with write access intents only.
XR_SHARE_RW_COUNT INTEGER Number of execute and read accesses for the job where the sharing mode allows sharing with read, execute, and write access intents.
XR_SHARE_NONE_COUNT INTEGER Number of execute and read accesses for the job where the sharing mode allows sharing with no other access intents.
CURRENT_DIRECTORY VARCHAR(3) Indicates whether the object is a directory that is being used as the current directory of the job.
NO
The object is not a directory that is being used as the current directory of the job.
YES
The object is a directory that is being used as the current directory of the job.
ROOT_DIRECTORY VARCHAR(3) Indicates whether the object is a directory that is being used as the root directory of the job.
NO
The object is not a directory that is being used as the root directory of the job.
YES
The object is a directory that is being used as the root directory of the job.
FILE_SERVER_REFERENCE VARCHAR(3) Indicates whether the File Server is holding a generic reference on the object on behalf of a client for this job.
NO
The File Server is not holding a generic reference on the object on behalf of a client.
YES
The File Server is holding a generic reference on the object on behalf of a client.
FILE_SERVER_WORKING_DIRECTORY VARCHAR(3) Indicates whether the object is a directory, and the File Server is holding a working directory reference on it on behalf of a client for this job.
NO
The object is not a directory or the File Server is not holding a working directory reference on it on behalf of a client.
YES
The object is a directory, and the File Server is holding a working directory reference on it on behalf of a client.
NFS_SERVER_REFERENCE VARCHAR(3) Indicates whether the Network File System (NFS) Version 4 server job is holding a generic reference on the object on behalf of a client for this job.
NO
The NFS server job is not holding a generic reference on the object on behalf of a client.
YES
The NFS server job is holding a generic reference on the object on behalf of a client.
NETSERVER_SESSION CLOB(1M) This column contains a list of NetServer sessions, with each entry formatted as follows:
  1. 20 characters containing the session ID number
  2. 10 character user name
  3. 15 character workstation name
  4. 45 character workstation address
  5. 1 semicolon (;)

Contains the null value if there are no NetServer sessions.

Example

  • List all the jobs that have a lock on /usr/test1
    SELECT * FROM TABLE(QSYS2.IFS_OBJECT_LOCK_INFO(PATH_NAME => '/usr/test1'))
End of change