IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to delete datasets without knowing if vsam, gdg or seqds


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Thu Mar 26, 2015 7:13 am
Reply with quote

Hello to all,

I have a thousands of datasets like the one below, but in it, there's a gdg, vsam (data and index) and seqds. I need to delete them but is there a way to delete those even if I don't know what kind of datasets are they?
Code:
XXX.YYYYU.DL.BPMA2.GT3.#210312
XXX.YYYYU.UL.AMEX.STMTBTA.#210312
XXX.YYYYS.DATAMART.CPDLB.#123111
XXX.YYYYG.BCPONL.DDAD.BK.SHREM3R2.G0010V00
XXX.YYYYG.BCPONL.DDAD.BK.SHREM7R2.G0008V00
XXX.YYYYG.BCPONL.DDAD.BK.SHREM8R.G0009V00
XXX.YYYYG.CPAPF2.G1021V00
XXX.YYYYG.DDAD.SHREM08.BILRES.G0008V00
XXX.YYYYG.DDAD.SHREM08.BILRES.G0008V00
XXX.YYYYG.JP10S.IXJC1.G2003V00
XXX.YYYYG.JP10S.IXJC1.G2002V00
XXX.YYYYG.JP10S.IXJC1.G1998V00
XXX.YYYYG.JP10S.IXJC1.G1997V00
XXX.YYYYG.JP10S.IXJC1.G1996V00
XXX.YYYYG.JP10S.IXJC1.G1995V00
XXX.YYYYM.CPDP075.REPORT
XXX.YYYYV.CADSTAB
XXX.YYYYV.CP10V.MPMAF.INDEX
XXX.YYYYV.SEC.LEGAL.DDSPWD.DATA
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Thu Mar 26, 2015 9:17 am
Reply with quote

There are issues, of course, with all of them. You need a more complete list.
  • GDG - Individual GDG data sets are ordinary non-VSAM data sets. You delete them just like any other non-VSAM data set. However, if it is your goal to delete all of them you probably want to delete the GDG index, too.
  • Non-VSAM - If you are confident they are cataloged AND they exist on the volume where they are cataloged you can delete then in JCL or in IDCAMS using DELETE dataset-name NONVSAM PURGE. The PURGE option deletes the data set if it has an expiration date and the expiration date has not expired. The problem here is if the data set does not exist on the volume the catalog entry will not be deleted. Another problem is if the data set is on tape. For both you use DELETE dataset-name NOSCRATCH
  • VSAM - Again you use the IDCAMS DELETE cluster-name CLUSTER PURGE. As with non-VSAM if the components have disappeared you have trouble.
Back to top
View user's profile Send private message
boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Thu Mar 26, 2015 9:38 am
Reply with quote

Thank you for your reply Steve!

The list given is only the datasets to be deleted. If I would complete the list, then I can listcat all the datasets, but still, the GDG will be treated as non-VSAM (or VSAM).

Right now, my plan is to delete all and assume that it's all non-VSAM using IDCAMS. In the SYSPRINT, I'll collect all those return code that are not equal to zero. Then will delete again as a VSAM. But I think, there must be a way much better than this.

After all this, I'll check all of our GDG, if the base doesn't have any generations, then we will delete these too.

I'm just thinking that there might be a utility that I don't know that can solve my problem.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu Mar 26, 2015 1:34 pm
Reply with quote

You might be able to use ADRDSSU to make a backup with scratch to a dummy dataset.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Thu Mar 26, 2015 5:28 pm
Reply with quote

boyti ko wrote:
Thank you for your reply Steve! ...

After all this, I'll check all of our GDG, if the base doesn't have any generations, then we will delete these too. ...
You're welcome.

There is a danger with that idea or the similar idea of deleting any GDG index that has no data sets defined in the index. If the index has data sets defined in it sporadically, then it could be empty, say, Friday morning, and a job could run Friday night or the weekend to allocate a data set in the index. Oops.
Back to top
View user's profile Send private message
boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Fri Mar 27, 2015 6:43 am
Reply with quote

Thanks Prino, i'm still new to ADRDSSU, but have used this one:
Code:
//STEP500  EXEC PGM=ADRDSSU                             
//SYSPRINT DD SYSOUT=*                                 
//PSEUDO   DD DUMMY                                     
//SYSIN    DD  *                                       
     DUMP OUTDD(PSEUDO)                                -
     DS(INCL(                                          -
           XXXXXX.XXXXV.CP10V.AMS900S.#060414.INDEX    -
           XXXXXX.XXXXV.CP10V.BATCHNO.RPS.DATA         -
           XXXXXX.XXXXS.CPD355B.JUL25                  -
           XXXXXX.XXXXG.DU3.LA10V.OASQUEJ.AFH.G0058V00 -
           XXXXXX.XXXXV.GST.CPCFG.MODEL                -
       )    )                                          -
     DELETE PURGE                                       
/*                                                     


This one can delete GDG, SEQDS and VSAM cluster (.index and .data will not be deleted if cluster is not indicated)

Hi Steve,

We're focusing to delete all datasets that were not referenced up to 7 years. I was thinking that if it's an active GDG, then it should have at least one generation. Yearly jobs if it has GDG should have at least one.
But yes, to be on the safe side, then we can skip those GDG base since it wouldn't take that much of space and check for it thoroughly before deleting.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Fri Mar 27, 2015 6:54 pm
Reply with quote

For what it's worth, active GDG bases can have no generations. Some jobs accumulate generations, then are concatenated via the GDG base name, are processed, then are deleted or backed up, then the GDG base is available for the next round of "accumulations".
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 580
Location: London

PostPosted: Thu Apr 23, 2015 10:14 am
Reply with quote

The only issue with the DFDSS (ADRDSSU) approach is that it will not delete any files migrated by DFHSM or any written direct to TAPE.
It also won't delete GDG bases, so while it is a simple approach it may not achieve fully what you want.

Normally you would specify the Cluster name for the VSAM delete and DFDSS would delete that and any related components/AIX/Path if you specify the SPHERE keyword, which is what you probably want anyway.

What you need is a means to identify files unreferenced for 7 years and feed that list through to a standard IDCAMS DELETE. You could look at Naviquest (Batch ISMF), FDREPORT or some other ISV product that can select on the name masks and produce a list of specific files to delete.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts How to delete a user's alias from the... JCL & VSAM 11
Search our Forums:

Back to Top