View previous topic :: View next topic
|
Author |
Message |
paramoberoi
New User
Joined: 26 Oct 2010 Posts: 12 Location: USA
|
|
|
|
Hi
My requirement is to execute a step (STEP03) in a JCL if any step prior to it abends or returns CC > 4.
In order to implement it I coded below JCL:
Code: |
//STEP01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//IMSDUMP DD SYSOUT=*
//SYSIN DD *
SET MAXCC=6
/*
//STEP02 EXEC PGM=IEFBR14
//*
//STEP03 EXEC PGM=IEFBR14,
// COND=(EVEN,(4,GE))
/*
|
and to my surprise I got following output:
Code: |
PROCSTEP RC
STEP01 06
STEP02 00
STEP03 FLUSH |
As per manual
if NO step abends and NO test is satisfied the step should be executed.
Can you please help me understand why didn't STEP03 execute in this case?
I do have workaround for this problem as below but I am curious to understand why does above solution not work.
Code: |
//STEP01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//IMSDUMP DD SYSOUT=*
//SYSIN DD *
SET MAXCC=6
/*
//STEP02 EXEC PGM=IEFBR14,
// COND=(4,LT)
//STEP03 EXEC PGM=IEFBR14,
// COND=(EVEN,(0,EQ,STEP02))
/*
|
Thanks |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
From your link:
Quote: |
Note: When the COND parameter does not name a previous step, the system tests all previous steps. If any test is satisfied, the system bypasses the current step. |
|
|
Back to top |
|
|
paramoberoi
New User
Joined: 26 Oct 2010 Posts: 12 Location: USA
|
|
|
|
ahh.. Thanks for pointing it out.
Regards |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Using IF/THEN/ELSE/ENDIF would be easier to understand than COND for most of us. |
|
Back to top |
|
|
paramoberoi
New User
Joined: 26 Oct 2010 Posts: 12 Location: USA
|
|
|
|
I agree. They are easier to read and understand . In this case required code would have been simply
Code: |
// IF ABEND OR RC > 4 THEN
//STEP03 EXEC PGM=IEFBR14
// ENDIF
|
|
|
Back to top |
|
|
|