Retrieve Lock Space Record Locks (QTRXRLRL) API


  Required Parameter Group:


  Default Public Authority: *USE

  Threadsafe: Yes

The Retrieve Lock Space Record Locks (QTRXRLRL) API lets you generate a list of record locks held by the specified lock space. Record locks that are being waited for on behalf of a lock space are not returned. Use the Retrieve Job Record Locks (QDBRJBRL) or Retrieve Lock Information (QWCRLCKI) API to retrieve record locks that are being waited for by a thread on behalf of a lock space.

Lock information is returned for local physical files only. The Retrieve Lock Space Record Locks API places the list in the specified receiver variable.


Authorities and Locks

Job authority
The caller of the API must be running under a user profile that has job control (*JOBCTL) special authority.

Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The variable that is to receive the list of record locks. The size of this variable is specified in the length of receiver variable parameter.

See Format of Receiver Information for details on the format of the receiver information.

Length of receiver variable
INPUT; BINARY(4)

The number of bytes that are provided in the Receiver variable parameter. At least 16 bytes must be provided. If the size of the receiver variable provided is less than the length of the list that is available, the list will be truncated; this can be determined by examining the first two fields in the receiver variable, the number of record locks returned, and the number of record locks available. If the receiver variable length specified is greater than the actual receiver variable, the results are unpredictable.

Format of receiver information
INPUT; CHAR(8)

The format of the information returned in the receiver variable. The format name is:


Lock space identifier
INPUT; CHAR(20)

The identifier of the lock space for which record locks are to be returned.

Lock filters
INPUT;CHAR(*)

Filters used for the lock information that is returned. See Format of Lock Filters for further information.

Format of lock filters
INPUT; CHAR(8)

The format of the lock filters used on the returned data. The possible format name is:


Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Format of Receiver Information

The format of the information returned in the receiver variable.


RLRL0100 Format

The following information is returned for the RLRL0100 format. For detailed descriptions of the fields in the table, see Field Descriptions for RLRL0100 Format.



Each record lock returned will have the following structure.



Field Descriptions for RLRL0100 Format

Bytes available. The number of bytes of data available to be returned. All available data is returned if enough space is provided.

Bytes returned. The number of bytes of data returned. Only complete entries are returned.

Database file library ASP name. The name of the auxiliary storage pool (ASP) that contains the library. The following special values also may be returned:

Database file library ASP number. The numeric identifier of the ASP containing the library. The following values may be returned:

Database file library name. The name of the library that contains the file.

Database file name. The name of the file.

Database member name. The name of the member.

Database file ASP name. The name of the auxiliary storage pool (ASP) that contains the file. The following special values also may be returned:

Database file ASP number. The numeric identifier of the ASP containing the file. The following values may be returned:

Lock state. The state of the lock. The possible values are:

Number of record locks available. The number of record lock structures that are available to be returned. If this field is the same as the number of record locks returned field, all the record lock information has been returned.

Number of record locks returned. The number of record lock structures that were returned to the caller of the API. If enough space is provided in the receiver variable, all record locks are returned. If there is more record lock information than can fit in the space provided, the number of record locks returned is less than the number of record locks available.

Offset to list of record locks. The byte offset from the beginning of the receiver variable to the first record lock information structure.

Relative record number. The relative record number for which record lock information is being returned.

Reserved. An unused field.

Size of information for each lock returned. The number of bytes of each of the returned lock information structures. In future releases, the amount of information returned for each lock may be expanded, so this value should be used to move from one lock structure to another.


Format of Lock Filters

The format of the lock filters used on the returned lock information.


RLRF0100 Format

The following information is to be specified for the RLRF0100 format. For detailed descriptions of the fields in the table, see Field Descriptions for RLFL100 Format.



Field Descriptions for RLRF0100 Format

Filter lock state. Filters information that is returned so that it contains only information about locks that have a certain lock state. The default is do not filter on lock state value.

Filter file library ASP name. The name of the library's auxiliary storage pool (ASP) on which to filter. A special value of *SYSBAS can be specified. A blank field will cause no filtering to be done on this field. The default is to not filter on this field.

Filter file library name. The library name on which to filter. A blank field will cause no filtering to be done on this field. The default is to not filter on this field.

Filter file member name. The member name on which to filter. A blank field will cause no filtering to be done on this field. The default is to not filter on this field.

Filter file name. The file name on which to filter. A blank field will cause no filtering to be done on this field. The default is to not filter on this field.

Filter size. The size of the filter information passed. Valid values are:



Error Messages



API introduced: V5R2

[ Back to top | Work Management APIs | APIs by category ]