View previous topic :: View next topic
|
Author |
Message |
anoopn1985
New User
Joined: 23 Apr 2007 Posts: 16 Location: tvm
|
|
|
|
Hi,
I have to delete around 1000 datasets having the similar names. Each dataset name is starting with A.B (A.B.*). How can I delete all datasets with name starts as A.B.*? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
sri_mf
Active User
Joined: 31 Aug 2006 Posts: 218 Location: India
|
|
|
|
anoopn1985 wrote: |
Hi,
I have to delete around 1000 datasets having the similar names. Each dataset name is starting with A.B (A.B.*). How can I delete all datasets with name starts as A.B.*? |
Similar post is answered..pls do search |
|
Back to top |
|
|
anoopn1985
New User
Joined: 23 Apr 2007 Posts: 16 Location: tvm
|
|
|
|
A small change in the question.. My datasets looks like A.B*.*.*
Not like A.B.*.That is datasets like
A.BJan01.ABC.DEF
A.BJan02.ABC.XYZ
A.BJan01.ZZZ.AAA
etc.. That is only the first qualifier and partial part of second qualifier is same. As mentioned inthe above links, I tried with IDCAMS and ADRDSSU. But none of these gave the expected result. If datasets are like A.B.* (Only having 1 qualifier is missing), then IDCAMS is working.
Please help me for getting the desired results.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
One way would be to generate the list of dataset names you want to delete and then create either DD statements or IDCAMS control statements using that list of dsn's as input. |
|
Back to top |
|
|
anoopn1985
New User
Joined: 23 Apr 2007 Posts: 16 Location: tvm
|
|
|
|
Dick,
How to generate the dataset names? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
Back to top |
|
|
yogeshwar_ade
Active User
Joined: 31 Aug 2006 Posts: 103 Location: INDIA
|
|
|
|
anoopn1985 wrote: |
My datasets looks like A.B*.*.*
Not like A.B.*.
|
I hope IDCAMS will work for this. Using 3.4 get all list of datasets having A.B*.*.*, after it save this list. Once you get list, then you can easily DELETE these datasets using IDCAMS.
Ex-
//DELETE EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE A.BXY.ADC.BWZ
Correct me anyone if I am wrong. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
I used the following code and it worked for me.
Code: |
//BACKUP EXEC PGM=ADRDSSU
//SYSPRINT DD SYSOUT=*
//FILTLST DD *
INCLUDE( -
CSDTG1.Y*.*.* -
CSDTG1.H*.*.* -
// DD *
)
//FILEBACK DD DUMMY
//SYSIN DD *
DUMP OUTDD(FILEBACK) -
TOL(ENQF) -
DATASET(FILTERDD(FILTLST)) -
DELETE -
PURGE
//*
//**********************************************************************
|
Gerry |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Yip, Gerry has the easiest answer |
|
Back to top |
|
|
anoopn1985
New User
Joined: 23 Apr 2007 Posts: 16 Location: tvm
|
|
|
|
Thanks Gerry...Thank u very much...It is working fine................. |
|
Back to top |
|
|
|