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

delete all records from a file


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Wed Jun 27, 2012 10:45 pm
Reply with quote

Code:
exec cice delete file(file  name) end-exec,

should this alone would work for deleting all the records?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jun 27, 2012 11:03 pm
Reply with quote

What does the CICS Application Programming Reference manual tell you about the EXEC CICS DELETE command?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Jun 28, 2012 12:37 am
Reply with quote

Whoa, you may want to think about doing this in Batch with a Batch program or 3rd-Party product.
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: Thu Jun 28, 2012 1:09 am
Reply with quote

Hello,

After closing this file to the online. . .

However - Between the performance issue and the potential for failed/incorrect transactions, suggest you consider what Bill has posted. . .
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Mon Jul 02, 2012 5:26 pm
Reply with quote

Yes, I agree with you all, but just wanted to know if we can do that as well in online.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Jul 02, 2012 7:12 pm
Reply with quote

You can delete all records in a VSAM file in CICS by reading for update each record and deleting it; however, this is NEVER a good design for a system since you are using CICS in a very wrong way.

Probably the most common and easiest way to do what you want is to close the file to CICS, delete and define it, load an initial record into it, then open the file to CICS again.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Mon Jul 02, 2012 11:13 pm
Reply with quote

Quote:
Yes, I agree with you all, but just wanted to know if we can do that as well in online.


Translation for forum abuser to english:

I know all of you experts advise against this, but I just wanted to waste everyones valuable time for my own curiosity. Please get back to providing help for those who really need it.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jul 03, 2012 12:42 am
Reply with quote

Quote:
Please get back to providing help for those who really need it.


he did not say or imply that, at all.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Tue Jul 03, 2012 5:29 pm
Reply with quote

Thanks Robert.
Back to top
View user's profile Send private message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Tue Jul 10, 2012 10:23 am
Reply with quote

使用CLOSE EMPTY去清空一个online文件

Code:

005900             EXEC CICS SET
006000                       FILE (SS84WS-COMMAND-FILE-NAME)
006100                       CLOSED
006200                       ENABLED
006300                       EMPTY
006400                       NOHANDLE
006500             END-EXEC
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Tue Jul 10, 2012 6:29 pm
Reply with quote

Thanks quanzhong

I will check .
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Jul 10, 2012 6:35 pm
Reply with quote

To ensure data/program integrity, EVERY program which accesses this file must issue ENQ/DEQ API's, using the same resource-name, when the region is ACTIVE, while attempting to DELETE all the records. Hopefully, there aren't too many programs.

This is why a Batch solution would be the better way to go when the region is DOWN.

Just my .02 cents....
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Tue Jul 10, 2012 9:06 pm
Reply with quote

Bill, Noted icon_smile.gif and thanks.
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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