On Mon, Feb 15, 2016 at 6:43 AM, Peter Relson <[email protected]> wrote:
> >ISGQUERY will give you information about ENQs and RESERVEs...
> >It has nothing to do with OPEN/CLOSE.
>
> True, but there is a strong correlation between OPEN and Allocate and the
> SYSDSN ENQ that usually accompanies the allocation.
> So I think of the OP's request as querying the SYSDSN ENQ for the data set
> in question to see who holds it.
>
Personally, iffin it t'were me, I'd check the SYSVSAM qname in addition
to the SYSDSN qname. Why? Because if you open a VSAM CLUSTER via a PATH,
the SYSDSN does _not_ get enqueued, but the base cluster _is_ open. And it
_will_show up with a SYSVSAM enqueue. IOW, you can do a SYSDSN check on a
base cluster; find it is not allocated; and still have the OPEN get an RC
because a PATH to the cluster _is_ OPEN. The SYSVSAM enqueue will warn you
of this before hand. But, be warned, the rname is not simply the cluster
name. Look at the output below (from an in-house UNIX command that I
wrote). The DSN is TSSTV.UMDB.ZAMFILE
===
SYSVSAM TSSTV.UMDT.ZAMFILE.DATACATALOG.ICF.VTSTH01...I TCICS3
LIH1 SHARED OWNED SYSTEM
009E19F0 009B
SYSVSAM TSSTV.UMDT.ZAMFILE.DATACATALOG.ICF.VTSTH01...O TCICS3
LIH1 SHARED OWNED SYSTEM
009E19F0 009B
SYSVSAM TSSTV.UMDT.ZAMFILE.INDEXCATALOG.ICF.VTSTH01...I TCICS3
LIH1 SHARED OWNED SYSTEM
009E19F0 009B
SYSVSAM TSSTV.UMDT.ZAMFILE.INDEXCATALOG.ICF.VTSTH01...O TCICS3
LIH1 SHARED OWNED SYSTEM
009E19F0 009B
SYSVSAM TSSTV.UMDT.ZAMFILECATALOG.ICF.VTSTH01...N TCICS3
LIH1 SHARED OWNED SYSTEM
009E19F0 009B
SYSVSAM TSSTV.UMDT.ZAMFILECATALOG.ICF.VTSTH01...P TCICS3
LIH1 SHARED OWNED SYSTEM
009E19F0 009B
===
>
> On our system we have a "WHO" command that perhaps uses GQSCAN or ISGQUERY
> to obtain the information about who has the data set ENQ.
>
> I'd also note that if you have an interface that gives you back an ASID
> you can determine the (current) jobname from that ASID programmatically
> via LOCASCB and the ASSB fields ASSBJBNI and ASSBJBNS (those two being
> slightly safer than the pointers in ASCBJBNI and ASCBJBNS). Serialization
> and/or recovery is needed if the ASID might "go away" (as the ASCB/ASSB
> could be freed).
>
> Peter Relson
> z/OS Core Technology Design
>
>
--
The man has the intellect of a lobotomized turtle.
Maranatha! <><
John McKown
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN