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

Deleting dataset using JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Thu Feb 12, 2009 7:20 pm
Reply with quote

What have you investigated so far ?

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

Global Moderator


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

PostPosted: Thu Feb 12, 2009 7:21 pm
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
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: 8797
Location: Welsh Wales

PostPosted: Thu Feb 12, 2009 7:25 pm
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
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: 8797
Location: Welsh Wales

PostPosted: Thu Feb 12, 2009 8:49 pm
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: 792
Location: Chennai, India

PostPosted: Thu Feb 12, 2009 9:06 pm
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

Moderator Emeritus


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

PostPosted: Thu Feb 12, 2009 10:30 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
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
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Deleting a Tape file JCL & VSAM 14
Search our Forums:

Back to Top