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

Relational-expression field

z/OS MVS JCL Reference

The relational-expression field follows the IF operation field after at least one intervening blank and is followed by at least one blank before the characters THEN. For example, to test that a return code is greater than 4, code:
   //   IF  RC > 4  THEN
You can enclose the relational-expression in parentheses. For example:
   //   IF  (RC > 4)  THEN

A relational-expression indicates the condition that the system evaluates. The result of the evaluation of the relational-expression always depends on two factors: the operation specified, and the values of the operands or expressions that are compared at execution time. The result of evaluating a relational-expression is either true or false.

If you specify a stepname as part of a relational-expression, the system first determines whether the step executed. If the step did not execute, the evaluation of the relational-expression is false.

Continuing a relational expression

You can continue relational-expressions on the next JCL statement. Break the relational-expression where a blank is valid on the current statement, and continue the expression beginning in column 4 through 16 of the next statement. Do not put comments on the statement that you are continuing. You can code comments after you have completed the statement. For example:
   //TESTCON  IF (RC = 8 | RC = 10 | RC = 12 |
   //            RC = 14)  THEN         COMMENTS OK HERE
A relational-expression consists of:
  • Comparison operators
  • Logical operators
  • NOT (¬) operators
  • Relational-expression keywords
  • Numeric values

Go to the previous page Go to the next page

Copyright IBM Corporation 1990, 2014