The DSENQSHR parameter allows a job to share dataset enqueues with other jobs even when they request exclusive control. This parameter helps manage dataset contention in environments where multiple jobs need to access the same datasets, by controlling whether a job's dataset allocation requests should bypass exclusive control requested by other jobs.
Warning:
Using DSENQSHR can potentially lead to data integrity issues if not carefully managed. It should only be used in specific, controlled scenarios when you fully understand the implications of bypassing dataset enqueue protection.
1//jobname JOB parameters,DSENQSHR=option
Value | Description |
---|---|
DISALLOW | The job cannot share dataset enqueues with other jobs that have requested exclusive control. This is the default behavior if DSENQSHR is not specified. |
AUTO | The system determines whether the job can share dataset enqueues with other jobs. This option generally allows the job to share datasets when it's appropriate to do so. |
ALLOW | The job can share dataset enqueues with other jobs, even when exclusive control is requested. This option should be used with caution as it may cause data integrity issues. |
123//PAYJOB JOB (ACCT#),'JOHN DOE',CLASS=A //STEP1 EXEC PGM=PAYROLL //PAYFILE DD DSN=SYS1.PAYROLL.DATA,DISP=SHR
Without DSENQSHR, this job will not be able to allocate SYS1.PAYROLL.DATA if another job has allocated it with exclusive control (DISP=OLD).
1234//REPTJOB JOB (ACCT#),'JANE SMITH',CLASS=A, // DSENQSHR=AUTO //STEP1 EXEC PGM=PAYREPORT //PAYFILE DD DSN=SYS1.PAYROLL.DATA,DISP=SHR
This job allows the system to determine whether to allow dataset enqueue sharing. The system will typically allow sharing for read-only access but protect against concurrent updates.
1234//EMERJOB JOB (ACCT#),'ADMIN',CLASS=A, // DSENQSHR=ALLOW //STEP1 EXEC PGM=EMERGENCY //SYSFILE DD DSN=SYS1.CRITICAL.DATA,DISP=SHR
This job will be allowed to share dataset enqueues with other jobs that have allocated SYS1.CRITICAL.DATA with exclusive control. This should be used only in emergency situations when data access is critical.
When a job allocates a dataset, z/OS establishes enqueues to control access:
DISP Parameter | Enqueue Type | Sharing Behavior |
---|---|---|
DISP=SHR | Shared (SYSDSN SHARE) | Multiple jobs can read the dataset concurrently |
DISP=OLD | Exclusive (SYSDSN EXCL) | Only one job can access the dataset |
DISP=MOD | Exclusive (SYSDSN EXCL) | Only one job can access the dataset |
DISP=NEW | Exclusive (SYSDSN EXCL) | Only one job can access the dataset |
The DSENQSHR parameter modifies the standard enqueue resolution:
DSENQSHR=DISALLOW
(default), standard enqueue rules applyDSENQSHR=AUTO
, the system may allow shared access to datasets allocated with DISP=OLD in certain scenariosDSENQSHR=ALLOW
, the job can obtain shared access to datasets even when they're allocated with DISP=OLD by other jobsThe DSENQSHR parameter requires:
Access to DSENQSHR should be controlled:
123RDEFINE FACILITY STGADMIN.IGG.DSENQSHR.ALLOW UACC(NONE) PERMIT STGADMIN.IGG.DSENQSHR.ALLOW CLASS(FACILITY) ID(userid-or-group) ACCESS(READ) SETROPTS RACLIST(FACILITY) REFRESH
Users must have READ access to the STGADMIN.IGG.DSENQSHR.ALLOW profile in the FACILITY class to use DSENQSHR=ALLOW.
Global Resource Serialization (GRS) settings may affect how DSENQSHR works:
Issue | Possible Causes & Solutions |
---|---|
DSENQSHR not taking effect |
|
Data corruption |
|
Unexpected allocation failures |
|
Commands to help troubleshoot DSENQSHR issues:
123456D GRS,RES=(SYSDSN,*) /* Display dataset enqueues */ D GRS,ANALYZE,BLOCKER /* Find blocking enqueues */ D GRS,CONTENTION /* Display enqueue contention */ /* Check RACF authorization */ RLIST FACILITY STGADMIN.IGG.DSENQSHR.ALLOW AUTHUSER
The DSENQSHR parameter behavior is consistent in both JES2 and JES3 environments: