Page 1 of 1

Delete datasets of a particular HLQ?

Posted: Mon Dec 29, 2014 4:42 pm
by Sanjana Kashyap
Hi,

I had a requirement in which I wanted to delete all the datasets starting with a given HLQ. Actually these datasets are not referenced in last 45 days. To do that I used the beow JCL:

Code: Select all

//STEP010 EXEC PGM=ADRDSSU                                  
//SYSPRINT DD SYSOUT=*                                      
//DUMMYDD   DD DUMMY                                          
//SYSIN    DD *                                              
  DUMP                    /* COMMAND DUMP             */ -    
   DS(INCL(HLQ.**)        /* INCLUDE ALL DSN WITH HLQ */ -    
   BY((REFDT,LE,*,-45))   /* SELECT IF REFDT LE 45    */ -    
   OUTDD(DUMMYDD)         /* OUT DD NAME              */ -    
   DELETE                 /* DELETE ALL THE DATASETS  */      
/*
This code works but this is not deleting the datasets which either reside on Tape or which are migrated. It just deletes the datasets on DASD. What can I do to overcome from this? Thanks for any help on this.

Re: Delete datasets of a particular HLQ?

Posted: Mon Dec 29, 2014 7:46 pm
by Robert Sample
With tapes, you need to decide what you mean by "delete" -- because tape data sets longevity are controlled by their expiration date. If you merely want them not to show up in ISPF 3.4, you can uncatalog them (but they may still be accessible). If you need the tapes to be returned to the scratch pool for reuse, you need to work with your site support group to do so.

With migrated data sets, you can use HDELETE in ISPF 3.4 or batch to delete them. There may be an option of ADRDSSU to do so but you would need to look that up in the manual.