CASE statement
- Last Updated: January 22, 2026
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
The CASE statement provides a multi-branch
decision based on the value of a single expression. You can specify multiple conditions,
each with its own code, and execute the code when a condition is true. Each condition is
defined in a WHEN … THEN section. In addition, you can define an OTHERWISE section to handle any conditions that are not explicitly
defined.
Syntax
|
In the following example code, the CASE
statement is used to assign the yearly quarter based on the month.
|
Running the code produces output similar to the following, depending on the current date:
|