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
 

 

How to delete dataset when previous step abended

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

New User


Joined: 27 Mar 2007
Posts: 15
Location: Chennai

PostPosted: Thu Jan 24, 2008 11:35 am    Post subject: How to delete dataset when previous step abended
Reply with quote

I have to delete the output file whenever my program step gets an abend. But when I tried to do this in the proc using condition parameter as shown below:

Program will run in step PS020

Code:

//PS022    EXEC PGM=PCABEND,                         
//            COND=(0,EQ,PS020),
//            PARM=2010                               
//SYSPRINT DD DUMMY                                   
//DELFILE  DD DSN=&HLQ..&JOB..E.CORCAPT,             
//             DISP=(OLD,DELETE,DELETE)   


Here after the program step PS020 got an abend the remainng steps in the proc are getting flush out and output dataset has not been deleted, which should not happen for my requirement.

Could you please suggest any solution for this?
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Jan 24, 2008 12:18 pm    Post subject:
Reply with quote

Rajesh,

Quote:
Here after the program step PS020 got abend the remainng steps in the proc are getting flush out and output dataset has not been deleted,which should not happen for my requirement.

If you want to delete the o/p files on 'job abend', why dont you code in disp parameter itself?

or

if you need it as seperate step, go thru the jcl 'if/else/endif' (easy option than banging your head with cond parameter).
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 Jan 24, 2008 12:50 pm    Post subject:
Reply with quote

Or read the manual about condition code checking related to abends rather than return codes.
Back to top
View user's profile Send private message
raz832

New User


Joined: 27 Mar 2007
Posts: 15
Location: Chennai

PostPosted: Thu Jan 24, 2008 2:34 pm    Post subject:
Reply with quote

Hi murali,

its working with the disp=(shr,catlg,delete) in the program running step.

Thanks a lot.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Jan 24, 2008 2:37 pm    Post subject:
Reply with quote

Rajesh,

Quote:
disp=(shr,catlg,delete)

Is this a proper disp parameter for an o/p file?
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 JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts How to get previous month in SYMNAMES Suganya87 SYNCSORT 9 Fri Oct 28, 2016 1:37 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


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