Previous Topic: TIME KeywordNext Topic: Keywords for Responding to System Events


WHEN Keyword

The WHEN keyword specifies additional conditions that must be true in order for a rule to take effect.

This keyword has the following format:

WHEN(expression)
expression

This option has the following format:

[operand relational_operator operand] [Boolean_operator operand   relational_operator operand]
operand

Can be a character string, an environmental variable, or both.

relational_operator

Can be any of the following character strings:

EQ--Equal

NE--Not equal

GT--Greater than

GE--Greater than or equal

LT--Less than

LE--Less than or equal

IN--Contains a character string

NOTIN--Does not contain a character string

Boolean_operator

Can be one of the following:

  • AND
  • OR

You can join logical expressions together using the Boolean operators (AND and OR) and nested parentheses. Unquoted blanks that immediately precede or follow operators are not considered text.

Usage Notes:

Example:

The following message indicates that OS39OSTC has terminated abnormally:

IEF4501I OS39OSTC--ABEND=S0C4 U0000 REASON=00000000

The following rule checks the second word and the last two characters of the fifth word in the message before alerting the operator:

MSGID(IEF4501I)
  WHEN(&WORD2 EQ OS39OSTC AND &WORD5(9:10) NE 22),
  COLOR(BRIGHT RED), ALARM(19)

The rule determines whether OS39OSTC has terminated if the second word (&WORD2) of the message is OS39OSTC and the last two digits of the fifth word (&WORD5) are not 22. When these conditions exist, the rule alerts the operator to the problem.