Retrieve Job Record Locks (QDBRJBRL) API


  Required Parameter Group:


  Optional Parameter Group:


  Default Public Authority: *USE

  Threadsafe: Yes

The Retrieve Job Record Locks (QDBRJBRL) API lets you generate a list of record locks that a specific job or thread is holding or for which it is waiting. Lock information is returned for local physical files only. The Retrieve Job Record Locks API places the list in the specified receiver variable.


Authorities and Locks

Object Authority
None
Object Library Authority
None
File Lock
None
Job Authority
The API must be called from within the job for which the information is being retrieved, or the caller of the API must be running under a user profile that is the same as the job user identity of the job for which the information is being retrieved. Otherwise, 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 possible format names are:


Job or thread identification information
INPUT; CHAR(*)

The information that is used to identify the job or thread for which the job lock information is to be returned. See Format of Job or Thread Identification Information for details.

If the Format of record identification information parameter is omitted, format JIDI0100 is assumed. See JIDI0100 Format for details.

Error code
I/O; CHAR(*)

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


Optional Parameter Group

Format of job or thread identification information
INPUT; CHAR(8)

The format of the job or thread identification information. The possible format names are:


Lock filters
INPUT;CHAR(*)

Filters used for the lock information that is returned. See Format of Lock Filters for further information. If this parameter is omitted, the returned lock information is not filtered.

Format of lock filters
INPUT; CHAR(8)

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

If this parameter is omitted, the returned lock information is not filtered.


Format of Receiver Information

The format of the information returned in the receiver variable.


RJBL0100 Format

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



Each record lock returned will have the following structure.



JOBL0100 Format

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



Each record lock returned will have the following structure.



RJBL0100 and JOBL0100 Format Field Descriptions

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 may also be returned:

Database file ASP number. The numeric identifier of the ASP containing the file. The following values may be 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:

Lock scope. The scope of the lock. The scope may be job, thread scope, or lock space. The possible values are:

Lock space identifier. This field will contain a value only when the lock scope value is lock space scope and the lock is being waited on by a thread. This field will then contain the identifier of the lock space for which the lock is being waited on.

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

Lock status. The status 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.

Thread handle. This is a value which is used to address a particular thread holding a thread scope lock or the thread waiting for a lock. If the lock is a job scope lock, this is zero.

Thread identifier. The unique value that is used to identify the thread holding a thread scope lock or the thread waiting for a lock. If the lock is a job scope lock, this is zero.


Format of Job or Thread Identification Information

The format of the information needed to identify the job or thread whose locked object information is returned.


JIDI0100 Format

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



JIDI0100 Format Field Descriptions

Job name. A specific job name.

Job number. A specific job number.

User name. A specific user profile name.


JIDF0100 Format

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



JIDF0100 Format Field Descriptions

Internal job identifier. The internal identifier for the job. The List Job (QUSLJOB) API returns this identifier. If you do not specify *INT for the job name parameter, this parameter must contain blanks. With this parameter, the system can locate the job more quickly than with the job name.

Job name. A specific job name or one of the following special values:

Job number. A specific job number, or blanks when the job name specified is a special value.

Reserved. An unused field. This field must contain hexadecimal zeros.

Thread identifier. A value which is used to uniquely identify a thread within a job.

Thread indicator. The value that is used to specify the thread within the job for which information is to be retrieved. The following values are supported:

Note: For all supported values, the combination of the internal job identifier, job name, job number, and user name fields must identify the job containing the thread(s).

User name. A specific user profile name, or blanks when the job name specified is a special value.


JIDF0200 Format

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



JIDF0200 Format Field Descriptions

Internal job identifier. The internal identifier for the job. The List Job (QUSLJOB) API returns this identifier. If you do not specify *INT for the job name parameter, this parameter must contain blanks. With this parameter, the system can locate the job more quickly than with a job name.

Job name. A specific job name or one of the following special values:

Job number. A specific job number, or blanks when the job name specified is a special value.

Reserved. An unused field. This field must contain hexadecimal zeros.

Thread handle. A value which is used to address a particular thread within a job. A valid thread handle must be specified. The thread handle is returned on several other interfaces.

Thread identifier. A value which is used to uniquely identify a thread within a job.

User name. A specific user profile name, or blanks when the job name specified is a special value.


Format of Lock Filters

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


RJFL0100 Format

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


RJFL0100 Format Field Descriptions

Filter lock scope: This value is used to filter information that is returned so that it contains only information about locks that have a certain lock scope.

Default: Do not filter on lock scope value

Filter lock state: This value is used to filter information that is returned so that it contains only information about locks that have a certain lock state.

Default: Do not filter on lock scope value

Filter lock status: This value is used to filter information that is returned so that it contains only information about locks that have a certain lock status.

Default: Do not filter on lock scope value

Filter file library ASP name: The name of the library's Auxiliary Storage Pool (ASP) to be filtered on. Special value of *SYSBAS can be specified. A blank field will cause no filtering to be done on this field. The default is not to filter on this field.

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

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

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

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



Error Messages



API introduced: V5R1

[ Back to top | Database and File APIs | APIs by category ]