Page 1 of 1

Delete PDS which has no members.

PostPosted: Sun Nov 03, 2013 8:55 am
by XY09
hello Team,

I want to delete a bunch of PDS which has no members. I have a PDS high level qualifier i.e "PIWE.*" Could you please give me how i can do it.

Thanks,
xy09.

Re: Delete PDS which has no members.

PostPosted: Mon Nov 04, 2013 1:54 am
by NicC
What is the problem? A PDS is just a dataeset. As long as you have RACF (or equivalent) authority you can delete just the same as any other dataset.

Re: Delete PDS which has no members.

PostPosted: Mon Nov 04, 2013 2:26 am
by steve-myers
There are two fundamental problems which may be why so few people have volunteered a solution.
  1. Identifying the PDS data sets in a potentially much longer list.
  2. Identifying the PDS data sets that have no members.
As NicC pointed out, deleting the data set is easy, but identifying an empty PDS is more difficult.

Re: Delete PDS which has no members.

PostPosted: Mon Nov 04, 2013 8:11 pm
by Akatsukami
Such a thing, of course, cannot be done through JCL (and the TS has been a member long enough that heesh should know as much), but it seems to me that it would be simple through Rexx TSO/E functions and ISPF services.

Re: Delete PDS which has no members.

PostPosted: Mon Nov 04, 2013 8:38 pm
by PJAlarcon
You may try something like
//STEP1  EXEC PGM=IKJEFT01           
//SYSTSPRT DD SYSOUT=*               
//SYSTSIN  DD *                     
LISTDS 'your-pds' MEMBERS
/*                                   
//                                   

then inspect SYSTPRT if it has no members, would look like this
LISTDS 'your-pds' MEMBERS                                 
your-pds                                                 
--RECFM-LRECL-BLKSIZE-DSORG                                           
  FB    80    27920   PO                                             
--VOLUMES--                                                           
  XXXXXX                                                             
--MEMBERS--                                                           
READY                                                                 
END                                                                   

not much, but will give you a starting point.

Regards.

Re: Delete PDS which has no members.

PostPosted: Mon Nov 04, 2013 9:48 pm
by Akatsukami
Akatsukami wrote:Such a thing, of course, cannot be done through JCL (and the TS has been a member long enough that heesh should know as much), but it seems to me that it would be simple through Rexx TSO/E functions and ISPF services.

As I suspected, it took about forty minutes to write. Use the LMDLIST service to create and retrieve a data set list. If SYSDSORG is set by LISTDSI to "PO", the data set is a PDS(E). Use the LMMLIST to create a member list; RC=4 indicates that it's empty. A little more is needed for handling RECFM=U data sets, but I have some Rexx code for reading the directory of a PDS(E); I'll do that after lunch if it's warranted.

Re: Delete PDS which has no members.

PostPosted: Wed Nov 06, 2013 3:21 pm
by NicC
Is it just me or did the OP say that his PDSes were empty?
of PDS which has no members


And, just to be on the other side, for once, of those think that JCL cannot do anything except tell the mainframe what program to run and the resources required this task can be done via JCL - IEFBR14 and a load of DD statements for each PDS with a DISP of OLD,DELETE,DELETE.