Issuing select statements that reference only @variables, @@global variables, and constants on SAP ASE version 16.0 and later in chained mode do not start new transactions.
set chained ON <... Perform some DML or other commands ...> select @@error, @@trancount, @@transtate
In some circumstances, SAP ASE may rollback the active transaction if an error occurs while executing DML or other statements. Use the select statement to check the state of the transaction while the server is in chained mode, and—without automatically starting a new transaction—collect the date and time the error occurred that triggered the rollback.