16.20 - DBCHCL DSC Function - Teradata Tools and Utilities

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

Teradata Tools and Utilities
September 2019
Programming Reference


DSC (Disconnect) logs a session off the Teradata Database.

Usage Notes

  • Check the Return Code; if zero, the disconnect was successfully completed.
    • If the session has a pending request, a return code of 336 (request may be aborted) is returned to the application. The session is still logged off but the response is lost.
    • If there is an active transaction at the time of the DSC, the Teradata Database rolls back all work performed within that transaction prior to completing the logoff.
  • DSC should be used to clean up session context even if the connect was not successful (initial or final status).
  • In Two-phase commit mode, Disconnect ensures that the current session is aborted at syncpoint if the session has performed any uncommitted Teradata SQL requests.

DBCAREA Input Fields

Before using the Disconnect function, the application must set the DBCAREA fields in the first table and may optionally set those in the second table depending on the application's requirements.

DBCAREA Input Fields Required for the Disconnect Function
Function Input-CLIv2-connection-number
DBCAREA Input Fields Optional for the Disconnect Function
Message-area-length Message-area-pointer

DBCAREA Output Fields

Upon completion of the Disconnect function, CLIv2 will always set DBCAREA fields in the table.

DBCAREA Output Fields always set by the Disconnect Function
Message-return-code Message-length
Message-text Message-text-length