== Why is this an issue?

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

[source,pli]
----
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

[source,pli]
----
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[]

'''
== Implementation Specification
(visible only on this page)

=== Message

Add an "OTHERWISE" to this "SELECT".


'''
== Comments And Links
(visible only on this page)

include::../comments-and-links.adoc[]

endif::env-github,rspecator-view[]
