Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sub program which opens a vsam-file in output mode

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Sub program which opens a vsam-file in output mode
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: 3158
Location: Tucson AZ

PostPosted: Tue Feb 06, 2007 3:04 am    Post subject:
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    Post subject: Re: open output vsam-file
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: 3158
Location: Tucson AZ

PostPosted: Tue Feb 06, 2007 3:36 am    Post subject:
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    Post subject: Re: open output vsam-file
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: 3158
Location: Tucson AZ

PostPosted: Tue Feb 06, 2007 4:00 am    Post subject:
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    Post subject: Re: open output vsam-file
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: 3158
Location: Tucson AZ

PostPosted: Tue Feb 06, 2007 4:51 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts Underlying DB2 VSAM LDS - SMF recording vasanthz All Other Mainframe Topics 6 Thu Jan 05, 2017 4:20 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us