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

Delete Multiple PDS


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

New User


Joined: 20 Nov 2007
Posts: 37
Location: USA

PostPosted: Mon Oct 29, 2012 11:21 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Mon Oct 29, 2012 11:30 pm
Reply with quote

Hello,

You might look into using ADRDSSU/DFDSS. . .
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Mon Oct 29, 2012 11:54 pm
Reply with quote

see here for a discussion of ADRDSSU filtering

www.ibmmainframes.com/viewtopic.php?t=29913&highlight=adrdssu
Back to top
View user's profile Send private message
Santty

New User


Joined: 20 Nov 2007
Posts: 37
Location: USA

PostPosted: Tue Oct 30, 2012 12:23 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Oct 30, 2012 12:35 am
Reply with quote

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
View user's profile Send private message
Santty

New User


Joined: 20 Nov 2007
Posts: 37
Location: USA

PostPosted: Tue Oct 30, 2012 12:43 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Oct 30, 2012 12:51 am
Reply with quote

icon_eek.gif
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
View user's profile Send private message
Santty

New User


Joined: 20 Nov 2007
Posts: 37
Location: USA

PostPosted: Tue Oct 30, 2012 1:04 am
Reply with quote

No Enrico ... i tested it with the parm 'TYPRUN=NORUN' before going live ...


ibmmainframes.com/about6069.html
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Tue Oct 30, 2012 1:08 am
Reply with quote

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
View user's profile Send private message
Santty

New User


Joined: 20 Nov 2007
Posts: 37
Location: USA

PostPosted: Tue Oct 30, 2012 1:22 am
Reply with quote

Yes, you are correct ....
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Oct 30, 2012 3:32 am
Reply with quote

Hi,

search on both IDCAMS and MASK.


It may also assist you.


Gerry
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Nov 02, 2012 10:07 am
Reply with quote

Hi Santty,

Why don't you give .*.* a shot?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Sat Nov 03, 2012 2:26 pm
Reply with quote

Hi Jack,

bad shot icon_smile.gif

It doesn't work.


Gerry
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Nov 04, 2012 2:48 am
Reply with quote

Still, worth a shot. icon_lol.gif
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 590
Location: London

PostPosted: Mon Nov 05, 2012 9:30 pm
Reply with quote

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
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 590
Location: London

PostPosted: Mon Nov 05, 2012 9:33 pm
Reply with quote

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
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 combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts SORT JCL to merge multiple tow into s... DFSORT/ICETOOL 6
No new posts Using Multiple IFTHEN and WHEN condit... SYNCSORT 12
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts DELETE SPUFI DB2 1
Search our Forums:

Back to Top