IF-THEN-ELSE Command Sequence. IBM z/OS Version 2 Release 3
Werbung
Werbung
IF-THEN-ELSE Command Sequence
The syntax of the IF-THEN-ELSE command sequence, which controls command execution, is:
Command
IF
Parameters
{LASTCC|MAXCC}
operator number
THEN[
command|
DO
command set
END]
[ELSE[
command|
DO
command set
END]]
where:
IF
States that one or more functional commands should run based on a test of a condition code. A SET command sets the condition code, or the condition code reflects the completion status of previous functional commands.
Nested IF commands
: When an IF command appears within a THEN or ELSE
clause, it is called a nested IF command. See “Using Nested IF Commands:
v The maximum level of nesting allowed is 10, starting with the first IF.
v Within a nest of IF commands: v The innermost ELSE clause is associated with the innermost THEN clause, v The next innermost ELSE clause with the next innermost THEN clause, and so on. (Each ELSE is matched with the nearest preceding unmatched THEN.) v If there is an IF command that does not require an ELSE clause, follow the
THEN clause with a null ELSE clause (ELSE) unless the nesting structure does not require one.
LASTCC
LASTCC specifies that the condition code resulting from the preceding function command be compared, as indicated by the operator, to the number that follows the operator to determine if the THEN action is to be done.
MAXCC
MAXCC specifies that the maximum condition code value established by any previous function command or by a SET command be compared, as indicated by the operator, to the number following the operator to determine if the THEN action is to be done.
operator
operator requires a comparison to be made between the variable and number.
There are six possible comparisons:
Equal to, written as = or EQ
Not equal to, written as ¬= or NE
Greater than, written as > or GT
Less than, written as < or LT
Greater than or equal to, written as >= or GE
Less than or equal to, written as <= or LE
18
z/OS DFSMS Access Method Services Commands
Herunterladen
Werbung