The conditions used in IF statements are basically three types.

  1. Sign
  2. Relation
  3. Complex

IF Sign condition -

IF SIGN condition is used to verify the sign of a particular data item. There are three types sign validation.

  1. POSITIVE
  2. NEGITIVE
  3. ZERO

Sign condition type syntax -

IF	Identifier/data-name IS [NOT] {POSITIVE/NEGATIVE/ZERO}

IF Sign condition - Practical Example:

Code -

IF Conditional Expression

Jcl -

IF Conditional Expression

Output -

IF Conditional Expression

IF Relation condition -

IF Relation condition is used to verify the relation between two identifiers/literals. The below are the IF relational conditions

  1. GREATER THAN
  2. LESS THAN
  3. EQUAL
  4. NOT

Relation condition type syntax -

IF	{Identifier/Literal} IS [NOT] 	{GREATER THAN/
					>/
					LESS THAN/
					=/
					LESS THAN OR EQUAL TO/
					<=}
					{Identifier/Literal}

IF Relation condition - Practical Example:

Code -

IF Conditional Expression

Jcl -

IF Conditional Expression

Output -

IF Conditional Expression

IF Complex condition -

IF complex condition is used to verify the one or more sign or relational types. Complex condition is the combination of conditions by using AND/OR operators .The below are the IF complex conditions

  1. AND
  2. OR

Complex condition type syntax -

IF Condition {AND/OR} Condition

IF Complex condition - Practical Example -

Code -

IF Conditional Expression

Jcl -

IF Conditional Expression

Output -

IF Conditional Expression