The REJECT statement was specially developed for leaving GET event blocks. Unlike CHECK and EXIT, REJECT always refers to the current GET event block. If CHECK and EXIT occur in a loop, they refer to the loop, and in a subroutine, they always refer to the subroutine. The REJECT statement, on the other hand, allows you to exit a GET event block directly from a loop or a called subroutine.
always terminates the processing of the current line of the node of the logical database. Without the optional dbtabspecification, the logical database automatically reads the next line of the same node, and the next GET event at the same hierarchy level is triggered. If you use the optional dbtab specification, the logical database reads the next line of the node dbtab. The node dbtab must occur above the current node in the logical database hierarchy.
The following executable program is connected to the logical database F1S.
NODES: SPFLI, SFLIGHT, SBOOK.
WRITE: / 'Carrid:', SFLIGHT-CARRID,
WRITE: / 'Bookid:', SBOOK-BOOKID.
This program reads and displays only the first booking for each flight, since the logical database reads the next line of SFLIGHT after the REJECT statement.
This produces the following output list: