Page 1 of 1

perform cond for the first step in the jcl?

Posted: Mon Mar 11, 2024 6:47 pm
by Neeraj Mehta
Hello Guys,

How we can perform cond for the first step in the jcl ??

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

Posted: Mon Mar 11, 2024 9:18 pm
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.

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

Posted: Tue Mar 19, 2024 10:58 am
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?

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

Posted: Tue Mar 19, 2024 6:35 pm
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.

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

Posted: Wed Mar 27, 2024 12:32 pm
by Neeraj Mehta
Okay, that can be the reason. Thanks Robert for your inputs.