MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Preventing Deadlocks

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
Steverini
Beginner


Joined: 26 Sep 2003
Posts: 2
Topics: 1

PostPosted: Fri Oct 03, 2003 12:57 pm    Post subject: Preventing Deadlocks Reply with quote

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?

Thanks,

Steve
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Oct 03, 2003 3:17 pm    Post subject: Reply with quote

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

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Steverini
Beginner


Joined: 26 Sep 2003
Posts: 2
Topics: 1

PostPosted: Fri Oct 03, 2003 3:43 pm    Post subject: Reply with quote

That helped a great deal.

Thank you!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group