Interview questions on JCL.

All sort of Mainframes Interview Questions.
Post Reply
Vivek Soni
New Member
Posts: 8
Joined: Sun Aug 17, 2014 8:36 am

Interview questions on JCL.

Post 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.
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Interview questions on JCL.

Post 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.
Regards
Nic
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Interview questions on JCL.

Post 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.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Interview questions on JCL.

Post 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.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Vivek Soni
New Member
Posts: 8
Joined: Sun Aug 17, 2014 8:36 am

Re: Interview questions on JCL.

Post 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. :)
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Interview questions on JCL.

Post by Anuj Dhawan »

You're welcome! :)
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Chandan Yadav
Website Team
Website Team
Posts: 70
Joined: Wed Jul 31, 2013 10:19 pm

Re: Interview questions on JCL.

Post 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
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Interview questions on JCL.

Post 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".
Chandan Yadav
Website Team
Website Team
Posts: 70
Joined: Wed Jul 31, 2013 10:19 pm

Re: Interview questions on JCL.

Post by Chandan Yadav »

Totally agree with you William :good:
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Interview Questions.”