The pedigree of this code...Ashley of FADH Software put it on the CBT,
my co-worker Vikram got it working on our system, I changed the
output format a bit to make it easier to feed utilities.
Code:
TITLE 'WHOSGOT - Dataset allocation display facility'
***Start of Specifications********************************************
*
* MODULE NAME : WHOSGOT
*
* FUNCTION : Provide details of dataset allocations
*
* STATUS : OS/390 1.3.0 TSO/E 2.5.0
*
* ATTRIBUTES : Unauthorised, AMODE 31, RMODE Any
*
* ENTRY CONDITIONS: Parmlist pointing to Dataset name
*
* EXIT CONDITIONS: Return code 0 - Normal, function complete
*
* MACROS :
* GQSCAN - GRS Queue scan
* STLINENO - Control screen handling
* PUTLINE - Terminal I/O routine
*
* EXTERNAL ROUTINES : None
*
* NOTES : None
*
*
* Ashley - FADH Software
*
* CHANGE ACTIVITY:
*
* 1) New Module development. 05/98 (AS)
* 2) Use PUTLINE for terminal I/O. 20/07/98 (AS)
*
****End of Specifications*********************************************
WHOSGOT CSECT
WHOSGOT AMODE 31
WHOSGOT RMODE ANY
B EYECATCH(,R15) skip over eyecatcher
MODID DC CL8'WHOSGOT ' Module identifier
DC CL8'VER 1.0' Version number
DC CL8'20/07/98' Date
EYECATCH EQU (*-MODID)+4
BAKR R14,0 Save status etc. on Stack
USING WHOSGOT,R12 Base reg assignment
LR R12,R15 Setup 1st base
LA R13,SAVE savearea for others
*
USING CPPL,R1 Addressability for CPPL
MVC UPTADDR,CPPLUPT save UPT adcon
MVC ECTADDR,CPPLECT save ECT adcon
DROP R1 drop it again
*
L R2,0(,R1) Address of Parameter list
LH R3,0(,R2) Length of parameters
LH R15,2(,R2) get the offset
LA R2,4(R15,R2) skip to start of parms
LA R15,4(,R15) adjust length
SR R3,R15 and calc parms length
LTR R3,R3 any parms given ?
BZ NOPARMS if not, tell 'em
LA R9,RNAME point to RNAME buffer
XR R10,R10 clear length count
CHKDSN EQU *
CLI 0(R2),X'00' is this a null ?
BE CHKDSNL if so, skip it
CLI 0(R2),X'40' is this a blank ?
BE CHKDSNL if so, skip it
CLI 0(R2),X'7D' is this a quote ?
BE CHKDSNL if so, skip it
MVC 0(1,R9),0(R2) build DSName
LA R9,1(,R9) next byte in RNAME buffer
LA R10,1(,R10) increment DSName length
CHKDSNL EQU *
LA R2,1(,R2) onto next byte
BCT R3,CHKDSN and round we go
LTR R10,R10 did we get a DSName ?
BZ NOPARMS if not, tell them
OC RNAME,=44C' ' make it uppercase
*
* MVC TXTMSG1+31(44),RNAME build title message
* MVC INFOLINE,TXTMSG1 place in output buffer
* STLINENO LINE=1 clear the screen
* BAL R11,PUTLRTN and display line
*
USING PSA,R0 addressability for PSA
L R8,FLCCVT get address of CVT
DROP R0 drop it again
USING CVT,R8 addressability for CVT
*
USING RIB,R2 Addressability for RIB's
USING RIBVAR,R3
USING RIBE,R4
*
XC QTOKEN,QTOKEN clear scan token
ENQSCAN EQU *
GQSCAN AREA=(SCANBUFF,4096), X
REQLIM=MAX, X
SCOPE=ALL, X
RESNAME=(QNAME,RNAME,(R10)), X
REQCNT=1, X
TOKEN=QTOKEN
ST R15,SCANRC save return code
CH R15,=H'4' no enqueues ?
BE NOTALLOC if so, inform user
BAL R10,CONVRIB go and display details
CLC SCANRC,=F'0' did the scan complete ?
BE END if so, out we go
B ENQSCAN and round we go again
*
PUTLRTN EQU *
STM R8,R9,SAVER8R9 save registers
LM R8,R9,UPTADDR load UPT and ECT adcons
PUTLINE PARM=PUTBLK,UPT=(R8),ECT=(R9),ECB=ECBADS, X
OUTPUT=(OUTTXT1,TERM,SINGLE,DATA),MF=(E,IOPLADS)
LM R8,R9,SAVER8R9 reload registers
BR R11 return to caller
NOTALLOC EQU *
* MVC INFOLINE,ERRMSG1 place in output buffer
* BAL R11,PUTLRTN and display line
B END and out we go
NOPARMS EQU *
MVC INFOLINE,ERRMSG2 place in output buffer
BAL R11,PUTLRTN and display line
B END and out we go
END EQU *
XR R15,R15 clear return code
PR restore callers status
*
CONVRIB EQU *
LA R2,SCANBUFF start of RIB data area
LR R7,R1 get loop counter
SETRIBA EQU *
LA R3,RIBEND-RIB(,R2) point to variable section
L R5,RIBNRIBE count of entries for this RIB
LH R6,RIBVLEN length of variable section
LA R4,RIBEND-RIB(R6,R2) point to RIBE
SETRIBB EQU *
MVI TXTMSG2+26,C' ' blank out optional text
MVC TXTMSG2+27(52),TXTMSG2+26
CLC CVTSNAME,RIBESYSN same system ?
BE SAMESYS if so, no extra text
MVC TXTMSG2+26(9),=C'on system'
MVC TXTMSG2+36(8),RIBESYSN save system name
SAMESYS EQU *
MVC TXTMSG2+10(3),=C'SHR' default to shared
TM RIBERFLG,RIBETYPE is it a 'shared' request ?
BO REQTSET if so, indicator set correctly
MVC TXTMSG2+10(3),=C'EXC' set to 'Exclusive'
REQTSET EQU *
MVC TXTMSG2+17(8),RIBEJBNM now move in jobname
MVC TXTMSG2+41(39),RNAME build title message
MVC INFOLINE,TXTMSG2 place in output buffer
BAL R11,PUTLRTN and display line
RIBLOOP EQU *
LA R4,RIBEEND-RIBE(,R4) point to next RIBE
BCT R5,SETRIBB and round we go
LR R2,R4 now pointing at next RIB
BCT R7,SETRIBA and onto next complete RIB
BR R10 and return to caller
*
*---------------------------------------------------------------------
*
LTORG
*
SAVE DC 18F'0' Savearea for others
ORG SAVE+4
DC C'F1SA' Indicate linkage stack
ORG
*
SAVER8R9 DC 2F'0' save area
*
SCANRC DS F Area for Scan return code
QTOKEN DC F'0' GQSCAN token
*
QNAME DC CL8'SYSDSN'
RNAME DC CL44' '
*
UPTADDR DC F'0' User Profile Table address
ECTADDR DC F'0' Environment Control Table addr
ECBADS DC F'0' ECB for PUTLINE
IOPLADS DC 4F'0' I/O parameter block
*
PUTBLK PUTLINE MF=L List form of PUTLINE
*
OUTTXT1 DC H'84' Length of line data (inc. hdr)
DC H'0' Reserved
INFOLINE DC CL80' ' Output data area
*
ERRMSG1 DC CL80'Dataset-is not allocated'
ERRMSG2 DC CL80'Dataset-name not provided, utility terminated'
TXTMSG1 DC CL80'Dataset-allocation summary for'
TXTMSG2 DC CL80'Allocat-d to on system '
THANX DC CL80'Thankx to Ashley - recompiled by bvickram@usa.net'
*
SCANBUFF DS XL4096'00'
*
CVT DSECT=YES
IHAPSA
IKJCPPL
ISGRIB
*
R0 EQU 0
R1 EQU 1
R2 EQU 2
R3 EQU 3
R4 EQU 4
R5 EQU 5
R6 EQU 6
R7 EQU 7
R8 EQU 8
R9 EQU 9
R10 EQU 10
R11 EQU 11
R12 EQU 12
R13 EQU 13
R14 EQU 14
R15 EQU 15
END
Get this assembled and try it out. I ended up naming it WG2 for some reason, so I invoke it in REXXs and such as 'WG2 WTSO.WNEG.REPORT'.
The really polished JCL that I have runs a list of database datasets from an IMS utility, then runs WG2 against all of them, then filters out the IMS region from the enqueue list, then gets a 0/4 return code depending on who is in there.
Give the original code a shot and see how you do with it.
My assemble JCL still looks like this (last update 2007), so I think that's what I used to build it. I can't speak for the odd options that are shown, or if they are appropriate for your system.
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
Ed, I am not sure. There is the XSYS option, but I have never tried it.
XSYS
Indicates that the XSYS=YES parameter should be used on the GQSCAN
macro. The default is to use XSYS=NO. This means that some ENQs on
other systems may not be returned. Use of the XSYS keyword may have
significant performance implications. See the documentation for the
GQSCAN macro in z/OS MVS Programming: Authorized Assembler Services
Reference EDT-IXG for more information.
The XSYS option on the GQSCAN macro allows the GQSCAN issuer to indicate whether cross-system processing is required. The default is XSYS=YES. You can specify the option XSYS=NO to turn cross-system processing off for that particular GQSCAN request. If you specify the no cross-system option, XSYS=NO, only the global resource information for the caller's system is returned. This type of GQSCAN can run under the caller's task, without causing the unit of work to be suspended.
Specifying XSYS=NO benefits users of GQSCAN that cannot be suspended and do not require data about requesters on other systems in the complex.
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
So with all respect, we are going to use an ISPF function to monitor batch datasets enqueues?
Proramming GQSCAN routines is back to the dark ages. All the information is for almost no effort to get from the OS'es or as steve (i think) to get from CA-MIM packages,
But once again, a company letting their employees giving the possibillity to browse/modify my financial data, no way.
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
I agree with Mr. Holland about access to the financial data. However, there are many ancillary data sets such as SORT control data sets or, perhaps, JCL that might need to be checked - not modified, but checked. All we know is there appears to be a data set usage conflict, and it is being resolved in an unacceptable way.
Back in the days when I was a systems guy with RACF SPECIAL I almost never gave my ID RACF OPERATIONS on the theory I did not want to innocently wonder into data I shouldn't see. If I was tasked with assisting someone else, I generally insisted on providing this assistance using his ID with the user doing what I told him to do or doing things myself under his direction. Much safer.
So with all respect, we are going to use an ISPF function to monitor batch datasets enqueues?
Proramming GQSCAN routines is back to the dark ages. All the information is for almost no effort to get from the OS'es or as steve (i think) to get from CA-MIM packages,
But once again, a company letting their employees giving the possibility to browse/modify my financial data, no way.
But then, it could be a bank.
Peter, I would LOVE to get away from getenq because it will probably simply stop working one of these days.
You say that it is minimal effort to get this info from the OS'es. Can you put me on the path for that? I would need to build something that I can run from a batch job or from the ISPF command line.
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
Ed, on page 2 of this topic a gave an example using the D GRS command.
If MIM is intalled, MIM messages could be trapped by MPF to trigger a kill action on (a) user(s).
Or if you are authorized to use CONSOLE in IOF/SDSF you could use probably D GRS too.
About the first 2 things i'm sure, cause i used to do system automation for a couple of years.
OK...I see those things, and have tried to figure out how to access them at my site. There are some menu options that fail with S806 because I'm using the wrong startup proc for TSO.
Are netview commands normally allowed for lowly developers like me?
What is the library node prefix for it (ie SEZA* is TCP/IP) ? I can check my system to see if I can find it.
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
Ed, the company I worked for had it's own automation section where I took part in. We worked mainly for the operating people and system programmers, and very seldom for developers.
So i guess there will be a problem to use Netview and/or SA/390
functionality for lowly developers like you
About library node's don't ask me, I wouldn't know. That is all site dependant.