Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: how to delete datasets without knowing if vsam, gdg or seqds
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 User


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

PostPosted: Thu Mar 26, 2015 9:17 am    Post subject:
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    Post subject:
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

Active Member


Joined: 07 Feb 2009
Posts: 982
Location: Oostende, Belgium

PostPosted: Thu Mar 26, 2015 1:34 pm    Post subject:
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 User


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

PostPosted: Thu Mar 26, 2015 5:28 pm    Post subject:
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    Post subject:
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: 1238
Location: Richfield, MN, USA

PostPosted: Fri Mar 27, 2015 6:54 pm    Post subject:
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 User


Joined: 31 Dec 2009
Posts: 437
Location: London

PostPosted: Thu Apr 23, 2015 10:14 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm
No new posts VSAM define for large file jerryte JCL & VSAM 9 Wed Oct 05, 2016 1:51 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us