For the original question: > Suppose I have in JCL: DD DISP=SHR,DSN=SOME.DATA.SET. > > In my program, I dynalloc (same) SOME.DATA.SET OLD. I expect > the ENQ to be upgraded to EXC. But when I FREE the allocation, > can the ENQ revert to SHR?
No, once that ENQ is upgraded from SHR to EXCL, it stays EXCL (until the last DD that references that data set is unallocated.) For the next question: > I don't know, but what about if you had > > //DD1 DD DISP=SHR,DSN=SOME.DATA.SET > //DD2 DD DISP=OLD,DSN=SOME.DATA.SET,FREE=CLOSE > > And CLOSEd DD2? The data set is allocated EXCLUSIVE for the job step. CLOSEing or unallocating DD2 does not cause it to be downgraded from EXCL to SHR. As for the DSENQSHR function: it only applies to batch JCL DDs, not dynamically allocated DDs. For batch, downgrading only happens on a step boundary, not when individual DDs are CLOSEd. And a dynamic allocation that causes the data set ENQ to be upgraded from SHR to EXCL prevents any downgrading. -Scott Ballentine IBM z/OS Device Allocation Development ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
