Page 1 of 1

Reset the PDS directory

PostPosted: Tue Jun 19, 2012 8:05 am
by jaggz
Dear All,

Is it possible to Delete all the PDSE or PDS members at once ? Please direct me.

I am at Z/OS : 1.12 level.

Jaggz

Re: Reset the PDS directory

PostPosted: Tue Jun 19, 2012 8:22 am
by dick scherrer
Hello,

One way is to delete the dataset and then re-allocate it.

Another would be to create a new dataset with the same space/attributes and "move" all of the members from the original to the new dataset - which could also be your backup.

Re: Reset the PDS directory

PostPosted: Tue Jun 19, 2012 8:58 am
by jaggz
Hi Dick,

Thanks for your tip.

Hi All,
Can we achieve Resetting the PDS directory to Null using assembler Routine.(Emptying the PDS). Any pointers or suggestions ?

Jaggz

Re: Reset the PDS directory

PostPosted: Tue Jun 19, 2012 9:25 am
by steve-myers
For PDSE datasets there is a STOW option that will delete all members.

PDS datasets are more difficult. A programmer with basic knowledge of EXCP can whip up a program to replace the first record of a PDS directory with a directory that contains no members, BUT this program does not reset the pointer to the end of the dataset. Such programs often require the "empty" PDS to be "compressed" to start recording after the direct0ry.

"File" 713 of the CBT "tape" at http://www.cbttape.org contains a utility that will reset a PDS directory AND reset the end of dataset pointer in a single step, AND if it detects a PDSE dataset it will reset the directory using the STOW macro as discussed in the first paragraph. Unfortunately, the user of this program must obtain the dataset as a "ZIP" file from the web site, expand the contents of the "ZIP" file, send the "XMI" file contained in the "ZIP" file to their mainframe, and expand the "XMI" dataset to a PDS. After that, the user must assemble and link the program in the source PDS before the program can be run.

I believe the PDS TSO/ISPF product, also available through CBT, can perform a similar function, but I don't think it can run as a batch job like the program in the second paragraph.

Re: Reset the PDS directory

PostPosted: Tue Jun 19, 2012 9:31 am
by jaggz
Hi Steve,

yes I was expecting your Reply :) .One thought Hope this Routine runs irrespective of Z/OS version, but is there a sample JCL to run this Load Module to RESET the directory ?

Jaggz

Re: Reset the PDS directory

PostPosted: Tue Jun 19, 2012 10:06 am
by Anuj Dhawan
Apart from what Steve and Dick suggests, have you tried the smart DFSORT trick "Delete all members of a PDS" explained here http://www.ibm.com/support/docview.wss? ... g3T7000094 .

If REXX is your choice:

/* REXX */                         
thepds = 'your.PDS'                             
x = Outtrap('ml.')                           
"LISTDS "thepds" MEMBERS"                   
x = Outtrap('Off')                           
Do n = 7 To ml.0                             
  Parse Var ml.n member .                   
  "DELETE "thepds"("member")"               
End                                         
Exit 0

Re: Reset the PDS directory

PostPosted: Tue Jun 19, 2012 10:30 am
by jaggz
Hey Anuj,

Thanks for your Pointer.

Steve,

I was able to Install the EMPTYPDS load module and the delete the PDS Members at one shot(Performance wise its magic).

Can follow the below step to install EMPTYPDS.(Thanks steve)

Step 1 : Go to http://www.cbttape.org
step 2 : Download the File 713 to your workstation.
Step 3 : FTP the FILE 713 file to a preallocated 'FILE713.XMI' PS file and Receive "FILE713.XMI'.
Step 4 : Use any available HLASMCL Sample JCL to install.
Step 5 : JCL to achieve
//Jaggz$ JOB MSGCLASS=X,MSGLEVEL=(1,1),CLASS=B,
//         REGION=5M,NOTIFY=&SYSUID               
//EMPTYIT  EXEC PGM=EMPTYPDS                     
//STEPLIB   DD  DISP=SHR,DSN=AJAGGZ.LPALIB       
//SYSPRINT  DD  SYSOUT=*                         
//SYSUT2    DD  DISP=OLD,DSN=SMPE.DB2.SMPPTS   

Hope it helps someone.

Jaggz

Re: Reset the PDS directory

PostPosted: Wed Jun 20, 2012 10:45 am
by Anuj Dhawan
Thanks for posting back what worked for you... :)

Have a good one,

Re: Reset the PDS directory

PostPosted: Wed Jun 20, 2012 8:30 pm
by steve-myers
Well, you might say I know a lot about EMPTYPDS, though the version now on CBT is different than what I knew some years ago.