DSENQSHR Parameter

Purpose

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.

Syntax

JOB Statement Format

jcl
1
//jobname JOB parameters,DSENQSHR=option

Parameter Values

ValueDescription
DISALLOWThe job cannot share dataset enqueues with other jobs that have requested exclusive control. This is the default behavior if DSENQSHR is not specified.
AUTOThe 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.
ALLOWThe 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.

Usage Examples

Default Behavior

jcl
1
2
3
//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).

Using AUTO Option

jcl
1
2
3
4
//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.

Using ALLOW Option

jcl
1
2
3
4
//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.

Enqueue Sharing Concepts

Dataset Allocation and Enqueues

When a job allocates a dataset, z/OS establishes enqueues to control access:

DISP ParameterEnqueue TypeSharing Behavior
DISP=SHRShared (SYSDSN SHARE)Multiple jobs can read the dataset concurrently
DISP=OLDExclusive (SYSDSN EXCL)Only one job can access the dataset
DISP=MODExclusive (SYSDSN EXCL)Only one job can access the dataset
DISP=NEWExclusive (SYSDSN EXCL)Only one job can access the dataset

DSENQSHR Effect on Enqueue Resolution

The DSENQSHR parameter modifies the standard enqueue resolution:

  • With DSENQSHR=DISALLOW (default), standard enqueue rules apply
  • With DSENQSHR=AUTO, the system may allow shared access to datasets allocated with DISP=OLD in certain scenarios
  • With DSENQSHR=ALLOW, the job can obtain shared access to datasets even when they're allocated with DISP=OLD by other jobs

Common Use Cases

Read-Only Access to Production Datasets

  • Allowing reporting jobs to read production datasets that may be allocated exclusively
  • Enabling emergency auditing of data during critical business processes
  • Supporting parallel testing with production-like data access patterns

Emergency Operations

  • Accessing critical datasets during recovery operations
  • Diagnosing issues with long-running batch processes
  • Monitoring data during time-sensitive operations

Migration Scenarios

  • Reading datasets during data migration when source systems still require exclusive access
  • Facilitating parallel operations during system cutover periods
  • Supporting phased implementation approaches

Implementation Details

System Requirements

The DSENQSHR parameter requires:

  • z/OS 1.8 or higher
  • Appropriate security authorizations (see below)
  • GRS or equivalent enqueue management facility

Security Considerations

Access to DSENQSHR should be controlled:

text
1
2
3
RDEFINE 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.

GRS Considerations

Global Resource Serialization (GRS) settings may affect how DSENQSHR works:

  • In a GRS Ring or Star configuration, DSENQSHR affects enqueues across all systems in the complex
  • DSENQSHR works with both hardware reserves and GRS-managed enqueues
  • RNL (Resource Name List) settings may affect the scope of DSENQSHR

Best Practices

  1. Use with caution - Only use DSENQSHR when absolutely necessary
  2. Prefer DSENQSHR=AUTO over ALLOW when possible
  3. Document usage in job scheduling documentation
  4. Restrict authority to use DSENQSHR=ALLOW
  5. Test thoroughly in non-production environments
  6. Monitor for data corruption when DSENQSHR is used
  7. Consider read-only alternatives like VSAM RLS or DB2 instead of DSENQSHR
  8. Include in change management processes to evaluate risks

Troubleshooting

Common Issues

IssuePossible Causes & Solutions
DSENQSHR not taking effect
  • User lacks required RACF authority
  • System at incompatible z/OS level
  • Check system logs for authorization failures
Data corruption
  • Multiple jobs updating the same dataset simultaneously
  • Use DSENQSHR only with read-only access
  • Run data verification utilities
Unexpected allocation failures
  • Dataset may be reserved by hardware reserve
  • Other system-level serialization may be in place
  • Check for system-specific enqueue exceptions

Diagnostic Commands

Commands to help troubleshoot DSENQSHR issues:

text
1
2
3
4
5
6
D 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

JES2 vs. JES3 Considerations

The DSENQSHR parameter behavior is consistent in both JES2 and JES3 environments:

  • The parameter functions identically in both environments
  • Both JES2 and JES3 pass the parameter to the system allocation component
  • Behavior depends on the z/OS allocation and GRS components, not on JES

Related Concepts