You can use COMMIT, ROLLBACK TO SAVEPOINT and ROLLBACK ... These statements are NOT permitted within ATOMIC blocks ...
On mainframes, you have a COMMIT ON RETURN statement
On LUW, you can use an UNDO handler(provided the compound stmt is declared as ATOMIC) to rollback changes that were done within the compound statement
Visit the new-look IDUG Website , register to gain access to the excellent content.