Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

JCL & VSAM :: RE: COND parameter vs IF THEN ELSE

$
0
0
Author: Robert Sample
Posted: Fri Jun 17, 2016 8:42 pm (GMT 5.5)

When you start mixing COND with EXEC of PROC as well as programs, you have to expect the unexpected. I suspect what you are seeing is based on this quote from the JCL Reference manual (emphasis added by me):
Quote:
If an EXEC statement calls a cataloged or in-stream procedure, the COND
parameter overrides the COND parameter on or is added to:
v
The EXEC statement named in the procstepname qualifier, which is to the left of
the equals sign. The parameter applies only to the named procedure step. The
EXEC statement can have as many COND.procstepname parameters as the
procedure has steps; each COND parameter must specify a unique
procstepname.
v
All EXEC statements in the procedure if procstepname is not coded. Then the
parameter applies to this job step and to all steps in the called procedure.
Since you apply the COND to the PROC execute without qualifying it, the (0,NE,JS005) is overriding the step-specific COND=(5,GT,CDRBATCH). And using the same name for one of the steps of the PROC as well as the PROC name is a really bad coding practice.
_________________
TANSTAAFL

The first rule of code reuse is that the code needs to be worth re-using.

"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." -- Donald Knuth


Viewing all articles
Browse latest Browse all 8500

Trending Articles