%IF command (programming language neutral)

The %IF command lets you conditionally perform a command. You can optionally specify an ELSE clause on the %IF command. If the test expression evaluates to false and the ELSE clause exists, the command associated with the ELSE clause is performed. The keywords cannot be abbreviated.

Read syntax diagramSkip visual syntax diagram%IFconditionTHENcommand ELSEcommand ;
condition
A simple relation condition valid for all supported programming languages.
command
A valid z/OS® Debugger command or a BEGIN-END group containing one or more valid z/OS Debugger commands. The z/OS Debugger commands must be valid for all supported programming languages.

When %IF commands are nested and ELSE clauses are present, a given ELSE is associated with the closest preceding %IF clause within the same block.

Usage notes

  • The IF commands that are specific to a programming language might contain restrictions or usage notes. Those restrictions and usage notes also apply to the %IF command.
  • The variable names used in condition must be syntactically valid for all supported programming languages.
  • If you want to nest %IF commands, you cannot mix them with programming language-specific IF commands.

Refer to the following topics for more information related to the material discussed in this topic.