IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sub program which opens a vsam-file in output mode


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vamskrish
Warnings : 1

New User


Joined: 31 Jan 2007
Posts: 27
Location: virginia

PostPosted: Tue Feb 06, 2007 2:56 am
Reply with quote

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

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Feb 06, 2007 3:04 am
Reply with quote

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
View user's profile Send private message
vamskrish
Warnings : 1

New User


Joined: 31 Jan 2007
Posts: 27
Location: virginia

PostPosted: Tue Feb 06, 2007 3:25 am
Reply with quote

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

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Feb 06, 2007 3:36 am
Reply with quote

I assume that the calling prog closed the file before calling the sub? Or is the calling leaving the file open?
Back to top
View user's profile Send private message
vamskrish
Warnings : 1

New User


Joined: 31 Jan 2007
Posts: 27
Location: virginia

PostPosted: Tue Feb 06, 2007 3:40 am
Reply with quote

both the programs open and close the files...
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Feb 06, 2007 4:00 am
Reply with quote

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... icon_lol.gif
Back to top
View user's profile Send private message
vamskrish
Warnings : 1

New User


Joined: 31 Jan 2007
Posts: 27
Location: virginia

PostPosted: Tue Feb 06, 2007 4:47 am
Reply with quote

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

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Feb 06, 2007 4:51 am
Reply with quote

Oh-Kay... icon_rolleyes.gif Good luck..... but i still think you are using the same ACB and should separate them.... icon_cry.gif
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Feb 06, 2007 7:25 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts HILITE on Browse mode? TSO/ISPF 2
No new posts Using API Gateway from CICS program CICS 0
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top