Page 1 of 1

Is there a job can delete all members from a PDS?

PostPosted: Fri Nov 23, 2012 6:46 pm
by wangy
Since the CICS is using the PDS, i can not just delete / define the whole PDS

Re: Is there a job can delete all members from a PDS?

PostPosted: Fri Nov 23, 2012 6:52 pm
by enrico-sorichetti
if You want to receive good answers it would be wise to adopt a better posting style!

read and meditate on
How To Ask Questions The Smart Way
http://catb.org/~esr/faqs/smart-questions.html

Re: Is there a job can delete all members from a PDS?

PostPosted: Fri Nov 23, 2012 8:31 pm
by steve-myers
Personally I think your question is reasonably clear, as is the topic. The topic has been discussed before; you should review previous postings in this site before opening a new topic

There is no "job" or JCL to accomplish what you want to accomplish. However, since CICS is using the PDS, it is probably unwise to delete all the members; presumably CICS needs at least some of the members to function, or it would not have the PDS allocated to it.

You might want to investigate "file" 713 at www.cbttape.org. However, if the PDS is actually a PDSE, the EMPTYPDS program in the "file" won't work; it requires exclusive control of the data set.

Re: Is there a job can delete all members from a PDS?

PostPosted: Fri Nov 23, 2012 9:03 pm
by mongan
Steve understated when he said it may be unwise to do what you plan on doing, it can be fatal to your CICS programs and may be against company policy - you can get intro big trouble. Is your CICS recycled regulary? So, tell us what you really want to do and why, then we can give you good advice.

Re: Is there a job can delete all members from a PDS?

PostPosted: Fri Nov 23, 2012 9:04 pm
by enrico-sorichetti
Personally I think your question is reasonably clear, as is the topic.


the question was not clear in the initial post ( before being edited )

the title was the same
the text was something like ...
can anybody help me


that' the reason for my comment

Re: Is there a job can delete all members from a PDS?

PostPosted: Sat Nov 24, 2012 9:41 am
by Dinesh anbu
ya by using an idcams utilite


//TCHN267# JOB ABC,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE TCHN267.VENKY.PDS1(MEM1)
/*
//

Re: Is there a job can delete all members from a PDS?

PostPosted: Sat Nov 24, 2012 10:51 am
by steve-myers
Dinesh anbu's job deletes a single member, not all the members. Also, as presented here, it requires exclusive use of the data set for the brief period required to delete the member.

Re: Is there a job can delete all members from a PDS?

PostPosted: Sat Nov 24, 2012 11:37 am
by Dinesh anbu
Better you can use this program

//STEP0200 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//IN DD DUMMY
//OUT DD DSN=XXX.YYY.ZZZ,DISP=OLD
//SYSIN DD *
REPRO IFILE(IN) OFILE(OUT) REPLACE
/*

Re: Is there a job can delete all members from a PDS?

PostPosted: Sat Nov 24, 2012 12:52 pm
by steve-myers
I do hope Dinesh anbu actually tested this. If XXX.YYY.ZZZ is a sequential data set, the REPRO command
will replace any existing content with, well, nothing. If XXX.YYY.ZZZ is a PDS, and IDCAMS is stupid, it will make XXX.YYY.ZZZ a sequential data set, and completely destroy the directory. If IDCAMS is smart enough to verify XXX.YYY.ZZZ is a PDS, it should write a diagnostic and do nothing. Oh yes, the DISP=OLD in the JCL requires exclusive control of the data set; the job won't run while CICS is running; but the topic starter wants to run his job while CICS is up.