Thanks!
-Michael
Michael S. Weiss
UnumProvident Developer Services
MWe...@unumprovident.com
(207) 575-9264
Visit The Developer Services Website!
http://developerservices <http://developerservices/>
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX
Item Closing code Updated Abstract _OA07962 _
(http://www-306.ibm.com/ibmlink/link2/sis/sisPage.jsp?applJsp=documentBrowse.jsp&docNumber=OA07962&searc
hArg=ispf+queryenq&navItem=sis.jsp) PER 08/03/04 QUERYENQ WAIT RC8, BUT
ENQUEUE EXISTS _OA05196 _
(http://www-306.ibm.com/ibmlink/link2/sis/sisPage.jsp?applJsp=documentBrowse.jsp&docNumber=OA05196&searchArg=ispf+queryenq&navIt
em=sis.jsp) PER 12/02/03 QUERYENQ NEEDS TO BE AMENDED TO IMPLEMENT OA04843
_OA03730 _
(http://www-306.ibm.com/ibmlink/link2/sis/sisPage.jsp?applJsp=documentBrowse.jsp&docNumber=OA03730&searchArg=ispf+queryenq&navItem=sis.jsp)
PER 08/06/03 AFTER APPLY OF APAR OW54381, THE RETURN CODES FROM QUERYENQ
_OW54381 _
(http://www-306.ibm.com/ibmlink/link2/sis/sisPage.jsp?applJsp=documentBrowse.jsp&docNumber=OW54381&searchArg=ispf+queryenq&navItem=sis.jsp)
PER 06/04/02 REQ OPTION WITH THE QUERYENQ CMD WORKS INCORRECTLY.
Here is the link to the ISPF Services manual for QUERYENQ:
_http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ISPZSG10/2.27?SHEL
F=ISPZPM10&DT=20010618134533_
(http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ISPZSG10/2.27?SHELF=ISPZPM10&DT=20010618134533)
And here is my sample code for using QUERYENQ:
/*********************************************************************/
/* REXX */
/*********************************************************************/
/* Purpose: Sample for QUERYENQ */
/*-------------------------------------------------------------------*/
/* Syntax: QUERYENQ major minor asname */
/*-------------------------------------------------------------------*/
/* Parms: major - The Major ENQ name (* for all, the default) */
/* minor - The Minor ENQ name (* for all, the default) */
/* asname - Address space name (defaults to userid) */
/* */
/* Example: ===> TSO QUERYENQ * userid.mydata * */
/* */
/* This shows all users of DSN userid.mydata */
/* */
/*********************************************************************/
/* Change Log */
/* */
/* Author Date Reason */
/* -------- --------- ----------------------------------------- */
/* R. Zenuk Sep 2004 Initial Creation */
/* */
/*********************************************************************/
arg major minor asname
if major = '' then major = '*'
if minor = '' then minor = '*'
if asname = '' then asname = userid()
address ISPEXEC
"QUERYENQ TABLE(QUERYENQ) QNAME(MAJOR) RNAME(MINOR)",
"REQ("asname") SAVE(ENQ) XSYS"
QRC = RC
if QRC < 8 then
do
if QRC = 2 then
zedlmsg = 'XSYS not specified and ENQ''s may exist on other',
'systems in the GRS Star'
if QRC = 4 then
zedlmsg = 'Number of ENQ''s exceeded the limit and the output',
'was truncated'
"SETMSG MSG(ISRZ000)"
"TBEND QUERYENQ"
prefix = sysvar('SYSPREF')
select
when prefix = userid() then
"BROWSE DATASET('"userid()".ENQ.ENQLIST')"
when prefix <> userid() then
"BROWSE DATASET('"prefix"."userid()".ENQ.ENQLIST')"
otherwise
do
zedlmsg = 'ENQ.ENQLIST DSN was not found'
"SETMSG MSG(ISRZ000)"
end
end
end
else
say 'QUERYENQ' major minor asname 'RC='RC
Hope This Helps,
Rob
QueryEnq is just an interface to a part of the OS called GRS (global
resource serialisation).
The OS uses enqueues to protect all sorts of different shared resources.
They're queues (ie lists) of tasks/programs/users holding a resource in
a particular way (shared or whatever), or waiting to hold it.
Each type of queue has a name - the "major" name. Each individual
thing being shared within that mechanism is represented by a "minor
name".
For example, you might have a "baked products" type of queue, with
several different parts of the OS using it to share scones, muffins and
biscuits. As major name is limited to 8 bytes, you'd maybe see this as
enqueues on major name "BKDPRODS" and minor names like "SCONES.FRUITY"
and "SCONES.WITH.CREAM" and "MUFFINS" and so on.
There's a operator command which will display parts of the queues, eg:
D GRS,RES=(BKDPRODS,*)
would show all of the baked products queue. Or:
D GRS,RES=(BKDPRODS,SCO*)
which would show the SCONES details in that queue. But there might be
other queues also protecting aspects of cakes, so
D GRS,RES=(*,SCONES.FRU*)
would show in any queue entries that started off "SCONES.FRU".
Now across the OS as a whole, things that are allocating datasets
protect them by enqueuing on major name SYSDSN with minor name equal to
the dsname. So
D GRS,RES=(SYSDSN,some.part.of.your.dsn*)
would show those. ISPF has additional enqueues so that eg it can allow
multiple people to access a PDS at the same time, but it protects the
members with an enq under major name SPFEDIT (or is it SYSEDIT - I
can't remember).
D GRS,RES=(*,some.part.of*)
might show a selection of different enqueue types all related to the
use of a named dataset.
Many of the enqueues on a system protect things like access to a shared
resource within an address space. Minor names often contain values
like the addresses of OS control blocks in storage, and are not all
that readable. There's a systems programming manual (though I don't
know which one it is these days) which describes in modest detail what
the common major names are used to protect.
--
Jeremy C B Nicoll - my opinions are my own.
>Could someone explain the parameters of the QUERYENQ service more? In
>the example it's not quite clear what they stand for. For example, if I
>wanted to see who had a dataset "MVS.PROD.LOADLIB" allocated - how would
>I call the service?
Depends on what you want to know. The ENQ "major name" and "minor name"
fields differ for each type of system resource enqueued upon.
If you want to know...
Who has my dataset allocated?
major name = 'SYSDSN'
minor name = data set name (fully qualified, no quotes)
If you want to know...
Who is editing my dataset in ISPF (or has it open as an ISPF table)?
major name = 'SPFEDIT'
minor name = data set name (fully qualified, no quotes), padded to 44 bytes,
followed by 8-character member name if any
Who is logged on to TSO?
major name = 'SYSIKJUA'
minor name = TSO userid
Who is using ISPF right now?
major name = 'SPFUSER'
minor name = TSO userid
What is HSM doing right now?
major name = 'ARCDSN'
minor name = name of dataset being recalled or other HSM stuff
etc., etc.
- seb
Very useful information! Do I assume in the various examples that the REQ() parm would be REQ(*)?
Lastly, is there a listing of the various major names that I could use? Your examples were all very helpful and interesting! Thanks!
-Michael
Michael S. Weiss
UnumProvident Developer Services
MWe...@unumprovident.com
(207) 575-9264
>Very useful information! Do I assume in the various examples that the
>REQ() parm would be REQ(*)?
I don't know the specifics of QUERYENQ. I only know about ENQ's in general.
>Lastly, is there a listing of the various major names that I could use?
Probably not, as any system application can make up its own ENQ. There are
several that are well known to MVS systems programmers, but many of them
are useful only if you're programming close to the bare metal. If you do
have the capability of REQ(*) or whatever, you can display all if the
current ENQ's on the system and get a flavor of what's generally in use.
_http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2G420/CCONTENTS
?SHELF=IEA2BK21&DN=SA22-7600-02&DT=20020115130147_
(http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2G420/CCONTENTS?SHELF=IEA2BK21&DN=SA22-760
0-02&DT=20020115130147)
Rob