Hi, all
suppose i have 5 steps (S1,S2,S3,S4,S5) what will happen if
cond is true or false (which of the other steps get executed)?
1) //s3 exec pgm=abc,cond=(0,le)
2) //s3 exec pgm=abc,cond=(0,le,step2)
3) In the jobcord RESTART=step3,cond=(0,le)
4) can i code COND=TRUE in jobcard, if yes what will happen?

Answers were Sorted based on User's Feedback



Hi, all suppose i have 5 steps (S1,S2,S3,S4,S5) what will happen if cond is true or false (which o..

Answer / muttaiah

Let me clear you on what is cond and rstart:

Cond: say if you have coded a cond stmt for a step. If the
condition is met then it won't execute. If the condition is
false it will execute the step.

Restart: is used to restart the job from a particular step.
When you are restarting a job from step3 say. Then whatever
the cond parm on step3 it will ignore and it restarts from
step3.

Let me answer the points now.

1) //s3 exec pgm=abc,cond=(0,le)
<ANS> If you code cond=(0,le) then this condition will
check for all previous steps for cond code since 0 is
always less than or equal to return code from previous
steps it will bypass the step S3
2) //s3 exec pgm=abc,cond=(0,le,step2)
<ANS> Similar as answer 1, But here it will look only for
Return code from step step2 only. Even in this case it will
skip the step s3
3) In the jobcord RESTART=step3,cond=(0,le)
<ANS> This will run only step step3 in the job. Coding a
cond in job is like applying it to all steps..
4) can i code COND=TRUE in jobcard, if yes what will happen?
<ANS> We can code only cond as EVEN or ONly or in the
format as (condition,RO,Stepname)
where condition = 0 - 4096
RO = LE, LT, GT, GE, EQ, NE
stepname - step name of the job to look for return code.

Hope this makes sense. Do let me know if you need any
clarifications.

Is This Answer Correct ?    8 Yes 0 No

Hi, all suppose i have 5 steps (S1,S2,S3,S4,S5) what will happen if cond is true or false (which o..

Answer / muttaiah

Nishant,

let me tell you the diff b/w these 2 cond stmts

cond=(RC,RO,stepname) & cond=(RC,RO)

Say when we code the stepname, It will look for the Return
code from that step alone.

Say if i ignore the stepname sub parm, Then what are all
the steps executed before this all those return codes are
checked with the condition specified.

1) //s3 exec pgm=abc,cond=(0,le)
In this question, since they didn't mention the number
of steps coded before s3, s3 looks for what are all the
steps run before this and compares all steps return code
with the cond if the condition is true it will bypass else
it will execute.
2) //s3 exec pgm=abc,cond=(0,le,step2)
Here they have mentioned clearly to the JCL, like look
for only return code from step2..

Hope this clears your doubt. If you have any other doubt.
Please mail me @ mainframe.technology@gmail.com

Is This Answer Correct ?    4 Yes 0 No

Hi, all suppose i have 5 steps (S1,S2,S3,S4,S5) what will happen if cond is true or false (which o..

Answer / nishant singhal

Muttaiah you have explained very well but i have one doubt
here...

for these below 2 questiones

1) //s3 exec pgm=abc,cond=(0,le)
2) //s3 exec pgm=abc,cond=(0,le,step2)

cond=(0,le) should check return code from previous step ie
s2 because if you are not giving any step in your cond
parameter then by default it will check return code from
its previous step and it will work like same as mentioned
in question 2.

Please correct me if i am wrong and let me know how it will
look for all the previous steps ie s1 & s2.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More JCL Interview Questions

How to find out the number of records in a file using JCL

5 Answers   CTS,


what is the resolution for sb37 error

2 Answers   TCS,


My requirement is : How to populate a empty PS/flat file with ONLY spaces in the first line. You should not use any input dataset to do this. I'm not sure whether you may use any utility for this purpose?

2 Answers   HCL,


Max. No of DD statements in a job ?

4 Answers   CSI,


How to print data of sequential file to Spool..?

2 Answers  






What is the error/SOC code if dd names are not sysut1 and sysut2 in IEBGENER?

1 Answers   CTS,


which are the parameters mandatory in job card ?

4 Answers   Accenture,


//step#3 exec pgm = hkbc762 what is wrong with the syntax?

3 Answers  


. What is the difference between the following statements : I) step#1 exec PGM=accpay ii) step#1 exec tbalance

1 Answers  


what is instream data

2 Answers   EDS,


Explain the function of dd disp parameter?

0 Answers  


Why do you want to specify the REGION parameter in a JCL step?

4 Answers   Kekran Mekran, TCS,


Categories