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

Delete the Datasets through JCL


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

New User


Joined: 05 Dec 2006
Posts: 19
Location: Chennai

PostPosted: Mon May 12, 2008 8:22 pm
Reply with quote

Hi,

I have few datasets like

XL70.STORE.B2150.DATA1
XL70.STORE.B2150.DATA2
XL70.STORE.B2150.DATA3
XL70.STORE.B2150.DATA4

So the last qualifier varies for the datsets. I need to delete these datasets through a JCL.


Please suggest.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Mon May 12, 2008 8:34 pm
Reply with quote

See
JCL to delete unwanted datasets
.
Back to top
View user's profile Send private message
Ramesh.S

New User


Joined: 08 Jan 2007
Posts: 2
Location: chennai

PostPosted: Mon May 12, 2008 8:43 pm
Reply with quote

Me too having the same requirement as like Gomms..

my datasets will be like as follows

NGT.BR5656.DAY1
NGT.BR5656.DAY2
NGT.BR5656.DAY3
NGT.BR5656.DAY4
NGT.BR5656.DAY5
NGT.BR5656.DAY6
NGT.BR5656.DAY7

i want to delete files like NGT.BR5656.DAY1
NGT.**.b*nnnn.*
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Mon May 12, 2008 8:53 pm
Reply with quote

The answer is still the same.

You'll either use a job step with all of the datasets specified with DISP=(MOD,DELETE,DELETE):

Code:

//DELETE EXEC PGM=IEFBR14
//DD1 DSN=XL70.STORE.B2150.DATA1,DISP=(MOD,DELETE,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(0))
//DD2 DSN=XL70.STORE.B2150.DATA2,DISP=(MOD,DELETE,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(0))
//DD3 DSN=XL70.STORE.B2150.DATA3,DISP=(MOD,DELETE,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(0))
//DD4 DSN=XL70.STORE.B2150.DATA4,DISP=(MOD,DELETE,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(0))


or as input to IDCAMS:

Code:

//DELETE EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
  DELETE XL70.STORE.B2150.DATA1
  DELETE XL70.STORE.B2150.DATA2
  DELETE XL70.STORE.B2150.DATA3
  DELETE XL70.STORE.B2150.DATA4
/*


or to ADRDSSU:

Code:

//DELETE  EXEC PGM=ADRDSSU,REGION=0M,PARM='TYPRUN=NORUN'
//SYSPRINT  DD   SYSOUT=*                 
//DELETE    DD   DUMMY                   
//SYSIN     DD   *                       
  DUMP DATASET(INCLUDE(XL70.STORE.B2150.*)) -   
    OUTDD(DELETE) DELETE                 
//*
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue May 13, 2008 6:17 am
Reply with quote

Hi,
you can use IDCAMS
Code:

//DELETE   EXEC PGM=IDCAMS     
//SYSPRINT DD SYSOUT=*         
//SYSIN    DD *               
  DELETE XL70.STORE.B2150.*   



Gerry
Back to top
View user's profile Send private message
piyush_is_here
Currently Banned

New User


Joined: 28 May 2008
Posts: 2
Location: NOIDA

PostPosted: Mon Jun 30, 2008 4:36 pm
Reply with quote

for deleting can we use
OLD istead of MOD...

//DELETE EXEC PGM=IEFBR14
//DD1 DSN=XL70.STORE.B2150.DATA1,DISP=(OLD,DELETE,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(0))

please correct...
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Jun 30, 2008 5:09 pm
Reply with quote

Yes, of course you can, but MOD was specified for a very good reason.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Jun 30, 2008 5:13 pm
Reply with quote

Hi,
if you are going to use DISP=(OLD,DELETE.DELETE) then no need to code UNIT & SPACE parameters.

If the dataset does not exist it will be a JCL error, that's why people opt for the MOD instead of OLD.

IDCAMS is still the best option.


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

New User


Joined: 19 Oct 2009
Posts: 3
Location: LIMA-PERU

PostPosted: Mon May 28, 2012 8:55 pm
Reply with quote

Hi,

When you say DELETE XL70.STORE.B2150.DATA1, you are deleting the RECORDS of that DATASET, but the DATASET still remains Catalogued but with no Recods.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon May 28, 2012 9:04 pm
Reply with quote

Quote:
When you say DELETE XL70.STORE.B2150.DATA1, you are deleting the RECORDS of that DATASET, but the DATASET still remains Catalogued but with no Recods.

please provide evidence icon_cool.gif
did You test before resurrecting a 4 year old post ?
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 580
Location: London

PostPosted: Thu Jun 07, 2012 4:44 pm
Reply with quote

This IDCAMS statement will delete all files that have a single character matching the '%'.

DELETE XL70.STORE.B2150.DATA% MASK

I'd suggest you read this first as there are some limitations to this command:

publib.boulder.ibm.com/infocenter/zos/v1r11/index.jsp?topic=/com.ibm.zos.r11.idak100/amsr11.htm
Back to top
View user's profile Send private message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Tue Jul 10, 2012 10:36 am
Reply with quote

the can do the work
Quote:
DELETE XL70.STORE.B2150.DATA% MASK
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Jul 10, 2012 6:25 pm
Reply with quote

That's what Pete has suggested. And the example from Gerry can also be implemented to it. Said that, the solution from Kevin and expat also give the similar inference, no?
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