IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

deleting all the members of a PDS


IBM Mainframe Forums -> JCL & VSAM
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
kalais

New User


Joined: 18 Apr 2006
Posts: 22

PostPosted: Wed Apr 19, 2006 5:15 pm
Reply with quote

hi,


i want to delete all members of a PDS retaining the empty PDS.
how i can do that in
1.ISPF command/line command
as well as
2.in JCL
Back to top
View user's profile Send private message
mubs55

New User


Joined: 19 Apr 2006
Posts: 12

PostPosted: Wed Apr 19, 2006 6:55 pm
Reply with quote

ISPF command:

TSO DEL 'TEST.PDS'

JCL:
//EDSJB006 JOB ,CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
// NOTIFY=&SYSUID
//DELPDS EXEC PGM=IEFBR14
//INFILE DD DSN=TEST.PDS,DISP=(MOD,DELETE,DELETE)
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Apr 19, 2006 9:02 pm
Reply with quote

kalais, there is no direct TSO command or ISPF application to do what you want. However, you have a few options that you can look into:

1. Many of the third-party PDS management tools (PDSFAST and PDSTOOLS for example) contain a PDS directory empty command. If you have one of those tools, look into using it.

2. If you know Assembler, I understand that the STOW macro can be used to clear the PDS directory.

3. There are freeware tools available on sites such as the CBT Tape (http://www.cbttape.org/) that do what you want.

4. You can code an easy set of ISPF services to open a PDS, loop through each member, delete each member, close the PDS, and compress the now empty PDS. You can use these services:

LMINIT for SHRW
LMOPEN for OUTPUT
<loop>
LMMLIST
LMMDEL
<endloop>
LMCLOSE
LMFREE
LMINIT for EXCLU
LMCOMP
LMFREE
Back to top
View user's profile Send private message
pspreddy

New User


Joined: 14 Mar 2006
Posts: 24
Location: Chicago

PostPosted: Thu Apr 20, 2006 1:15 am
Reply with quote

Hi kalais,

You can use the SCRATCH command to delete as many members as you want from a PDS (even all the members)

Below is the example code

//SCRATCH3 JOB (TEST),'SCRATCH PDS Members',CLASS=U,MSGCLASS=H
//SCRATCH EXEC PGM=IKJEFT01
//STEPLIB DD DSN=<SCRATCH Load Library>,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
/* Scratch a single member */
SCRATCH 'GSFSOFT.FILE183.PDS(FASTPATH)'

/* Scratch several members and compress */
SCRATCH 'GSFSOFT.FILE183.PDS' +
MEMBERS(FASTPATH,COMPR*) +
COMPRESS

/* Scratch all the members and compress */
SCRATCH 'GSFSOFT.TEST.LOAD' MEMBERS(*)
/*

Try it and let me know in case you face any issues

Thanks
Shiva
Back to top
View user's profile Send private message
Dariusz
Warnings : 1

New User


Joined: 11 Aug 2005
Posts: 27
Location: POLAND

PostPosted: Thu Apr 20, 2006 1:52 pm
Reply with quote

Hi.
For this purpose i usuelly use this method:
-from ISPF primary option menu i select 3.4 (dslist)
-when i've got just library i send i (information) and after that i delete
-by function 3.2 i create new library with the same parameters as old
Regards.
Back to top
View user's profile Send private message
r2k1984

New User


Joined: 21 Jun 2005
Posts: 69
Location: chennai

PostPosted: Thu Apr 20, 2006 4:53 pm
Reply with quote

i think u can do like this


// jobcard
//step1 exec pgm=iebcopy
//sysut1 dd dsn= input1.pds , disp=(shr,delete,delete)
//sysut2 dd dsn=input1.pds,disp=(shr,delete.delete)
//
this will work.try thius and tell
Back to top
View user's profile Send private message
Benjamin.L

New User


Joined: 11 Apr 2006
Posts: 17
Location: DL.PRC

PostPosted: Fri Apr 21, 2006 8:22 am
Reply with quote

pspreddy wrote:

/* Scratch several members and compress */
SCRATCH 'GSFSOFT.FILE183.PDS' +
MEMBERS(FASTPATH,COMPR*) +
COMPRESS



Hi pspreddy,

1.Could u pls explain why to use 'COMPRESS' in the end?
2.MEMBERS(FASTPATH,COMPR*) , why to use COMPR* ?

THX A LOT!
Back to top
View user's profile Send private message
pspreddy

New User


Joined: 14 Mar 2006
Posts: 24
Location: Chicago

PostPosted: Sat Apr 22, 2006 6:32 am
Reply with quote

Hi Benjamin,

When members are scratched from a PDS, their space can't be used again until something called "compression" is done to the PDS.

We generally compress the PDs when we run out of space.COMPRESS will release all unused space in your PDS

Thanks
Shiva
Back to top
View user's profile Send private message
mf_user
Currently Banned

New User


Joined: 05 Jan 2006
Posts: 47

PostPosted: Tue May 09, 2006 1:16 pm
Reply with quote

Sorry. It does not work...........:-(
Back to top
View user's profile Send private message
Peter Kenter

New User


Joined: 18 Dec 2020
Posts: 1
Location: The Netherlands

PostPosted: Fri Dec 18, 2020 4:40 pm
Reply with quote

//CLEANUP EXEC PGM=IKJEFT01,COND=(4,LE)
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
SCRATCH 'PDSXXX1.P00.TEST.CNTL' MEMBERS(*)

returns with:

READY
SCRATCH 'PDSXXX1.P00.TEST.CNTL' MEMBERS(*)
IKJ56500I COMMAND SCRATCH NOT FOUND
READY
END

So it does not work I'm afraid.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Fri Dec 18, 2020 4:53 pm
Reply with quote

You are quite a bit late to the party.. icon_rolleyes.gif

Code:
//JUSTDOIT EXEC PGM=IDCAMS           
//DD0      DD DISP=SHR,DSN=<uid>.Z 
//SYSPRINT DD SYSOUT=*               
//SYSIN    DD *                       
 DEL '<uid>.Z(*)' FILE(DD0)         
/*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Deleting a Tape file JCL & VSAM 14
No new posts CA7 deleting files in steps after job... CA Products 4
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts list pds members name starting with xyz CLIST & REXX 11
No new posts REXX editmacro to compare two members... CLIST & REXX 7
Search our Forums:

Back to Top