MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Contention problems with EXTEND files

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Tue Feb 06, 2007 10:54 am    Post subject: Contention problems with EXTEND files Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Feb 06, 2007 11:52 am    Post subject: Reply with quote

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
View user's profile Send private message
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Tue Feb 06, 2007 12:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Tue Feb 06, 2007 12:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group