Page 1 of 1

Which Job is using the VSAM dataset?

Posted: Wed Dec 13, 2017 6:12 pm
by Kapil Sharma
Hello,

One Job in production is abended for because of a VSAM dataset, as it was in contention. How can I know which job was using that dataset? Is there a way to find this that which job all jobs were using a VSAM dataset in for such an abended job?

Re: Which Job is using the VSAM dataset?

Posted: Wed Dec 13, 2017 6:26 pm
by Robert Sample
Once the job has abended, there is no way to know what other jobs / TSO users / started tasks had contention on the VSAM data set. While the contention is occurring, the D GRS console command can be used by someone at your site with sufficient authority to find out what is in contention for the data set. However, this command only works while the contention is there -- if your job abends, the command will not work to show past contention.

There are multiple ways to fix this issue: adding a DD statement with the VSAM data set using DISP=OLD is the most common solution. However, you could also change the SHAREOPTIONS when defining the data set as long as all programs accessing it use appropriate ENQUEUE and DEQUEUE mechanisms.

Re: Which Job is using the VSAM dataset?

Posted: Sun Jan 28, 2018 6:50 pm
by Kapil Sharma
Thanks Robert.

I don't have the authority to issue the D GRS command. I want to learn the ENQUEUE and DEQUEUE mechanism, is there a way I can learn it in test region without harming the existing functionality.

Re: Which Job is using the VSAM dataset?

Posted: Sun Jan 28, 2018 9:02 pm
by Robert Sample
ENQUEUE and DEQUEUE are covered in the CICS Application Programming manuals so you should start reading there. However, if you are testing in A test region, how do you expect to learn how it works? You need at least two regions to be able to use ENQUEUE and DEQUEUE appropriately.