DBCHCL CMD Function - Teradata Tools and Utilities

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

Teradata Tools and Utilities
Release Number
June 2021
English (United States)
Last Update
Product Category
Teradata Tools and Utilities


CMD (Command) issues a TDP command within a CLIv2 program.

This function is used to send the TDP command, specifying a buffer and length that contain the command text.

Usage Notes

  • Use the CMD function to send a TDP command, specifying a buffer and length for the command text.
  • If the Return Code is 0, a pseudo-connection number and a request number are returned.

To process the response, issue a FETch function with the returned pseudo-connection number and request number.

The response data is composed of various parcels in the following order:

  1. A Success parcel with an activity count that indicates the number of subsequent Record parcels
  2. The Record parcels themselves (one Record parcel for each line of command output)
  3. An End Statement parcel
  4. An End Request parcel
    • After the response has been completely processed, the application must invoke the ERQ function to release the fetch buffer used by the CMD.

      Since the application does not establish a connection, no DISCONN function may be used for the pseudo-connection number. Rewind and Abort functions are not supported.

      If the specified response buffer is too small for the entire response, a code of 535 is returned, either as a warning code in the Success parcel or as a return code from the CLIv2 call.

DBCAREA Input Fields

Before using the Command 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 Command Function
DBCAREA Input Fields Optional for the Command Function
Anticipated-number-of-concurrent-sessions Change-options
Character Set Inhibit-buffer-expansion
Length Locate-mode
Maximum-parcel Message-area-length
Message-area-pointer Parcel Mode
Pointer Request Buffer
Request-length Request-mode
Request-pointer Request-processing-option
Response-buffer-length Response-mode
Return-time Set-character-set
Tell-if-delay Request-token
Two-response-buffers Use-presence-bits
Variable-length-fetch Variable-length-request
Wait-during-delay Wait-exclusion

DBCAREA Output Fields

Upon completion of the Command function, CLIv2 will always set DBCAREA fields in the first table and will set those in the second table if the function was successful.

DBCAREA Output Fields always set by the Command Function
Current-response-buffer-length Message-length
Message-return-code Message-text
Message-text-length Output-CLIv2-request-number
Output-CLIv2-connection-number Return Code
DBCAREA Output Fields set by Successful Command Functions
Current-request-buffer-length Open-requests