Previous Topic: DS3270()Next Topic: ENQUEUE()


DSNENQ()

This function returns information about the enqueue status of a data set in a series of predefined variables.

Follow these steps:

  1. Obtain a handle. This handle is required for all subsequent operations.
  2. Retrieve the enqueue information.
  3. Release the handle, thereby freeing storage.

Syntax

{handle|info} = DSNENQ({OBTAIN},{[pages]},dsname)
                       {INFO}   {handle}
                       {RELEASE}{handle}

Parameters

info

Contains the retrieved enqueue information.

handle

Numeric ID for an internal workspace. The handle must be passed with each subsequent call. The same handle can be reused for different data sets.

INFO

Returns data set information. The table in the following section lists the variables and values that a request using the INFO argument returns.

OBTAIN

Obtains a new value for the handle argument, which is the address of the control block defining the data set.

RELEASE

Returns a handle value to the system to free the storage that is used. This is done automatically when the IMOD completes.

pages

Number of 4096-byte work areas to be made available to the z/OS GQSCAN service. The work area is discarded after the function is executed. Specify a value from 1 to 5 (inclusive).

If your system regularly provides enqueues for many data sets, you might need to increase this value.

Default: 1

dsname

Data set name about which information is retrieved.

Variables Returned by the INFO Argument

This list details the variables that the INFO argument returns. For stem variables, the stem index n begins with 1 and increases without breaks to dsn_count.

dsn_dsname

Name of the data set on which enqueue information is being retrieved.

dsn_count

Number of entries returned. This value is the maximum value of n.

dsn_asid.n

ASID for entry n.

dsn_sysid.n

GRS (Global Resource Serialization) system name for entry n.

dsn_status.n

Status for entry n (OWN or WAIT).

dsn_mode.n

Mode for entry n (SHR (shared) or EXCL (exclusive)).

dsn_jobtype.n

For entry n, JOB, TSU, STC, or EXTERNAL (unknown type or owned by another CPU).

Return Codes

101 - 103

ARG n MISSING OR INVALID

121

NO OWNERS OF DATASET

124

Return code from GQSCAN service

123

INVALID HANDLE

Example

handle = dsnenq('OBTAIN')                  /* Get a new handle */
dsnenq('INFO',handle,'SYS1.HASPACE') == '' /* 121 if no owner  */
dsn_count == 1                             /* One owner found  */