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

How to Delete a set of datasets with a wildcard ?


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

New User


Joined: 14 Aug 2006
Posts: 45

PostPosted: Wed Jan 31, 2007 8:38 pm
Reply with quote

How can you delete a set of datasets using a wildard?
Example:

If I have the following datasets:

HLVL.XXX.YYY.TEST1
HLVL.XXX.YYY.TEST2
HLVL.XXX.YYY.TEST3.abc
HLVL.XXX.YYY.TEST4
HLVL.XXX.YYY.TEST5
HLVL.XXX.YYY.TEST6.xyz
etc..

and I want to to delete in a bacth jcl job
all datasets that start with:

HLVL.XXX.YYY.T*

Thanks
Back to top
View user's profile Send private message
yianis

New User


Joined: 14 Aug 2006
Posts: 45

PostPosted: Wed Jan 31, 2007 10:24 pm
Reply with quote

found the answer in SMS & VSAM forum...sorry for the post..

ibmmainframes.com/viewtopic.php?t=10190&highlight=adrdssu

Code:
//STEP0010  EXEC PGM=ADRDSSU,REGION=0M,PARM='TYPRUN=NORUN'
//SYSPRINT  DD   SYSOUT=*                 
//DELETE    DD   DUMMY                   
//SYSIN     DD   *                       
  DUMP DATASET(INCLUDE(MYPDS.TEST.*)) -   
    OUTDD(DELETE) DELETE                 
//*
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Jan 31, 2007 10:27 pm
Reply with quote

Just note that you have to use the level down to the node, i.e.

HLVL.TTT.YYY.TEST1.*
HLVL.TTT.YYY.TEST2.*

will work

HLVL.TTT.YYY.TEST*
or
HLVL.TTT.YYY.T*

will not.
Back to top
View user's profile Send private message
dgokulakrishnan

New User


Joined: 01 Jun 2011
Posts: 5
Location: Chennai

PostPosted: Thu Sep 01, 2011 1:13 pm
Reply with quote

Hi Yianis..

Even the below code snippet also deletes the dataset by using the wildcards.

//STEP01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
DELETE HLVL.XXX.YYY.*
/*
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Sep 01, 2011 8:38 pm
Reply with quote

Hello and welcome to the forum,

Please note that it is best to reply to curretly active topics rather than one that is over 4 years inactive. . . icon_wink.gif

d
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 DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts How to delete a user's alias from the... JCL & VSAM 11
No new posts Merging 2 datasets into one DFSORT/ICETOOL 1
No new posts Delete file row if blanks in the firs... DFSORT/ICETOOL 5
Search our Forums:

Back to Top