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
The DSNENQ() function has this syntax:
{handle|info} = DSNENQ({OBTAIN},{[pages]},dsname)
{INFO} {handle}
{RELEASE}{handle}
The DSNENQ() function takes these arguments:
Contains the retrieved enqueue information.
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.
Returns data set information. The table in the following section lists the variables and values returned by a request using the INFO argument.
Obtains a new value for the handle argument, which is the address of the control block defining the data set.
Returns a handle value to the system to free the storage used. This is done automatically when the IMOD completes.
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
Data set name about which information is retrieved.
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.
Name of the data set on which enqueue information is being retrieved.
Number of entries returned. This value is the maximum value of n.
ASID for entry n.
GRS (Global Resource Serialization) system name for entry n.
Status for entry n, either OWN or WAIT.
Mode for entry n, either SHR (shared) or EXCL (exclusive).
For entry n, JOB, TSU, STC, or EXTERNAL (unknown type or owned by another CPU).
The DSNENQ() function produces these return codes:
ARG n MISSING OR INVALID
NO OWNERS OF DATASET
Return code from GQSCAN service
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 */
| Copyright © 2012 CA. All rights reserved. | Tell Technical Publications how we can improve this information |