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 Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 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


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