Missing else if in RPG

From Try-AS/400
Revision as of 12:35, 9 February 2019 by PoC (talk | contribs) (New)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

At least in V4R5, IBM has not implemented the well-known else if conditional for multiple branching.

This is easily overcome by SELECT/WHENxx:

C                   […]
C                   SELECT
C     FSTAT         WHENEQ    12
C                   […]
C     FSTAT         WHENEQ    1021
C                   […]
C     FSTAT         WHENEQ    1218
C                   […]
C                   OTHER
C                   [… default handler …]
C                   ENDSL
C                   […]