Show TOC

Finding a Match: CASELocate this document in the navigation structure

Use

The CASE command covers a special case of the multiple case IF command. The CASE command allows a given symbol to be tested against specific values until a matching value is found.

            /: CASE symbol
/: WHEN wert1
:
/: WHEN wert2
:
/: WHEN wertn
:
/: WHEN OTHERS.
:
/: ENDCASE
         

The symbol in the CASE line is formatted. If its value is found in one of the WHEN lines, then the text lines following this WHEN line are printed. If no matching value is found then the text lines enclosed by the WHEN OTHERS line and the ENDCASE command are printed. The WHEN OTHERS command is optional.

Note

As with the IF command, the comparison is always performed on literal values.

  • A CASE command must be terminated by an ENDCASE command.

  • The WHEN OTHERS command is optional.