perform cond for the first step in the jcl?

All sort of Mainframes Interview Questions.
Post Reply
Neeraj Mehta
Registered Member
Posts: 16
Joined: Sat Oct 04, 2014 9:36 am
India

perform cond for the first step in the jcl?

Post by Neeraj Mehta »

Hello Guys,

How we can perform cond for the first step in the jcl ??
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: perform cond for the first step in the jcl?

Post by Robert Sample »

From the z/OS 3.1 MVS JCL Reference manual:
Location in the JCL
You can specify the COND parameter on any EXEC statement in the job. However, the system evaluates a COND parameter on the first EXEC statement in a job as false.
Neeraj Mehta
Registered Member
Posts: 16
Joined: Sat Oct 04, 2014 9:36 am
India

Re: perform cond for the first step in the jcl?

Post by Neeraj Mehta »

Thanks Robert.

I also answered the same in the interview, but I said that if it's the first step, why do you want to check it with COND, as a first step it should just get executed else make it some other step. But I think it was not liked that much. And as manual says, if it is the first step, it will always be false, why not make a rule not to code it at first EXEC?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: perform cond for the first step in the jcl?

Post by Robert Sample »

Probably because then there would have to be special logic for the first step as opposed to all the other steps.  It's easier to just evaluate the first step COND as false.
Neeraj Mehta
Registered Member
Posts: 16
Joined: Sat Oct 04, 2014 9:36 am
India

Re: perform cond for the first step in the jcl?

Post by Neeraj Mehta »

Okay, that can be the reason. Thanks Robert for your inputs.
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.”