View previous topic :: View next topic
|
Author |
Message |
ashok4u_it
New User
Joined: 12 Mar 2008 Posts: 53 Location: Chennai
|
|
|
|
Hi,
Is there any JCL to delete unwanted datasets.
Regards
Ashok. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
Well, what's the definition of "unwanted" here? |
|
Back to top |
|
|
Bharath Bhat
Active User
Joined: 20 Mar 2008 Posts: 283 Location: chennai
|
|
|
|
Hi,
You can use IDCAMS to delete the datasets. Please identify "unwanted datasets" and then use an IDCAMS step with a disposition for those datasets as
Code: |
(MOD,DELETE,DELETE) |
Hope this helps. |
|
Back to top |
|
|
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
|
|
|
|
Quote: |
use an IDCAMS step with a disposition for those datasets as
(MOD,DELETE,DELETE) |
why MOD? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Bharath Bhat wrote: |
Hi,
You can use IDCAMS to delete the datasets. Please identify "unwanted datasets" and then use an IDCAMS step with a disposition for those datasets as
Code: |
(MOD,DELETE,DELETE) |
Hope this helps. |
Why on earth would you want to code DD names using IDCAMS ??? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Niither MOD for deleting in DISP nor IDCAMS with DD names I've ever heard of, which mainframe do You work on, please assit.. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
I usually use IEFBR14, not IDCAMS.
The MOD is used to avoid a JCL error if the DSN does not exist going in. MOD allocates the DSN then deletes it at step term. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
IMHO, topic seems to be as if it's an "adhoc" request & not a regular JOB to be sechduled in production, so I thought (OLD,DELETE,DELETE) is better choice (best choice actually, DSN is "unwanted" already, so it must exist; if a DSN doesn't exist how can it be unwanted..) unless I misunderstood.
Personally, I also always used IEFBR14 to DELETE DSNs with DISP OLD. |
|
Back to top |
|
|
chandrashekar suryapet
New User
Joined: 10 May 2008 Posts: 2 Location: pune
|
|
|
|
hey dude,this will work
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DSN=datesetname *give the unwanted dataset name here*
// DISP=(MOD,DELETE,DELETE), |
|
Back to top |
|
|
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
|
|
|
|
once again the same thing.
Quote: |
// DISP=(MOD,DELETE,DELETE), |
anyways, we spent enough time for deleting the datasets... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
That's the joy of IDCAMS - One card per dataset, no need to code DISP to ensure non failure, and you even get the choice to set the RC is there are missing datasets from 8 to whatever
Far more flexible |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Back to the IEFBR14 technique. You can use any JCL step to insert the (mod,delete,delete) datasets, including IDCAMS.
Doesn't make sense in this case, but you can do it.
PS. Another advantage to expat's approach - you get a listing - handy if you misspell one or two. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Agreed, IDCAMS is better choice for the current situation, however, just hoping OP would show up again..grin |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
Back to top |
|
|
|