On an EXEC statement that calls a procedure

The COND parameter on an EXEC statement that calls a cataloged or in-stream procedure (a calling EXEC statement) either overrides or is added to the called EXEC statements.

The COND on the calling EXEC statement overrides the COND on the called EXEC statement. If the called EXEC statement does not have COND coded on it, the COND on the calling EXEC statement will be added to the called EXEC statement.

If an EXEC statement calls a cataloged or in-stream procedure, the COND parameter overrides the COND parameter on or is added to:
  • 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.
  • 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.