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 the datasets through JCL

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

Moderator Team Head


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

PostPosted: Mon May 12, 2008 8:34 pm    Post subject: Reply to: Delete the dataset through JCL
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    Post subject: Reply to: Delete the dataset through JCL
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

Moderator Team Head


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

PostPosted: Mon May 12, 2008 8:53 pm    Post subject: Reply to: Delete the dataset through JCL
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: 1703
Location: Australia

PostPosted: Tue May 13, 2008 6:17 am    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Jun 30, 2008 5:09 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Mon Jun 30, 2008 5:13 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Mon May 28, 2012 9:04 pm    Post subject: Reply to: Delete the dataset through JCL
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 User


Joined: 31 Dec 2009
Posts: 440
Location: London

PostPosted: Thu Jun 07, 2012 4:44 pm    Post subject:
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:

http://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    Post subject:
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

Senior Member


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

PostPosted: Tue Jul 10, 2012 6:25 pm    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts DUMP DATASETS VS TRACE DATASETS! lind sh CICS 4 Tue Dec 06, 2016 11:31 pm
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


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