Delete datasets of a particular HLQ?

JES2/3, JCL, utilities.
Post Reply
Sanjana Kashyap
New Member
Posts: 5
Joined: Wed Jul 30, 2014 10:26 am

Delete datasets of a particular HLQ?

Post 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.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1891
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Delete datasets of a particular HLQ?

Post 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.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “JCL - Job Control Language.”