Posted: Tue Jun 20, 2006 4:59 am Post subject: Condition checking in JCL
Hello,
I have the following problem.
In a Proc PROCA there are 10 steps.This proc is called by 5 different Jcls
by passing a parameter to the proc PROCA.Based on this parameter only one step among the first five steps should be executed and all the steps starting from step 6 should be executed for a given JCL.
How to check the content of a parameter inside a PROC?
EX:
Inside JCLA:
//KKKK EXEC PROCA,prov=EP000
=================
Inside the proc:
//PROCA prov=some default value
//*Now, if prov=EP000,then step1 should be executed ENDIF
//*IF prov=CAP00,then step 2 should be executed ENDIF
//*IF prov=BAP00,then step 5 should be executed ENDIF
//*remaining steps in the proc starting from STEP6.
The first step of the PROC needs to be a program that is passed the value of the parameter PROV, interrogates its value, and sets the RETURN-CODE for that step as a result (probably using a value of 1 to 5).
The other steps can than check for the RETURN-CODE value from STEP1
Code:
////PROCA PROV=some default value
//PS01 EXEC PROG1,PARM='&PROV'
//*
// IF (PS01.RC = 1) THEN PROV=EP000
//PS02 EXEC PROG2
// ENDIF
//*
// IF (PS01.RC = 2) THEN PROV=CAP000
//PS03 EXEC PROG3
// ENDIF
//*
...
// IF (PS01.RC = 5) THEN PROV=BAP000
//PS05 EXEC PROG5
// ENDIF
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Tue Jun 20, 2006 7:33 am Post subject:
Thrivikram,
Introduce another symbolic parameter named stp in your proc. So every time you pass the symbolic value to PROV, pass the value to STP the step no you want to process. for ex: if you are passing a value of EP000, and you want to run step1 only then pass a value of '1' to the symbolic STP. we use that symbolic in the IF clause and run the desired step. Run this JCL and see how it works.
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