Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

QUERYENQ example

275 views
Skip to first unread message

Weiss, Michael S

unread,
Sep 21, 2004, 11:28:13 AM9/21/04
to
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?

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

Robert Zenuk

unread,
Sep 21, 2004, 11:49:38 AM9/21/04
to
Here is an example I have been working on. After some discussion on the
list the other day, it appears that the XSYS parameter does not work correctly.
I found some hits regarding this on IBMLink, but we have the suspect PTF
(OA05196/UA06701) applied and this feature still does not work...

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

Jeremy C B Nicoll

unread,
Sep 21, 2004, 1:41:34 PM9/21/04
to
In article
<E06CFC1EA38B7549A1F5...@ptle2m03.up.corp.upc>,

"Weiss, Michael S" <mwe...@UNUMPROVIDENT.COM> wrote:
> 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?

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.

Stephen E. Bacher

unread,
Sep 21, 2004, 2:10:17 PM9/21/04
to
"Weiss, Michael S" <mwe...@UNUMPROVIDENT.COM> wrote:

>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

Weiss, Michael S

unread,
Sep 22, 2004, 2:11:46 PM9/22/04
to
Stephen,

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

Stephen E. Bacher

unread,
Sep 22, 2004, 5:36:46 PM9/22/04
to
"Weiss, Michael S" <mwe...@UNUMPROVIDENT.COM> wrote:

>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.

Robert Zenuk

unread,
Sep 22, 2004, 6:53:56 PM9/22/04
to
In ISPF QUERYENQ terminology, REQ is basically the address space name. If
you set this to '*', you will see every address space with the specified ENQ
(up until the LIMIT that defaults to 5000). If you are looking for a specific
ENQ, you would set your QNAME(ENQ_of_interest) and if you were looking for
specific occurance of a specific ENQ, you would set QNAME(ENQ_of_interest)
RNAME(Resource_name). The QNAME is the major name and the RNAME is the minor
name. In the case of a SYSDSN ENQ, SYSDSN is the major name/QNAME and the
actual DSN is the minor name/RNAME. The usefulness of the RNAME varies by ENQ.
Since there are so many ENQ's used by so many products, there is not one
general list to reference. The GRS Planning manual has some of them.

_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

charles....@gmail.com

unread,
Jun 24, 2014, 6:11:35 AM6/24/14
to
On Tuesday, September 21, 2004 4:49:38 PM UTC+1, Robert Zenuk wrote:
> Here is an example I have been working on. After some discussion on the list the other day, it appears that the XSYS parameter does not work correctly. I found some hits regarding this on IBMLink, but we have the suspect PTF (OA05196/UA06701) applied and this feature still does not work...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 asnameif 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 = RCif QRC < 8 thendo 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')selectwhen prefix = userid() then "BROWSE DATASET('"userid()".ENQ.ENQLIST')" when prefix <> userid() then "BROWSE DATASET('"prefix"."userid()".ENQ.ENQLIST')"otherwisedo zedlmsg = 'ENQ.ENQLIST DSN was not found'"SETMSG MSG(ISRZ000)"end endendelsesay 'QUERYENQ' major minor asname 'RC='RCHope This Helps,Rob---------------------------------------------------------------------- For TSO-REXX subscribe / signoff / archive access instructions, send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

Thanks Rob, still helping 10 years later! The line that says "if QRC = 2" should say "if QRC = 0" - the 'normal' return code, bizarrely is 2 (or 8 if no enqueues found)
0 new messages