WHEN (When True Then Select)

Free-Form Syntax WHEN{(MR)} indicator-expression
Code Factor 1 Extended Factor 2
WHEN (M/R) indicator-expression

The WHEN operation code is similar to the WHENxx operation code in that it controls the processing of lines in a SELECT operation. It differs in that the condition is specified by a logical expression in the indicator-expression operand. The operations controlled by the WHEN operation are performed when the expression in the indicator-expression operand is true. See Chapter 20. Expressions for details on expressions. For information on how operation extenders M and R are used, see Precision Rules for Numeric Operations.

For more information, see Compare Operations or Structured Programming Operations.

Figure 394. WHEN Operation
CL0N01Factor1+++++++Opcode(E)+Extended-factor2+++++++++++++++++++++++++++..
 *
C                   SELECT
C                   WHEN    *INKA
C                   :
C                   :
C                   :
C                   WHEN    NOT(*IN01) AND (DAY = 'FRIDAY')
C                   :
C                   :
C                   :
C                   WHEN    %SUBST(A:(X+4):3) = 'ABC'
C                   :
C                   :
C                   :
C                   OTHER
C                   :
C                   :
C                   :
C                   ENDSL


[ Top of Page | Previous Page | Next Page | Contents | Index ]