The following example contains a BLOCKIF construct using several ELSEIF statements with the ELSE statement.
IFTHEN/a>b
d=b
f=a-b $$ End of first block
ELSEIF/a>c
d=c
f=a-c $$ End of the second block
ELSEIF/a>z
d=z
f=a-z $$End of third block
ELSE
d=0
f=a $$ End of fourth block
ENDIF
There are four statement blocks in this example (one for each BLOCKIF statement except ENDIF). If a is greater than b, the first block is executed. If a is not greater than b but is greater than c, the second block is executed. If a is not greater than b or c but is greater than z, the third block is executed. If a is not greater than b, c, or z, the fourth block is executed.