Previous Topic: DS3270()

Next Topic: ENQUEUE()

DSNENQ()

Use the DSNENQ() function to return information about a data set's enqueue status in a series of predefined variables.

To use the DSNENQ() function

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

Syntax

The DSNENQ() function has this syntax:

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

Arguments

The DSNENQ() function takes these arguments:

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 returned by a request using the INFO argument.

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 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 a very large number of data sets you may need to increase this value.

Default: 1

dsname

Data set name about which information is retrieved.

Variables Returned by the INFO Argument

The following table lists the variables returned by the INFO argument. 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, either OWN or WAIT.

dsn_mode.n

Mode for entry n, either 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

The DSNENQ() function produces these 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  */