View previous topic :: View next topic
|
Author |
Message |
gomu_mm
New User
Joined: 05 Dec 2006 Posts: 19 Location: Chennai
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
Ramesh.S
New User
Joined: 08 Jan 2007 Posts: 2 Location: chennai
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
you can use IDCAMS
Code: |
//DELETE EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE XL70.STORE.B2150.*
|
Gerry |
|
Back to top |
|
|
piyush_is_here Currently Banned New User
Joined: 28 May 2008 Posts: 2 Location: NOIDA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Yes, of course you can, but MOD was specified for a very good reason. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
cesaralt
New User
Joined: 19 Oct 2009 Posts: 3 Location: LIMA-PERU
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
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
did You test before resurrecting a 4 year old post ? |
|
Back to top |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 592 Location: London
|
|
Back to top |
|
|
quanzhong
New User
Joined: 12 Aug 2008 Posts: 46 Location: china
|
|
|
|
the can do the work
Quote: |
DELETE XL70.STORE.B2150.DATA% MASK |
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 |
|
|
|