Posted: Fri Oct 03, 2003 12:57 pm Post subject: Preventing Deadlocks
Greetings,
I've set up a cataloged 'do nothing' file with a DISP=OLD in several jobs which use the same VSAM dataset.
I understand this to prevent deadlocks at the step level, but is there any way to accomplish this at the job level?
Case in point - I've got a backup job that repros several VSAM datasets down to tape, and instead of installing my 'do nothing' file in each step (which I'll do if need be), I'd prefer to prevent any other jobs from accessing these datasets for the entire duration of my backup job.
Short of scheduling a 'cannot run with' condition in CA-7, is there anything I can do locally in the JCL to accomplish this?
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Fri Oct 03, 2003 3:17 pm Post subject:
Steve,
If you code DISP=OLD the job gets exclusive hold for the entire duration of the Job. Before starting the first step of a job, the initiator requests control of all of the data sets in that job by issuing an ENQ for each of them, using the value specified for DISP to determine the kind of ENQ issued. The initiator issues the ENQ for each data set at the highest level required for that data set by any step of the job. For example, if all steps of the job request shared control of a specific data set (DISP=SHR) then the ENQ for that data set is requested as SHR. If, on the other hand, any step of the job requests exclusive control of a specific data set (DISP=NEW, DISP=MOD, or DISP=OLD), then the ENQ for that data set is requested EXCL.
The ENQ for each dataset is released at the end of the last step of the job referencing it. Since ENQs cannot be downgraded from EXCL to SHR, if one step needs the ENQ EXCL and a following step only needs it SHR, the ENQ is still issued as EXCL and held until the end of the last step which references that data set, at which point the ENQ is released entirely.
So code DISP=OLD on your vsam datasets itself and all other jobs will wait for this backup job to finish
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum