WHEN Statement

The WHEN statement can be used to conditionally process an entire ISFPARMS statement (OPTIONS, GROUP, and so on). The WHEN statement specifies one or more conditions which are compared to the current environment. All of the conditions must be true for the statements that follow to be processed.

In processing a WHEN statement, SDSF checks each of the values against the current system. If all values match the current system, the statements that follow the WHEN statement are processed until the next WHEN is encountered, or until the end of the file is reached. If any of the values do not match the current system, the statements that follow the WHEN statement are checked for syntax but not processed, until the next WHEN is encountered.

The WHEN statement cannot be used to conditionally process a single parameter within a statement. For example, use WHEN to conditionally process an entire OPTIONS statement with all of its parameters, not to conditionally process just the TIMEOUT parameter of OPTIONS. This means that if even a few parameters in a statement vary between systems, multiple versions of the statement may be required. (System symbols, described in System symbols, can be used to replace the value for a single parameter.)

Messages logged by the server indicate which initialization statements are being processed.

WHEN and all of its parameters are optional. WHEN with no parameters causes the statements that follow (until the next WHEN) to be selected; this can be used to end a preceding WHEN.

The parameters are in the format keyword(value). The value for value can be any text string, including standard pattern matching characters:
  • *, which represents any string of characters
  • %, which represents any single character.

The SYMBOL keyword lets you specify an expression for the value.