MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

deleting vsam file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware
View previous topic :: View next topic  
Author Message
mdisulaiman
Beginner


Joined: 14 Nov 2003
Posts: 17
Topics: 10

PostPosted: Mon Dec 08, 2003 10:42 pm    Post subject: deleting vsam file Reply with quote

hai all,

is it possible to delete a vsam file through cics
_________________
sulaiman
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Tue Dec 09, 2003 5:56 am    Post subject: Reply with quote

mdisulaiman,

what exactly do you mean by delete a file? Do you want to delete the file (removing catalog entry) ? or is it just deleting the records in a vsam file?

If you want to delete the cluster entirely ,You can write the following JCL to a spool which will be submitted.

Code:

//STEPO100 EXEC PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//SYSIN    DD   *
   DELETE VSAM CLUSTER NAME
//*


Check this link for a detailed explanation of SPOOL

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DFHCAP34/4.6?DT=19990319124947

on the other hand if you want to delete all records in a vsam file , then the simplest yet cumbersome way is to delete the records generically. A more complicated solution would be to issue system programmer's commands thru the pgm.

You can delete all records in a VSAM file with the following command.
Code:

'CEMT S FILE(VSAME FILE NAME) CLOSED DISABLED EMPTYREQ'
.

The vsam cluster must have been defined with the REUSE attribute, and must not be using RLS.once you issue that command and enable the file ,the next time the file is opened its data is erased.

check this link which explains in detail

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DFHA8P00/2.141?SHELF=DFHPUSH0&DT=20011216184251

In order to use the above mentioned system commands you need to have the 'SP' translator option which accepts the system programmer commands, which are basically EXEC CICS SET, INQUIRE, PERFORM, CREATE..

Hope this helps...

cheers

kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mdisulaiman
Beginner


Joined: 14 Nov 2003
Posts: 17
Topics: 10

PostPosted: Tue Dec 09, 2003 9:51 pm    Post subject: Reply with quote

hai kolusu,

thanks for your info.


bye
_________________
sulaiman
Back to top
View user's profile Send private message Send e-mail
jim haire
Beginner


Joined: 30 Dec 2002
Posts: 140
Topics: 40

PostPosted: Wed Jan 15, 2020 2:55 pm    Post subject: Ability to delete a sequential file from a CICS Map Reply with quote

Only 17 years later, a similar question. here is the scenario:

A customer transmits a file to our mainframe and it gets stored in a sequential dataset (not a PDS). Our transmit process purposely does not allow a file to be sent to overlay what is existing in the sequential datsaset.

A job runs and abends in one of the programs, possibly because the file contained invalid data. We would like to "reset" the environment so that the job can be restarted.

This would entail our support staff choosing an option from a CICS screen which would update a few fields on a database. We would also like the CICS transaction to delete the sequential file so that a new customer file could be sent to replace the one containing the invalid data.

Is it possible to delete a dataset from within CICS? I know I could place a message in an MQ and trigger a job in that way, but didn't want to involve another technology if not needed.

[/u]
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Thu Jan 16, 2020 10:33 am    Post subject: Reply with quote

jim haire,

You can use EXEC CICS SPOOL to submit a batch job to INTRDR. So simply generate the DELETE JCL and submit it to INTRDR

Here are a few examples

1. https://www.ibm.com/support/knowledgecenter/SSGMCP_5.6.0/applications/designing/dfhp3tz.html

2. Submit JCL to INTRDR from CICS
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jim haire
Beginner


Joined: 30 Dec 2002
Posts: 140
Topics: 40

PostPosted: Thu Jan 16, 2020 10:59 am    Post subject: Reply with quote

Thanks, Kolusu. I will give it a try!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group