z/OS MVS JCL Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Considerations when using the IF/THEN/ELSE/ENDIF construct

z/OS MVS JCL Reference
SA23-1385-00

Be aware of the following considerations when using the IF/THEN/ELSE/ENDIF statement construct:
  • The IF/THEN/ELSE/ENDIF statement construct does not conditionally control the processing of JCL; rather, it conditionally controls the execution of job steps.
  • The result of processing an IF/THEN/ELSE/ENDIF statement construct, once determined, remains unchanged regardless of the outcome from running any remaining steps in a job. The system does not reexamine the original condition at any later job step termination, either normal or abnormal. See Example 9.
  • The system allocates all DD statements defined to a step if the execution time evaluation of the relational-expression determines that a step is to be executed.
  • All data sets defined on DD statements in the job must be available at the time the job is selected for execution.
  • You can nest IF/THEN/ELSE/ENDIF statement constructs up to a maximum of 15 levels.
  • You can specify symbolic parameters on IF/THEN/ELSE/ENDIF statements provided that they resolve to one of the supported relational-expression keywords. Any other symbolic parameters, even if accepted by the system, are not intended or supported. Refer to Relational-expression keywords.
  • An IF statement specified before the first EXEC statement in a job is not evaluated before the first step executes. If the IF statement applies to later steps in the job, the statement will be evaluated when the system decides whether to process the later steps.
  • When you specify an IF statement before the first EXEC statement in a job and the job contains a JOBLIB DD statement, the maximum limit for the number of steps in the job is 254 steps.

There are additional considerations related to errors that prevent execution of the THEN or ELSE clause, no matter what is specified on the IF statement, and there are special considerations related to restarted jobs.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014