MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Coding a step to process only if prior step abends.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
mi1dzyr
Beginner


Joined: 10 Jul 2003
Posts: 3
Topics: 1
Location: Los Angeles

PostPosted: Thu Jul 10, 2003 2:06 pm    Post subject: Coding a step to process only if prior step abends. Reply with quote

How do you code the COND param so that it only executes the step if the previous step abends (with say a U00004) abend code?
Back to top
View user's profile Send private message
mi1dzyr
Beginner


Joined: 10 Jul 2003
Posts: 3
Topics: 1
Location: Los Angeles

PostPosted: Thu Jul 10, 2003 2:42 pm    Post subject: Reply with quote

I think the simple answer is coding COND=ONLY; however another issue arises:

I'd like to execute a new step that will use IEBGENER to call a PDS member if STEP1 abends. but if you look at the last statement of STEP1 there's an IF STEP1.RC param. How do I get the new step to execute only if STEP1 abends while retaining the IF clause that executes STEP2 if the RC condition is met?

//STEP1 EXEC PGM=COPPER
//STEPLIB DD DSN=MY.IMPLOAD,DISP=SHR
// DD DSN=MY.LOADLIB,DISP=SHR
// DD DISP=SHR,DSN=CUSTOM.LOADLIB
// DD DISP=SHR,DSN=MY.ONL.LOADLIB
// DD DISP=SHR,DSN=MY.CAILIB
//SYSABEND DD SYSOUT=&OUTT
//SYSABOUT DD SYSOUT=&OUTT
//SYSLIST DD SYSOUT=&OUTT
//SYSPRINT DD SYSOUT=&OUTT
//SYSOUT DD SYSOUT=&OUTT
//*
//COPPEROK DD DSN=&&MY430,DISP=(OLD,DELETE,DELETE)
//*
//*=====================================*
//COPPERD0 IF STEP1.RC LE 4 THEN
//*=====================================*
//STEP2 EXEC PGM=GOLD

Very Happy
Back to top
View user's profile Send private message
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Thu Jul 10, 2003 2:43 pm    Post subject: Reply with quote

Hi

I prefer using IF:
Code:
//     IF ABEND THEN
//STEP02 EXEC....
//         ENDIF


O.
________
Suzuki SV1000 history


Last edited by ofer71 on Sat Feb 05, 2011 10:58 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
mi1dzyr
Beginner


Joined: 10 Jul 2003
Posts: 3
Topics: 1
Location: Los Angeles

PostPosted: Thu Jul 10, 2003 2:47 pm    Post subject: Reply with quote

thanks O, I've modified my question abit to suit what I'm really after. There's already an IF being utilized to execute STEP2 if the STEP1.RC LE 4. I want to retain that logic but in addition have a new STEPWARN execute only if STEP1 fails.

Frank.
Back to top
View user's profile Send private message
Mike
Beginner


Joined: 03 Dec 2002
Posts: 114
Topics: 0
Location: Sydney, Australia

PostPosted: Thu Jul 10, 2003 5:40 pm    Post subject: Reply with quote

Here's two possibilities, I've put the warn step immediately after the step it is associated with, if you had more steps then perhaps you'd want the warn step to warn for all of these steps in which case you place it at the end and in the second case with more conditions or perhaps a less specific condition.

//ST01 EXEC PGM=COPPER
//....
//ST01ABND EXEC PGM=WARN,COND=ONLY
// IF ST01.RC LE 4 THEN
//ST02 EXEC PGM=GOLD
......
// ENDIF

or

ST01 EXEC PGM=COPPER
//....
// IF ST01.ABEND THEN
//ST01ABND EXEC PGM=WARN
// ENDIF
// IF ST01.RC LE 4 THEN
//ST02 EXEC PGM=GOLD
.....
// ENDIF
_________________
Regards,
Mike.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group