IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JCL to delete unwanted dataset


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ashok4u_it

New User


Joined: 12 Mar 2008
Posts: 53
Location: Chennai

PostPosted: Thu May 08, 2008 9:53 pm
Reply with quote

Hi,

Is there any JCL to delete unwanted datasets.

Regards
Ashok.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Thu May 08, 2008 10:54 pm
Reply with quote

Hi,

Well, what's the definition of "unwanted" here?
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Fri May 09, 2008 1:09 pm
Reply with quote

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
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Fri May 09, 2008 1:26 pm
Reply with quote

Quote:
use an IDCAMS step with a disposition for those datasets as
(MOD,DELETE,DELETE)


why MOD?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri May 09, 2008 2:08 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Fri May 09, 2008 11:54 pm
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat May 10, 2008 12:41 am
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Sat May 10, 2008 5:21 am
Reply with quote

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
View user's profile Send private message
chandrashekar suryapet

New User


Joined: 10 May 2008
Posts: 2
Location: pune

PostPosted: Sat May 10, 2008 10:30 am
Reply with quote

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
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Sat May 10, 2008 11:16 am
Reply with quote

once again the same thing.
Quote:
// DISP=(MOD,DELETE,DELETE),

anyways, we spent enough time for deleting the datasets...
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat May 10, 2008 12:18 pm
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon May 12, 2008 8:43 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Fri May 16, 2008 4:41 pm
Reply with quote

Agreed, IDCAMS is better choice for the current situation, however, just hoping OP would show up again..grin
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri May 16, 2008 4:48 pm
Reply with quote

Quote:
Is there any JCL to delete unwanted datasets.


<something every poster should be forced to read....>

technically correct but useless answer icon_biggrin.gif YES

until the TS defines the meaning of unwanted
anything we can say is just pure speculation
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
Search our Forums:

Back to Top