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
 
Deleting dataset using JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
smita V

New User


Joined: 05 Nov 2007
Posts: 11
Location: hyderabad

PostPosted: Thu Feb 12, 2009 7:16 pm    Post subject: Deleting dataset using JCL
Reply with quote

Hi,

I want to keep first step in my Job which deletes all the datasets used in that Job. But if some of the datasets are already deleted I dont want the Job to abend.

Please advise me how can I do this. Condition code check and resetting it back to 0 from first step is one option. But is there some other way to do it.

Thanks,
Smita
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: Thu Feb 12, 2009 7:20 pm    Post subject:
Reply with quote

What have you investigated so far ?

Looked at IDCAMS
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Thu Feb 12, 2009 7:21 pm    Post subject: Reply to: Deleting dataset
Reply with quote

I can't figure out how that situation could possibly cause an abend?
Back to top
View user's profile Send private message
smita V

New User


Joined: 05 Nov 2007
Posts: 11
Location: hyderabad

PostPosted: Thu Feb 12, 2009 7:24 pm    Post subject:
Reply with quote

Hi Expat,

I dont want to use IDCAMS, thats why said dont want to reset the return code back to 0.
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: Thu Feb 12, 2009 7:25 pm    Post subject:
Reply with quote

And why, dare I ask, would you not want to use the easiest and most effective method available ?
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Thu Feb 12, 2009 8:40 pm    Post subject:
Reply with quote

Quote:
I dont want to use IDCAMS
What would you like to use? IEFBR14 (or any other program) with Disp=(Mod,Delete,Delete) is available if you want to use it.
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: Thu Feb 12, 2009 8:49 pm    Post subject:
Reply with quote

You don't actually have to do a condition code check with IDCAMS, just code the last line as
Code:
  SET MAXCC EQ 0
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 788
Location: Chennai, India

PostPosted: Thu Feb 12, 2009 9:06 pm    Post subject:
Reply with quote

This is how I've been using.
Code:
//STEP010   EXEC PGM=IDCAMS                         
//SYSPRINT DD  SYSOUT=*                                           
//SYSIN    DD  *                                                 
   DELETE GNANAS.PS.DEL PURGE             
   IF MAXCC GE 9 THEN SET MAXCC = 16                             
   ELSE SET MAXCC = 0                                             
/*
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Feb 12, 2009 10:30 pm    Post subject:
Reply with quote

Hello,

Quote:
Condition code check and resetting it back to 0 from first step is one option
Once the condition code has been set for some step, it cannot be reset. . .

Quote:
I dont want the Job to abend.
I suspect you mean jcl error rather than abend. Using disp=(mod,delete) will prevent the jcl error and will guarantee the existing files are also deleted.

As asked before - why not IDCAMS?
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Mainframe dataset split purushottam DFSORT/ICETOOL 13 Tue Aug 29, 2017 12:28 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