Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums 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: 6258
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: 8593
Location: Back in jolly old England

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: 6258
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: 6258
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: 8593
Location: Back in jolly old England

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: 6258
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10309
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 Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts Mainframe dataset split purushottam DFSORT/ICETOOL 13 Tue Aug 29, 2017 12:28 pm
No new posts Delete IMS remote transaction when MO... Sam Singh IMS DB/DC 0 Wed Aug 23, 2017 9:12 pm
No new posts Unable to copy data from spool in a d... srikant314 JCL & VSAM 8 Fri Jul 28, 2017 9:10 pm

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