Need some advise/ideas on below issue.
During batch process window, if someone is holding a file in FileAid/FMgr the jobs get abended due to contention.
Trying to find a way to scan thru the list of file contenstions (Ex: Starting ABCD.SYS.*) and USER IDs which are holding the files. This information can be used to free the files before starting the batch.
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
jpdeshai wrote:
... During batch process window, if someone is holding a file in FileAid/FMgr the jobs get abended due to contention.
If there is a data set usage problem, one of the jobs is delayed. If it is canceled, it is being done manually by operators.
While I hate to advertise any CA product, the CA-MIM product will notify a TSO user holding a data set required by a batch job.
While a scheduler could, in theory, detect a TSO user or another batch job holding a data set required for a batch job it wants to submit, in practice this is not possible; the scheduler would have to know, in detail, the data sets required for the batch job.
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
Quote:
•If there is a data set usage problem, one of the jobs is delayed. If it is canceled, it is being done manually by operators.
Or possibly by an Automation process that is triggered by the message to prevent this. However I believe the "holder" should be terminated, not the production job trying to allocate the dataset.
As Peter mentions, why are production dataset being "held" by FileAid?
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
Rohit, you could be right. About that I couldnt care less, in bad test environments everybody is bumping into each other.
In the good ones, this problem wouldnt probably exist. In production it
is forbidden. At least that is my almost 40 year experience.
It can be for production or test region...
Most of the times people forget batch window and they just keep browsing the files or they leave the session active go home which takes some time to close.
Any of these May cause batch issues.Ian just thinking of running an utility and send out an email so that they come out before batch.that's my idea.
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
Remove access to production data from all but production IDs. If people need to see a production dataset they can ask for a job to be scheduled that will copy the dataset, after management sign-off, - possibly into a dasd pool that gets emptied every day.
Also, anyone leaving for the day and not terminating their session should themselves be terminated as a securty risk.
However, why does developers and testers have access to production and mock up file's? And even if it is required it must be given for a day with proper approvals. If this is not in place then none of us or any tool can help you to what you are trying to achieve here.
only production support people can have access to all the files pertaining to all the applications they are supporting.
Also, let's assume you have some tool which lets user know to free some datasets before batch starts and what if again someone locks it during batch window ? How would you control this?
Our backups need exclusive access. Even if someone at the help desk is browsing a database, it messes up batch.
Another problem we've had is long running test jobs with production load libraries concatenated. That messes with the pre-promote backups.
We WERE having trouble with long running data extracts from production, but it finally got to the point where they had to forbid those. They just make a frequent copy of the databases to a read-only set and we have to use those.
Sorry...to answer the original question...I used a program out on the CBT tape called 'whohas' that runs an enqueue scan on datasets. I made wrappers for it and it comes in very handy for preventing trouble like this.
For our test batches, a batch version checks for people in the database, and ends with a condition code 8 if it finds anyone. We can then ask them to get out and rerun the job. Once it finishes ok, the rest of the batch keeps going. This has saved a LOT of batch backouts and broken schedules.
Are you looking for something like that? I still have the source code!
Yes, I am looking similar to that. Could you be kind enough to share the code?
There are lot of reasons why we have access. I just need some utility which I can run before my batch starts and find out if any file is locked. (Is it 100% proof? may not be!!! but upto somelevel )
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
jpdeshai wrote:
... There are lot of reasons why we have access. I just need some utility which I can run before my batch starts and find out if any file is locked. (Is it 100% proof? may not be!!! but upto somelevel )
No, it is not 100% "proof." The allocation may be a fraction of a second after the scan was performed.
Also, it looks like your shop does look secured the way you are described accesses given to individuals and these tools may give you ID's to let them come out of the file but there is no assurance of having great success over contention.
Also, it looks like your shop does NOT look secured the way you are described accesses given to individuals and these tools may give you ID's to let them come out of the file but there is no assurance of having great success over contention.
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.