Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 4648
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 Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us