View previous topic :: View next topic
|
Author |
Message |
Santty
New User
Joined: 20 Nov 2007 Posts: 37 Location: USA
|
|
|
|
Hi,
I need to delete N number of dataset. They are of pattern ABC.DEF.GHI.*
But i have some datasets as below
ABC.DEF.GHI.D1
ABC.DEF.GHI.D2
ABC.DEF.GHI.D1.T1
ABC.DEF.GHI.D1.T2
ABC.DEF.GHI.D2.T1
ABC.DEF.GHI.D2.T2
ABC.DEF.GHI.D2.T3
Need to delete nearly 50k datasets in this combination (ABC.DEF.GHI.*)
If i use delete in IDCAMS
Code: |
Delete ABC.DEF.GHI.*
|
it will delete only the below dataset
ABC.DEF.GHI.D1
ABC.DEF.GHI.D2
but i want to delete all datasets in this combination (ABC.DEF.GHI.*) |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
You might look into using ADRDSSU/DFDSS. . . |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
Back to top |
|
|
Santty
New User
Joined: 20 Nov 2007 Posts: 37 Location: USA
|
|
|
|
Thank you Dick scherrer & Enrico-sorichetti
ADRDSSU works in the same way as IDCAMS
Code: |
//DEL001 EXEC PGM=ADRDSSU
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//CEEDUMP DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//DELETE DD DUMMY
//SYSIN DD *
DUMP DATASET(INCLUDE(ABC.DEF.GHI.*)) -
OUTDD(DELETE) DELETE PURGE
/*
//*
|
it is deleting
ABC.DEF.GHI.D1
ABC.DEF.GHI.D2
and not
ABC.DEF.GHI.D1.T1
ABC.DEF.GHI.D1.T2
ABC.DEF.GHI.D2.T1
ABC.DEF.GHI.D2.T2
ABC.DEF.GHI.D2.T3
I am sorry please let me know if i am missing anything. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
ADRDSSU works in the same way as IDCAMS
|
it does not, we would not have given the suggestion, otherwise
Quote: |
I am sorry please let me know if i am missing anything. |
You missed to understand the manual...
meditate on the difference between * and ** place holders
posting such large quotes from the manuals is a plain waste of resources
more than enough to post a link with the page number.
...
will a moderator with a NON MESSED UP profile please delete the previous post ? |
|
Back to top |
|
|
Santty
New User
Joined: 20 Nov 2007 Posts: 37 Location: USA
|
|
|
|
Thanks a lot Enrico-sorichetti
It works ....
Code: |
//DEL001 EXEC PGM=ADRDSSU
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//CEEDUMP DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//DELETE DD DUMMY
//SYSIN DD *
DUMP DATASET(INCLUDE(ABC.DEF.GHI.**)) -
OUTDD(DELETE) DELETE PURGE
/*
//*
|
Sorry abt the prev post (Huge one tgt of sharing with everyone) .... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
I hope that You tested with a TYPRUN=NORUN
before going live
and read about the BY clause to find out about other filtering constructs |
|
Back to top |
|
|
Santty
New User
Joined: 20 Nov 2007 Posts: 37 Location: USA
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Also (probably way too late for this exercise), in addition to running a NORUN, it is often desirable to create a backup of the data before deleting it. How ugly might things become if someone says Oops - we really need to get some of that back? |
|
Back to top |
|
|
Santty
New User
Joined: 20 Nov 2007 Posts: 37 Location: USA
|
|
|
|
Yes, you are correct .... |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
search on both IDCAMS and MASK.
It may also assist you.
Gerry |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Santty,
Why don't you give .*.* a shot? |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Jack,
bad shot
It doesn't work.
Gerry |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Still, worth a shot. |
|
Back to top |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 590 Location: London
|
|
|
|
You can use the IDCAMS DELETE MASK parameter with the % and/or * masks to delete generic dataset masks if you're at about ZOS1.11 or above.
Look at the IDCAMS manual in the DELETE command and it's MASK parameter |
|
Back to top |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 590 Location: London
|
|
|
|
In z/OS V1R11, DFSMS access method services (IDCAMS) adds a new MASK option to the DELETE command. This option lets you specify many variations of a data set name on a single deletion, using new wild card characters and rules to give more flexibility in selecting the data sets to be deleted.
|Previously, only one data set qualifier could be |replaced by a wild card on a DELETE command. For example: DELETE A.*.C |would delete data sets with A as the first qualifier, any second qualifier, |and C as the third qualifier, such as A.B.C or A.BB.C. With the new |MASK keyword, you can replace multiple qualifiers with wild cards, |and can replace specific characters in a qualifier name with wild |cards as well.
|The MASK keyword treats a single asterisk in the |same way as the generic DELETE command. For example DELETE A.*.C MASK |specifies a data set with A and C as the first and third qualifiers, |and a second qualifier with any set of characters. In addition, the MASK keyword allows two consecutive asterisks to |replace multiple qualifier names. For example, the entry name DELETE |A.**.B MASK means all data set names of two or more levels with A |as the first qualifier, and B as the last qualifier. A.B.** means |all data set names of two or more levels where A is the first qualifier |and B is the second (or last) qualifier. Double asterisks cannot be |part of a qualifier name; they must be preceded or followed by either |a period or a blank character.
|The MASK keyword also accepts percent signs (%) was |wild cards to replace individual characters in the same position. |You can specify from one to eight percent signs in each qualifier. | For example, DELETE A%DE MASK would match a data set named ABDE, |while DELETE A%%D% MASK would match one named ABCDE.
The DELETE MASK command allows only one data set entry-name to be specified. If multiple entry-names are specified, the DELETE request will fail with error messages. If more than 100 data set names are filtered from the wild card notation, AMS only deletes the first 100 data sets identified by the filtering process.
If you do not specify the MASK keyword on the DELETE command, or explicitly specify NOMASK, the previous wild card rules remain in effect (one asterisk can replace one qualifier in a data set name). |
|
Back to top |
|
|
|