OTHER (Otherwise Select)

Free-Form Syntax OTHER
Code Factor 1 Factor 2 Result Field Indicators
OTHER            

The OTHER operation begins the sequence of operations to be processed if no WHENxx or WHEN (When True Then Select) condition is satisfied in a SELECT group. The sequence ends with the ENDSL or END operation.

Rules to remember when using the OTHER operation:
  • The OTHER operation is optional in a SELECT group.
  • Only one OTHER operation can be specified in a SELECT group.
  • No WHENxx or WHEN operation can be specified after an OTHER operation in the same SELECT group.
  • The sequence of calculation operations in the OTHER group can be empty; the effect is the same as not specifying an OTHER statement.
  • Within total calculations, the control level entry (positions 7 and 8) can be blank or can contain an L1 through L9 indicator, an LR indicator, or an L0 entry to group the statement within the appropriate section of the program. The control level entry is for documentation purposes only. Conditioning indicator entries (positions 9 through 11) are not allowed.

For more information, see Structured Programming Operations.

Figure 1. OTHER Operation
*...1....+....2....+....3....+....4....+....5....+....6....+....7....+....
CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq....
 *
 * Example of a SELECT group with WHENxx and OTHER.  If X equals 1,
 * do the operations in sequence 1; if X does not equal 1 and Y
 * equals 2, do the operations in sequence 2.  If neither
 * condition is true, do the operations in sequence 3.
 *
C                   SELECT
C     X             WHENEQ    1
 *
 * Sequence 1
 *
C                      :
C                      :
C     Y             WHENEQ    2
 *
 * Sequence 2
 *
C                      :
C                      :
C                   OTHER
 *
 * Sequence 3
 *
C                      :
C                      :
C                   ENDSL