| Author |
Message |
ashok4u_it
New User
Joined: 12 Mar 2008 Posts: 14 Location: Chennai
|
|
|
|
Hi,
Is there any JCL to delete unwanted datasets.
Regards
Ashok. |
|
| Back to top |
|
 |
References
|
Posted: Thu May 08, 2008 9:53 pm Post subject: Re: JCL to delete unwanted dataset |
 |
|
|
 |
Anuj D.
Senior Member
Joined: 22 Apr 2006 Posts: 1123 Location: Phoenix,AZ
|
|
|
|
Hi,
Well, what's the definition of "unwanted" here? |
|
| Back to top |
|
 |
Bharath Bhat
New User
Joined: 20 Mar 2008 Posts: 24 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: 94 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: 2154 Location: Brussels once more ...
|
|
|
|
| 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 D.
Senior Member
Joined: 22 Apr 2006 Posts: 1123 Location: Phoenix,AZ
|
|
|
|
| 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: 1405
|
|
|
|
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 D.
Senior Member
Joined: 22 Apr 2006 Posts: 1123 Location: Phoenix,AZ
|
|
|
|
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: 1 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: 94 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: 2154 Location: Brussels once more ...
|
|
|
|
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 |
|
 |
|
|