ISGQUERY should work for what you are attempting, the following simple test
worked fine for me to show the first job enqueueing the dataset:
OPEN (SYSPRINT,(OUTPUT))
STORAGE OBTAIN,ADDR=(R10),LENGTH=4096
ISGQUERY REQINFO=QSCAN,SCANACTION=START, X
ANSAREA=(R10),ANSLEN=4096,ANSDETAIL=FULL2, X
SEARCH=BY_FILTER,QNAMEMATCH=SPECIFIC,QNAME==CL8'SYSDSN',X
RNAMEMATCH=PATTERN,RNAMELEN=12, X
RNAME==CL12'SYS1.PARMLIB', X
RETCODE=LRETCODE,RSNCODE=LRSNCODE
USING ISGYQUAAHDR,R10
L R9,ISGYQUAAHDRFIRSTRECORD31
USING ISGYQUAARS,R9
L R8,ISGYQUAARSFIRSTRQ31
USING ISGYQUAARQ,R8
L R7,ISGYQUAARQRQX31
USING ISGYQUAARQX,R7
PUT SYSPRINT,ISGYQUAARQXJOBNAME
STORAGE RELEASE,ADDR=(R10),LENGTH=4096
CLOSE (SYSPRINT)
As John McKown has stated, maybe use SYSVSAM instead of SYSDSN.
Regards,
Leo
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of [email protected]
Sent: Sunday, February 14, 2016 5:01 PM
To: [email protected]
Subject: Would ISGQUERY be the proper Service
Hello,
.
I have a Started Task (STC), and sometimes a another job will hold a VSAM
dataset needed by this STC. This prevents the STC from properly re-opening the
dataset.
.
The VSAM datasets are defined with Share Options are 2,3 and Transactional VSAM
(RLS) is not an option.
.
.
Im looking for a z/OS macro or callable service that will allow the Started
Task to identify the name of the other job that has opened a VSAM dataset which
the Started Task needs.
.
.
I started reading the description of the ISGQUERY and its various Mapping
Macros but I dont see where it would returns the name of a batch job that has
allocated the dataset.
.
I suspect I would use GATHERFROM=SYSTEM with SCOPE=SYSTEM, since the batch
processing occurs on the same LPAR as the Started Task.
Is ISGQUERY the proper macro/service to accomplish this ?
.
Would someone provide some sample code and point me to the proper macro/service
to invoke to accomplish this.
.
.
The Started Task happens to be a CICS Address Space and we would use a standard
CICS Supplied Open Exit to drive this.
.
.
Paul
*************
*************
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to
[email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN