Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Delete the dataset through JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SMS & VSAM
Author Message
gomu_mm

New User


Joined: 05 Dec 2006
Posts: 12
Location: Chennai

PostPosted: Mon May 12, 2008 8:22 pm    Post subject: Delete the dataset 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
References
Moved: Mon May 12, 2008 8:31 pm by superk From DFSORT/ICETOOL to SMS & VSAM
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 3309
Location: Charlotte,NC USA

PostPosted: Mon May 12, 2008 8:34 pm    Post subject: Reply to: Delete the dataset through JCL
Reply with quote

See this previous topic.
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: 3309
Location: Charlotte,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: 666

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: 3551
Location: Brussels once more ...

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: 666

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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SMS & VSAM All times are GMT + 6 Hours
Page 1 of 1