View previous topic :: View next topic
|
Author |
Message |
kalais
New User
Joined: 18 Apr 2006 Posts: 22
|
|
|
|
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 |
|
|
mubs55
New User
Joined: 19 Apr 2006 Posts: 12
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
pspreddy
New User
Joined: 14 Mar 2006 Posts: 24 Location: Chicago
|
|
|
|
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 |
|
|
Dariusz Warnings : 1 New User
Joined: 11 Aug 2005 Posts: 27 Location: POLAND
|
|
|
|
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 |
|
|
r2k1984
New User
Joined: 21 Jun 2005 Posts: 69 Location: chennai
|
|
|
|
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 |
|
|
Benjamin.L
New User
Joined: 11 Apr 2006 Posts: 17 Location: DL.PRC
|
|
|
|
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 |
|
|
pspreddy
New User
Joined: 14 Mar 2006 Posts: 24 Location: Chicago
|
|
|
|
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 |
|
|
mf_user Currently Banned New User
Joined: 05 Jan 2006 Posts: 47
|
|
|
|
Sorry. It does not work...........:-( |
|
Back to top |
|
|
Peter Kenter
New User
Joined: 18 Dec 2020 Posts: 1 Location: The Netherlands
|
|
|
|
//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 |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1255 Location: Bamberg, Germany
|
|
|
|
You are quite a bit late to the party..
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 |
|
|
|