There are a number of control statements for logical flow and decision making in the body of the procedure or in a batch.
See ”Control statements” in SQL Anywhere Server - SQL Usage.
For complete descriptions of each, see the entries in Chapter 1, “SQL Statements,” in Reference: Statements and Options.