Page 1 of 1

Interview questions on JCL.

Posted: Tue Oct 13, 2015 2:49 pm
by Vivek Soni
Hi,

Following questions I'dlike to verify:

1. In a JCL, if COND=(0,LE) is specified on the first step of JCL, what will happen?

My answer was, "For first step if COND is specified, it will always be false and first step executes unless there is a restart istruction" .

2. In a JCL we have 6 steps: S1, S2, S3, S4, S5 and S6 in the order mentioned. How or can we change the execution order of the steps, like excute S4 after S5?

My answer was to run two seperate jobs.

Can you please help if the answers are correct? And if they are not correct, what is the right answer.

Re: Interview questions on JCL.

Posted: Tue Oct 13, 2015 5:21 pm
by nicc
For Q1:
what is the right answer.
Why not read up in the JCL manual (and post the result of your research)?
For Q2:
Yes, you cannot hop backwards and forwards in a job so you have to edit the JCL - copy it and cut out the unwanted stuff and re-arrange the steps and do an initial run with TYPRUN=SCAN or an initial step with PGM=NOTFOUND. Note that you can only reverse the steps if they are independent of each other i.e step 5 does not require data from step 4.

Re: Interview questions on JCL.

Posted: Wed Oct 14, 2015 11:15 am
by Anuj Dhawan
Vivek Soni wrote:2. In a JCL we have 6 steps: S1, S2, S3, S4, S5 and S6 in the order mentioned. How or can we change the execution order of the steps, like excute S4 after S5?

My answer was to run two seperate jobs.
You answer is one of the possible answers. You can also use IEBEDIT or open the job in VIEW mode, do your edits and SUBmit it.

Re: Interview questions on JCL.

Posted: Wed Oct 14, 2015 11:38 am
by Anuj Dhawan
Vivek Soni wrote:1. In a JCL, if COND=(0,LE) is specified on the first step of JCL, what will happen?

My answer was, "For first step if COND is specified, it will always be false and first step executes unless there is a restart istruction" .
By rule, COND skips a step when the condition specified in the COND becomes true. As this is the first step, COND will have no effect as there is no previous step to check the return code with and the step gets executed; tough it'll be checked for the syntax. So your answer is correct.

Re: Interview questions on JCL.

Posted: Fri Mar 18, 2016 5:06 pm
by Vivek Soni
Anuj Dhawan wrote:
Vivek Soni wrote:1. In a JCL, if COND=(0,LE) is specified on the first step of JCL, what will happen?

My answer was, "For first step if COND is specified, it will always be false and first step executes unless there is a restart istruction" .
By rule, COND skips a step when the condition specified in the COND becomes true. As this is the first step, COND will have no effect as there is no previous step to check the return code with and the step gets executed; tough it'll be checked for the syntax. So your answer is correct.
Thanks, nicely explained. :)

Re: Interview questions on JCL.

Posted: Mon Mar 21, 2016 12:39 pm
by Anuj Dhawan
You're welcome! :)

Re: Interview questions on JCL.

Posted: Tue Mar 22, 2016 11:47 am
by Chandan Yadav
By Any chance if interviewer asks how to bypass very first step in JCL using COND parameter , answer is use COND=ONLY :)

Thanks,
Chandan

Re: Interview questions on JCL.

Posted: Tue Mar 22, 2016 1:27 pm
by William Collins
Don't make use of that. The behaviour is not documented, and could change at any future release of z/OS. That's a more important part of the answer than anything else. Yes, for winning bets. No for anything "useful".

Re: Interview questions on JCL.

Posted: Tue Mar 22, 2016 2:01 pm
by Chandan Yadav
Totally agree with you William :good: