16.20 - Session-status - Teradata Tools and Utilities

Teradata® Call-Level Interface Version 2 Reference for Mainframe-Attached Systems

Teradata Tools and Utilities
September 2019
Programming Reference

Session-status is a one byte field that designates the state of the session.

In this language... The variable name for Session-status is...
C, C++ sess_status
IBM Assembler DBCOFLG1
This routine... Does this for Session-status...
DBCHINI writes
DBCHCL writes (FET)
Session-status is used by... To...
applications read.

DBCHCL places Session-status in the DBCAREA when the Fetch function initiates. If Wait-for-response is set to N, Session-status is available at the completion of the request.

There are four flags in Session-status:

Flag Name Description
Pool session This bit is set by FET at Connect completion.
Set bit X‘80‘ to this... If the session was...
1 assigned from a session pool.
0 not assigned from a session pool.
In transaction Set bit X‘40‘ to this... If the session...
1 had a transaction in progress when the bit was set.
0 did not have a transaction in progress when the bit was set.
Cleanup needed Set bit X‘20‘ to this... If the default database...
1 has changed or if there are still spool files.
0 has not changed or if there are not still spool files.
In-Doubt Set bit X‘10‘ to this... If a Two-phase commit session is...
1 in doubt.
0 not in doubt.
The In transaction and Cleanup needed flags are dependent on timing.

A fetch is a request-level operation and the flag is a session-level report. Therefore, the current session state may be changed by a subsequent request.