Reset the PDS directory



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Reset the PDS directory

Postby jaggz » Tue Jun 19, 2012 8:05 am

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
User avatar
jaggz
 
Posts: 356
Joined: Fri Jul 23, 2010 8:51 pm
Has thanked: 8 times
Been thanked: 5 times

Re: Reset the PDS directory

Postby dick scherrer » Tue Jun 19, 2012 8:22 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Reset the PDS directory

Postby jaggz » Tue Jun 19, 2012 8:58 am

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
User avatar
jaggz
 
Posts: 356
Joined: Fri Jul 23, 2010 8:51 pm
Has thanked: 8 times
Been thanked: 5 times

Re: Reset the PDS directory

Postby steve-myers » Tue Jun 19, 2012 9:25 am

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.

These users thanked the author steve-myers for the post:
jaggz (Tue Jun 19, 2012 9:29 am)
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Reset the PDS directory

Postby jaggz » Tue Jun 19, 2012 9:31 am

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
User avatar
jaggz
 
Posts: 356
Joined: Fri Jul 23, 2010 8:51 pm
Has thanked: 8 times
Been thanked: 5 times

Re: Reset the PDS directory

Postby Anuj Dhawan » Tue Jun 19, 2012 10:06 am

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
Anuj

These users thanked the author Anuj Dhawan for the post:
jaggz (Tue Jun 19, 2012 10:34 am)
Anuj Dhawan
 
Posts: 273
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times

Re: Reset the PDS directory

Postby jaggz » Tue Jun 19, 2012 10:30 am

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
User avatar
jaggz
 
Posts: 356
Joined: Fri Jul 23, 2010 8:51 pm
Has thanked: 8 times
Been thanked: 5 times

Re: Reset the PDS directory

Postby Anuj Dhawan » Wed Jun 20, 2012 10:45 am

Thanks for posting back what worked for you... :)

Have a good one,
Anuj
Anuj Dhawan
 
Posts: 273
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times

Re: Reset the PDS directory

Postby steve-myers » Wed Jun 20, 2012 8:30 pm

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.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post