Delete PDS which has no members.



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

Delete PDS which has no members.

Postby XY09 » Sun Nov 03, 2013 8:55 am

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.
XY09
 
Posts: 25
Joined: Mon Apr 26, 2010 9:19 am
Has thanked: 0 time
Been thanked: 0 time

Re: Delete PDS which has no members.

Postby NicC » Mon Nov 04, 2013 1:54 am

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Delete PDS which has no members.

Postby steve-myers » Mon Nov 04, 2013 2:26 am

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

Re: Delete PDS which has no members.

Postby Akatsukami » Mon Nov 04, 2013 8:11 pm

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.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Delete PDS which has no members.

Postby PJAlarcon » Mon Nov 04, 2013 8:38 pm

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.
PJAlarcon
 
Posts: 8
Joined: Mon Mar 14, 2011 6:28 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Delete PDS which has no members.

Postby Akatsukami » Mon Nov 04, 2013 9:48 pm

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.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Delete PDS which has no members.

Postby NicC » Wed Nov 06, 2013 3:21 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post