Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Using SELECT with a test expression (compound SELECT) z/OS TSO/E CLISTs SA32-0978-00 |
|
If you include a test expression on the SELECT statement, the CLIST compares the test expression to the expressions on the WHEN clauses. On each WHEN clause, you can specify multiple expressions, or a range of values by using a colon (:) between the low and high values in the range. You can combine expressions and ranges on a WHEN clause by using the operator OR or |. If a test expression matches a value or falls within a range of values in a WHEN expression, the CLIST executes the action for that WHEN clause, then passes control to the END statement. For example, in the following SELECT statement, the CLIST executes
the action of the first WHEN clause because the test expression (5)
falls within the range of values 4:6 on that WHEN clause:
If no WHEN expressions satisfy the test expression, the CLIST executes the OTHERWISE action, if any. For example, the following CLIST uses a SELECT statement to invoke
other CLISTs that print quarterly reports. The CLIST bases its selection
on a test expression (the number of the month) that the invoker supplies.
When the number of the month falls within a certain range, the CLIST
prints the appropriate report. Otherwise, the CLIST writes an error
message.
|
Copyright IBM Corporation 1990, 2014
|