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
 

 

delete all records from a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Wed Jun 27, 2012 10:45 pm    Post subject: delete all records from a file
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: 7910
Location: Bellevue, IA

PostPosted: Wed Jun 27, 2012 11:03 pm    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Jun 28, 2012 12:37 am    Post subject: Reply to: delete all records from a file
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

Site Director


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

PostPosted: Thu Jun 28, 2012 1:09 am    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Mon Jul 02, 2012 5:26 pm    Post subject:
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: 7910
Location: Bellevue, IA

PostPosted: Mon Jul 02, 2012 7:12 pm    Post subject:
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: 645
Location: Pennsylvania

PostPosted: Mon Jul 02, 2012 11:13 pm    Post subject:
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    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Tue Jul 03, 2012 5:29 pm    Post subject:
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    Post subject: Reply to: delete all records from a file
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Tue Jul 10, 2012 6:29 pm    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue Jul 10, 2012 6:35 pm    Post subject: Reply to: delete all records from a file
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Tue Jul 10, 2012 9:06 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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