You can also determine transaction state using $TLEVEL. %INTRANSACTION only indicates whether a transaction is in progress. $TLEVEL indicates both whether a transaction is in progress and the current number of transaction levels.

Examples

The following embedded SQL example shows how %INTRANSACTION sets SQLCODE: