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

VSAM File opening in the output mode


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Tue Jul 03, 2007 6:28 pm
Reply with quote

hi,

In the below code, the VSAM file is initially opened in the output mode and then it is closed in the next line itself. after that it is again opened in the i-o mode. Please let me know why the vsam file is opened like this?

Code:
OPEN OUTPUT FE-VSAM-FILE.
CLOSE FE-VSAM-FILE.     
                         
OPEN I-O FE-VSAM-FILE.   


Can anyone tell me how to look for the documents in this forum? I need some document to understand the VSAM file handling in COBOL.

Thanks,
Bala
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jul 03, 2007 7:21 pm
Reply with quote

Hello,

The initial open/close is to prevent a possible error when the file is opened i-o.

If you click on the "Manuals" link at the top of the page, you will see a list of links to the current IBM product manuals. There is a VSAM services manual and several COBOL manuals. Coding info is in the COBOL manuals.
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Tue Jul 03, 2007 7:23 pm
Reply with quote

dick,

Could you tell me what you are referring as a possible error?

Thanks for the manual information.

Thanks,
Bala
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jul 03, 2007 7:29 pm
Reply with quote

You're welcome icon_smile.gif

When a "new" vsam file is opened without being "initialized" an error is raised (don't recall exactly which one just now, but i believe it is mentioned in some other topics). Opening/closing the file as output prevents the i-o open from being confused.
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Tue Jul 03, 2007 7:33 pm
Reply with quote

Thanks dick:-) I will refer the manual and come back if i am not able to get clear.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jul 03, 2007 8:35 pm
Reply with quote

Someone will be here icon_smile.gif
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top