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
 

 

Delete Multiple PDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Delete Multiple PDS
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

Site Director


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

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

Hello,

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Oct 29, 2012 11:54 pm    Post subject: Reply to: Delete Multiple PDS
Reply with quote

see here for a discussion of ADRDSSU filtering

http://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    Post subject: Reply to: Delete Multiple PDS
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Oct 30, 2012 12:35 am    Post subject: Reply to: Delete Multiple PDS
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    Post subject: Reply to: Delete Multiple PDS
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Oct 30, 2012 12:51 am    Post subject: Reply to: Delete Multiple PDS
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    Post subject: Reply to: Delete Multiple PDS
Reply with quote

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


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

Site Director


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

PostPosted: Tue Oct 30, 2012 1:08 am    Post subject:
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    Post subject: Reply to: Delete Multiple PDS
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: 1703
Location: Australia

PostPosted: Tue Oct 30, 2012 3:32 am    Post subject:
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    Post subject: Reply to: Delete Multiple PDS
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: 1703
Location: Australia

PostPosted: Sat Nov 03, 2012 2:26 pm    Post subject:
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    Post subject:
Reply with quote

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

Active User


Joined: 31 Dec 2009
Posts: 437
Location: London

PostPosted: Mon Nov 05, 2012 9:30 pm    Post subject:
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 User


Joined: 31 Dec 2009
Posts: 437
Location: London

PostPosted: Mon Nov 05, 2012 9:33 pm    Post subject:
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    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 How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm


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