DBCHCLN - Teradata Tools and Utilities

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

Product
Teradata Tools and Utilities
Release Number
16.20
Published
September 2019
Language
English (United States)
Last Update
2019-10-12
dita:mapPath
dsu1527114222346.ditamap
dita:ditavalPath
dsu1527114222346.ditaval
dita:id
B035-2417
lifecycle
previous
Product Category
Teradata Tools and Utilities

Purpose

Logs off all sessions and free all internal memory and context information allocated by CLIv2.

The alternate six-character name for DBCHCLN is DBCHCN.

Interface

This routine is called with the following parameters, stylistically presented (the actual syntax varies according to the programming language being used):

DBCHCLN(ReturnCode,ContextArea)

In high-level languages, the details of the parameter list are handled by the compiler. For Assembler, the parameter list consists of contiguous 4 byte entries, each containing the 31 bit address of a parameter. The last address has the first bit set to one to indicate the end of the list.

The parameters for this routine are:

Argument Content
ReturnCode A 4 byte unsigned integer field into which the return code will be placed by CLIv2.
ContextArea A 4 byte unsigned integer field for internal use by CLIv2.

Usage Notes

  • The application invokes the DBCHCLN routine when all processing requiring interfacing with the Teradata Database is complete.
  • DBCHCLN does the following:
    • logs off any idle sessions
    • awaits completion of any active sessions and then logs them off
    • frees all internal memory and context information allocated by CLIv2.
  • DBCHCLN deallocates internal data structures that were allocated by DBCHINI.
  • DBCHCLN returns control to the application after all sessions have been logged off and all internal context has been cleaned up.
  • After control returns from DBCHCLN, the variable contains a code whose value represents success or failure to clean up.

    A return code of zero indicates success.

    A nonzero return code indicates failure, and the value specifies the reason for the failure.

    After the call, the return code variable will contain a return code.

  • After the call, CLIv2 changes ContextArea for its own purposes.
  • The call to DBCHCLN does not deallocate the DBCAREA.

    The application may itself deallocate the DBCAREA if the programming language provides that ability.

  • Termination of the application has the same effect as DBCHCLN, but it is good programming practice to call DBCHCLN for cleanup.