If every ``++WHEN++`` test of a ``++SELECT++`` statement fails, an ``++ERROR++`` condition is raised if the ``++OTHERWISE++`` statement is omitted. This can lead to the unexpected termination of the program.

== Noncompliant Code Example

----
foo: proc options(main);
  declare i fixed decimal init (42);

  select (i); /* Non-Compliant - SELECT without OTHERWISE statement */
    when (0) put list ('i = 0');
    when (1) put list ('i = 1');
  end;

  put list ('Continuation'); /* This statement will not be executed */
end;
----

== Compliant Solution

----
foo: proc options(main);
  declare i fixed decimal init (42);

  select (i); /* Compliant */
    when (0) put list ('i = 0');
    when (1) put list ('i = 1');
    otherwise; /* No operation */
  end;

  put list ('Continuation'); /* This statement will be executed */
end;
----

include::../see.adoc[]

ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]
