Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
JCL to delete unwanted dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: JCL to delete unwanted dataset
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

Senior Member


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

PostPosted: Thu May 08, 2008 10:54 pm    Post subject:
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    Post subject:
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    Post subject:
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: 8784
Location: Welsh Wales

PostPosted: Fri May 09, 2008 2:08 pm    Post subject:
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

Senior Member


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

PostPosted: Fri May 09, 2008 11:54 pm    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Sat May 10, 2008 5:21 am    Post subject:
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    Post subject: Reply to: JCL to delete unwanted dataset
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    Post subject:
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: 8784
Location: Welsh Wales

PostPosted: Sat May 10, 2008 12:18 pm    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Fri May 16, 2008 4:41 pm    Post subject:
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

Senior Member


Joined: 14 Mar 2007
Posts: 10619
Location: italy

PostPosted: Fri May 16, 2008 4:48 pm    Post subject: Reply to: JCL to delete unwanted dataset
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts TSO TEST writing to dataset Harold Barnes IBM Tools 3 Sat Aug 03, 2019 3:02 am
No new posts Unable to delete dataset - VSAM datas... netcrawler JCL & VSAM 20 Fri Jul 26, 2019 2:06 pm
No new posts Placement of an LPALIB dataset for IPL Alan Playford JCL & VSAM 3 Sun May 12, 2019 5:50 pm
No new posts Need to strip off first line - ascii ... harisukumaran DFSORT/ICETOOL 7 Thu May 02, 2019 12:35 am
No new posts Unpack 'PACK ON' dataset via job? Auryn TSO/ISPF 2 Thu Mar 14, 2019 4:09 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us