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
 

 

To overwrite a VSAM file using cobol.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
MGayathri

New User


Joined: 19 May 2007
Posts: 25
Location: Chennai

PostPosted: Sat May 26, 2007 9:36 pm    Post subject: To overwrite a VSAM file using cobol.
Reply with quote

Hi,
I have a VSAM file as an output file of cobol program. (I open the file in output mode). Every time I run the program, the file should get overwritten.
First time the file gets created, but when I execute the program second time, the vsam file is not over written with new values.
So, every time I am deleting and creating the VSAM file using IDCAMS before executing this program.
Is it possible to overwrite the VSAM file in the cobol program itself?
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Sat May 26, 2007 10:39 pm    Post subject:
Reply with quote

What do you mean over write. To nullify the file ?

Then keep on using IDCAMS, it's the fastest and easiest way.
Back to top
View user's profile Send private message
MGayathri

New User


Joined: 19 May 2007
Posts: 25
Location: Chennai

PostPosted: Sat May 26, 2007 11:21 pm    Post subject:
Reply with quote

For the first time I run the program, 10 records are written to the VSAM File.
Then, for the second time, i change the input file so that 20 records are written out to the VSAM file. But the VSAM file does not change. (Unless i delete and create it again).
Thank you.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Sun May 27, 2007 6:23 pm    Post subject:
Reply with quote

Isn't there a REUSE parameter you need in the VSAM defination?
Back to top
View user's profile Send private message
MGayathri

New User


Joined: 19 May 2007
Posts: 25
Location: Chennai

PostPosted: Sat Jun 09, 2007 1:15 am    Post subject: Thanks
Reply with quote

Yes, when I created the file with Reuse parameter, i was able to overwrite the file.
Thanks William..
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Jun 10, 2007 3:52 am    Post subject:
Reply with quote

Hi Gaya,

Thanx for letting us know. Very helpful (and thoughtful too!).
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 Fail to change physical VSAM filename... jacobdng CICS 6 Fri Jan 20, 2017 12:36 pm
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm


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