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

To overwrite a VSAM file using cobol.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Sat May 26, 2007 10:39 pm
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
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: 3156
Location: Tucson AZ

PostPosted: Sun May 27, 2007 6:23 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top