Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
SELECT statement z/OS DFSMSdfp Storage Administration SC23-6860-01 |
|
Use the SELECT statement to write conditional statements in sequential form rather than IF-THEN-ELSE form. A SELECT statement consists of a SELECT keyword, one or more WHEN clauses, an optional OTHERWISE clause, and an END statement. You can specify the SELECT statement in one of two forms. In the first form shown below, you include the variable being tested after the SELECT statement. In the second form shown below, you include the variable being tested after the WHEN keyword. The first true WHEN condition is executed, and the remaining WHEN
conditions are ignored. If none of the WHEN conditions is true and
there is an OTHERWISE clause, then the OTHERWISE action is taken.
where:
SELECT WHEN (relational
expression) <action> .
. .
<WHEN (relational expression) <action>>
Figure 1 shows an example of coding a SELECT statement: Figure 1. Example of a SELECT
Statement
|
Copyright IBM Corporation 1990, 2014
|