View previous topic :: View next topic
|
Author |
Message |
vamskrish Warnings : 1 New User
Joined: 31 Jan 2007 Posts: 27 Location: virginia
|
|
|
|
hi
i have a sub program which opens a vsam-file in output mode and writes records to it, closes the vsam-file and then goes back to the calling program. the calling program again opens it in input mode, reads records, processes it and closes it. this basically should happen for each key passed to the subprogram.
my issue is that first time when the subprogram is called, the records are being written well. but second time when the subprogram is called, i am getting a vsam-status code of '37', which means "An OPEN operation has been tried on a file which does not support the open mode specified in the OPEN statement" but i dont really understand what mistakes i might have done....
any suggestions please??? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Who owns the ACB (select/FD), the calling or called program? If both, are they both using the same filename (one or two DD statments)? |
|
Back to top |
|
|
vamskrish Warnings : 1 New User
Joined: 31 Jan 2007 Posts: 27 Location: virginia
|
|
|
|
thanks for your reply william,
yes both and they are using the same file name, only one dd statement.
also i guess we can not open the file in output mode once the file is loaded so i tried to open in extend mode and i am getting error 35 on open extend, the very first time the subprogram is called. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
I assume that the calling prog closed the file before calling the sub? Or is the calling leaving the file open? |
|
Back to top |
|
|
vamskrish Warnings : 1 New User
Joined: 31 Jan 2007 Posts: 27 Location: virginia
|
|
|
|
both the programs open and close the files... |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
I have very vague memories about this, but it's like they are shareing the same ACB. Possibly a simple fix would be to have use a different DD to access the dataset.
I'd love to hear from anybody out there that supports or disputes my ever failing memory... |
|
Back to top |
|
|
vamskrish Warnings : 1 New User
Joined: 31 Jan 2007 Posts: 27 Location: virginia
|
|
|
|
i tried something different...i opened in extend mode and checked for the status if vsam-status = '35' then open output vsam-file. this is because first time it needs to be opened in output mode...
this seems working and my job is still running...will let u know once it is done... |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Oh-Kay... Good luck..... but i still think you are using the same ACB and should separate them.... |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
How many recs? How many open/closes?
I came across a pgm that processed 20K recs and did 80K O/Cs. It took over 3 hrs to run.
After redesign w/o the O/Cs it ran in 10 mins. |
|
Back to top |
|
|
|