z/OS TSO/E CLISTs
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Distinguishing WHEN clauses from WHEN commands

z/OS TSO/E CLISTs
SA32-0978-00

The WHEN clause in a SELECT statement is syntactically distinct from the WHEN SYSRC TSO/E command. In a SELECT statement, a left parenthesis must follow a WHEN clause. If you want to use the WHEN command as part of an action in a SELECT statement, enclose the WHEN command in a DO-END sequence to prevent the SELECT statement from interpreting the command as a not valid WHEN clause. For example, the following syntax is acceptable:
SELECT
  WHEN (&X=1) + 
   DO                            /* The action of the WHEN clause      */
    WHEN SYSRC(= 8) TIME         /* is the WHEN SYSRC TSO command.     */
   END                           /* End of the DO group                */
END                              /* End of the SELECT statement        */
For more information about using the WHEN SYSRC TSO/E command, see z/OS TSO/E Command Reference.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014