|
View previous topic :: View next topic
|
| Author |
Message |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| Code: |
| exec cice delete file(file name) end-exec, |
should this alone would work for deleting all the records? |
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
| What does the CICS Application Programming Reference manual tell you about the EXEC CICS DELETE command? |
|
| Back to top |
|
 |
Bill O'Boyle
CICS Moderator

Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
| Whoa, you may want to think about doing this in Batch with a Batch program or 3rd-Party product. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| Yes, I agree with you all, but just wanted to know if we can do that as well in online. |
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
 |
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
| 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 |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
| 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 |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| Thanks Robert. |
|
| Back to top |
|
 |
quanzhong
New User
Joined: 12 Aug 2008 Posts: 46 Location: china
|
|
|
|
使用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 |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
Thanks quanzhong
I will check . |
|
| Back to top |
|
 |
Bill O'Boyle
CICS Moderator

Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
Bill, Noted and thanks. |
|
| Back to top |
|
 |
|
|