Page 1 of 2

How to find file contention.

PostPosted: Tue May 10, 2016 5:41 pm
by Raja190
Hi All,

Say for example, I have a job down due to file contention and I would like to know which job/ID was using the file at at the time of abend.
I know who can find what are the all jobs that currently using a file, through whohas or pressing F1 twice when it says 'data set in use'.

is there anyway to find it or any existing internal tool available in mainframe?




Thanks
Raja

Re: How to find file contention.

PostPosted: Tue May 10, 2016 5:49 pm
by enrico-sorichetti
from the ispf command line try
TSO ISRDDN ENQ

Re: How to find file contention.

PostPosted: Tue May 10, 2016 5:53 pm
by Raja190
Hi Enrico,

Will "TSO ISRDDN ENQ" will find which job was held the file in the past and it caused for job abend due to file contention?

Re: How to find file contention.

PostPosted: Tue May 10, 2016 6:01 pm
by enrico-sorichetti
please use Your brain...

after a job has abended, it will NO LONGER hold any dataset

the only possible places to find out about the past history
the job log
the scheduler <logs>(*) for the abends
(*) whatever you scheduler calls them

the command will show the OUTSTANDING/CURRENT ENQs

Re: How to find file contention.

PostPosted: Tue May 10, 2016 7:03 pm
by Robert Sample
Raja190, I think you have a serious misunderstanding. A job will not ABEND for file contention. If the job needs a data set and that data set is allocated exclusively to another job (or TSO user or started task), the job will wait for the data set. Similarly, if another address space has the data set allocated and the job needs exclusive access to the data set, the job will wait. The job could wait forever, potentially. However, to prevent some unknown number of jobs hanging around waiting for access to data sets, there is a wait time out set by the system. After that amount of time expires, if the job has not been able to start executing, the job is ABENDED. The reason for the ABEND, technically, is that the time out was exceeded -- NOT because of data set contention.

Also, you MAY be able to find out what was holding a data set by looking at the SMF 77 records. However, if you have never done anything with SMF data you need to find someone in your site support group to help you as most sites do not allow application programmers access to the SMF data, and it can be very difficult for a novice to understand the format of the SMF data. Plus, it is not a requirement that your site keep type 77 records -- only someone in your site support group can tell you for sure whether or not they are kept.

Re: How to find file contention.

PostPosted: Tue May 10, 2016 9:34 pm
by Pedro
RMFWDM will keep a history of dataset contention. That is, it has to be setup to capture it, and then afterwards you can scroll back through the contention information that was captured. I think RMF comes with z/OS, so it should be available on your system.

Re: How to find file contention.

PostPosted: Fri May 20, 2016 10:29 am
by sam_jj12
Hello raja,
Some shops will have the OMEGAMON installed by MVS for monitoring the job contention.Check with MVS.

Hello Enrico,
Am able to see the dataset which is needed by the job, but pls.let know how to get who is holding that another job/stc/tsu?

Re: How to find file contention.

PostPosted: Fri May 20, 2016 6:23 pm
by willy jensen
If you know the name of the dataset, then SMF types 14 and 15 might help you find who was using the dataset at that time. It is not a 100% solution as there will only be 14s or 15s if the dataset was opened.

Re: How to find file contention.

PostPosted: Fri May 20, 2016 6:36 pm
by Robert Sample
If you have console access, issue D GRS,C to see the resource contention at the current time. For historical data, the SMF 77 records will probably contain helpful information.

Re: How to find file contention.

PostPosted: Fri May 20, 2016 9:23 pm
by Terry Heinze
D GRS,RES=(SYSDSN,'datasetname') for a specific dataset contention.