TRANSQUERY Function
Returns 1 (true) if the process executing the function is within a transaction boundary; returns 0 (false) if the process is not within a transaction boundary.
Syntax
TRANSQUERY()
Comments
TRANSQUERY checks if the process has executed a TRANSTART statement but no subsequent TRANSEND or TRANSABORT statement.
Examples
IF TRANSQUERY() THEN PRINT "INSIDE" ELSE PRINT "OUTSIDE"
If the process is within a transaction boundary, the statement prints "INSIDE"; otherwise, it prints "OUTSIDE."
TQ = TRANSQUERY()
This statement sets TQ to 1 if the process is within a transaction boundary; otherwise, it sets TQ to 0.