If your exit sets EXRET = E, a U3107 abend is issued in batch. In CICS®, the transaction abend code is 3107.
In both cases, a formatted SQL error message is produced if EXSQLCA is set to the address of the SQLCA in your exit.