Figure B
Detecting no more rows

01 MoreRowsState   Pic 1  Value B"1".

   88 MoreRows            Value B"1".

   88 NoMoreRows          Value B"0".

.

.

.

Evaluate True

  When SqlState = SqlStateOK

    Perform ProcessRow

  When SqlState = SqlStateNoRow

    Set NoMoreRows To True

  When SqlState( 1 : 2 )= SqlStateWrnPfx

    Perform SqlWarning

    Set NoMoreRows To True

  When Other

    Perform SqlError

    Set NoMoreRows To True

End-Evaluate