View previous topic :: View next topic |
Author |
Message |
Anand_R Intermediate
Joined: 24 Dec 2002 Posts: 189 Topics: 60
|
Posted: Tue Feb 06, 2007 10:54 am Post subject: Contention problems with EXTEND files |
|
|
Hi everyone,
I have a production problem last night and as I was analyzing I found that one of the file is being used as an EXTEND in all the jobs and my question is whether if any two jobs executes simultaneously that uses that file in EXTEND mode, will there be any contention issues and how the both jobs work at that scenario. I try to find by searching word EXTEND in this form and I also tried in Manuals, but could not find an answer. Appreciate if somebody can guide me or explain me.
Thanks for your help
Anand |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Tue Feb 06, 2007 11:52 am Post subject: |
|
|
is this vsam or qsam (bsam??). Control over vsam is described by the vsam's attributes and can be viewed by a listcat (or other utilities). qsam is pretty much jcl controled, unless you are doing dynamic allocation.
basic answer is yes, either type of file: vsam with wrong share options and poor programming, qsam not protected by disposition parms. bad scheduling.
EXTEND in COBOL means added new records at the end. Normally, the JCL would be set at DISP=(MOD,,) to issue exclusivity. If the DISP is MOD, then you do not have problems; the system will not allow two JOBs update access to a file when both JOBs are MOD.
what are they (qsam or vsam) and what is problem you are trying to solve? _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
Anand_R Intermediate
Joined: 24 Dec 2002 Posts: 189 Topics: 60
|
Posted: Tue Feb 06, 2007 12:06 pm Post subject: |
|
|
Thanks Dick for your prompt response
The file is QSAM and it is being used with option SHR. I am explaining with an example, I have 10 jobs and some of these jobs run simultaneously. There is one common error file which we create in every job if any Business processing error occurs. Some of the jobs are running simultaneously ( each job has only one program) and this error file is being opened as EXTEND in every program/job. In the JCL this file is with dispostion SHR. The problem is, in the last job we right trailer record, but this record is missing and also some of the jobs have not written any error records, and they should.
I am trying to find out if the error file might have messed up in one of the jobs that runs parallelly. Please let me know if I am not clear.
Note: None of the jobs were abended, all of them went fine without any problems, but error file was wrong.
Thanks
Anand |
|
Back to top |
|
|
Bill Dennis Advanced
Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Tue Feb 06, 2007 12:32 pm Post subject: |
|
|
You can't use a file with DISP=SHR and write into it from multiple programs at the same time. Two pgms OPEN the file, see the same EOF pointer and one writes over the other.
One solution is to use DISP=MOD but then two jobs won't even run at the same time.
The best solution would be to do your own ENQ (before OPEN)/DEQ (after CLOSE) logic in an assembler routine to serialize the access. One job would wait for the resource to be released by the other.
We do this using the same resource names as ISPF to detect if anyone is also editing the file. _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
|
|
|