You might also want to undo a transaction if your business logic detects errors other than database errors. The UNDO statement allows you to undo the current transaction and specify a branching action. This is the syntax for the UNDO statement:
Notice the label syntax. If your block header statements define labels for your blocks, then you can use those labels to control which block gets undone or which block to perform a LEAVE or NEXT branch to. Labels let you control how much of the transaction to undo when you are working with nested blocks.
The remaining
UNDO options will be covered in
TraditionalError Handling