IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

COND Parameters in STeps


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Newton

New User


Joined: 28 Jul 2006
Posts: 7
Location: Hartford

PostPosted: Wed Aug 23, 2006 7:07 pm
Reply with quote

I have a following condition

//STEP1 EXEC=XXX.
//....
//.....
//STEP2 EXEC=YYY,Cond=(12,NE,STEP1)
//...
//...
//STEP3 EXEC=AAA,Cond=(0,NE,STEP1)
//...
//...
//STEP4 EXEC=BBB,Cond=(0,NE,STEP3)


If STEP1 is giving RC as 12, STEP2 will execute and STEP3 is depend on STEP1 so this step (STEP3) will be FLUSH, but STEP4 is dependend on STEP3,
Will STEP4 execute or FLUSH?
As per my understanding all step following STEP2 should FLUSH, but practically this is not happening...

Does any one know why this is happening?
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Wed Aug 23, 2006 9:36 pm
Reply with quote

Quote:

//STEP1 EXEC=TTT.
//....
//.....
//STEP2 EXEC=YYY,Cond=(12,NE,STEP1)
//...
//...
//STEP3 EXEC=AAA,Cond=(0,NE,STEP1)
//...
//...
//STEP4 EXEC=BBB,Cond=(0,NE,STEP3)


STEP4 will execute in this condition. The unexecuted STEP3 gives a defaut RC of 0000. There was no error condition associated with STEP3.

If you want STEP4 to not execute if STEP1 or STEP3 have RC=0000 you need to code

//STEP1 EXEC=TTT.
//....
//.....
//STEP2 EXEC=YYY,Cond=(12,NE,STEP1)
//...
//...
//STEP3 EXEC=AAA,Cond=(0,NE,STEP1)
//...
//...
//STEP4 EXEC=BBB,Cond=((0,NE,STEP3),(0,NE.STEP1))

Dave
Back to top
View user's profile Send private message
crrindia

Active User


Joined: 02 Jul 2005
Posts: 124
Location: Gurgaon

PostPosted: Thu Aug 24, 2006 1:56 pm
Reply with quote

Hi All, can you pleae let me know what is FLUSH ?

Thanks!
Rathna.
Back to top
View user's profile Send private message
stly
Warnings : 1

New User


Joined: 25 Jul 2005
Posts: 93

PostPosted: Fri Aug 25, 2006 5:31 pm
Reply with quote

Hi David i tried this code,
Code:
               
//*                                                   
//STEP01   EXEC PGM=IEFBR14                           
//DD01     DD  DSN=A027104.TEMP.FILE4,               
//             DISP=(MOD,DELETE,DELETE),             
//             SPACE=(TRK,1),UNIT=SYSDA,             
//             DCB=(DSCB1,RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSOUT   DD  SYSOUT=*                               
//*                                                   
//STEP02   EXEC PGM=IEFBR14,COND=(4,GE,STEP01)       
//DD02     DD  DSN=A027104.TEMP.FILE2,               
//             DISP=(MOD,CATLG,DELETE),               
//             SPACE=(TRK,1),UNIT=SYSDA,             
//             DCB=(DSCB1,RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSOUT   DD  SYSOUT=*                               
//*                                                   
// IF STEP02.RC=0 THEN                                 
//STEP02A  EXEC PGM=IEFBR14                           
//SYSIN    DD  DUMMY                                   
//SYSOUT   DD  SYSOUT=*                               
// ELSE                                               
//STEP02B  EXEC PGM=IEFBR14                           
//SYSIN    DD  DUMMY                                   
//SYSOUT   DD  SYSOUT=*                               
// ENDIF                                               
//*                                                   
//STEP03   EXEC PGM=IEFBR14,COND=(0,NE,STEP02)         
//DD02     DD  DSN=A027104.TEMP.FILE5,                 
//             DISP=(MOD,CATLG,DELETE),               
//             SPACE=(TRK,1),UNIT=SYSDA,               
//             DCB=(DSCB1,RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSOUT   DD  SYSOUT=*                               
//*                                                   
//                                                     


This is my joblog


Step_Name Program Code
001 STEP01 IEFBR14 00
002 STEP02 IEFBR14 N/A
003 STEP02A IEFBR14 N/A
004 STEP02B IEFBR14 00
005 STEP03 IEFBR14 00

so what will be RC returned by step02.The above joblog shows that it will not have zero.then wat will be the value it will possess if that step2 is not executed.
Back to top
View user's profile Send private message
neoconvoy

New User


Joined: 22 Jul 2006
Posts: 9

PostPosted: Sun Aug 27, 2006 1:09 pm
Reply with quote

I guess this should answer some questions, ripped from the IBM manuals:
Quote:
Purpose

Use the COND parameter to test return codes from previous job steps and determine whether to bypass this job step. You can specify one or more tests on the COND parameter, and you can test return codes from particular job steps or from every job step that has completed processing. If any of the test conditions are satisfied, the system evaluates the COND parameter as true and bypasses the job step. If none of the test conditions specified on the COND parameter are satisfied, the system evaluates the COND parameter as false and executes the job step.

The system performs the COND parameter tests against return codes from the current execution of the job. If a test specifies a previous step that was bypassed, the system evaluates the COND parameter as false.

Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Passing Parameters to Programs Invoke... PL/I & Assembler 5
No new posts CA7 deleting files in steps after job... CA Products 4
No new posts Injecting HTTPHEADER parameters in th... PL/I & Assembler 0
No new posts Reference for COND parameter. JCL & VSAM 1
Search our Forums:

Back to Top