Enable/Disable Record Locks Option

PURPOSE:  The RECORD LOCKS option controls whether access requests to a Data Set (DS) are queued or not.  This command is valid in a CM, SF and as a direct command.  It is not valid in a PM.

SYNTAX

{ENABLE; DISABLE} RECORD LOCKS [{IF; UNLESS} clause]

ENABLE

sets up the Simple Queued environment for DS access.  When more than one user tries to access a DS, their requests are queued in the order they are received.  It allows for multi-user input and single user updating.  The queuing is done only on the record level (unlike the Concurrent Queued environment which queues at both the record and table levels).

DISABLE

returns DS accessing to the default environment.  This is the default state.

{IF; UNLESS} clause

specifies a condition for the option to be enabled or disabled.

EXAMPLE

*ENABLE RECORD LOCKS
.
.
.
*DISABLE RECORD LOCKS

NOTES:  The following table illustrates Data Set (DS) accessing with RECORD LOCKS enabled for all users (assuming no other queued environments are established by any of the users).

JOB ACCESS FOR: DATA SET IS: JOB IS:
1 Update open running
2 Input open running
3 Input open running
4 Update open queued
5 Input open queued
6 Supersede busy waiting
7 Input open queued

Simple Queued Environment

All the jobs requested access to the same DS.  The request order is reflected by the job numbers.  While Job 1 has the Data Set opened for update, only Jobs 2 and 3 can concurrently access it for input (reading data).

Job 4 has successfully opened the Data Set and is queued.  It will only be allowed access when Job 1 releases the DS, since job one has exclusive use for updating.

Jobs 5 and 7 could run concurrent with Job 1 but cannot "jump" past Job 4.  They are queued and will start when Job 4 starts.

Job 6 is attempting to supersede the DS.  ACCENT R does not queue this request.  (Job 7 appears right behind Job 5 in the queue.)  Job 6 must wait and try again periodically until all jobs (including new ones that may come in before the current jobs in the queue finishes) release the DS.  Once Job 6 has access, no other job can open the DS until the supersede is finished.