if command (C and C++)
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 an else clause exists, the command associated
with the else clause is performed. The if and else keywords
must be lowercase and cannot be abbreviated.
expression- A valid z/OS® Debugger C and C++ expression.
command- A valid z/OS Debugger command.
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
- An
elseclause should always be included if theifclause causes z/OS Debugger to get more input (for example, anifcontainingUSEor other commands that cause z/OS Debugger to be restarted because anAT-condition occurs). - The
ifcommand cannot be used while you replay recorded statements by using thePLAYBACKcommands by using thePLAYBACKcommand.
Examples
- The following example causes
gradeto receive the value"A"if the value ofscoreis greater than or equal to 90.if (score >= 90) grade = "A"; - The following example shows a nested
ifcommand.if (paygrade == 7) { if (level >= 0 && level <= 8) salary *= 1.05; else salary *= 1.04; } else salary *= 1.06;
