How to Run BTEQ Batch Jobs under z/OS | Basic Teradata Query - Running Under z/OS - Basic Teradata Query

Basic Teradata® Query Reference - 20.00

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Basic Teradata Query
Release Number
20.00
Published
October 2023
ft:locale
en-US
ft:lastEdition
2025-04-02
dita:mapPath
gxl1691484661681.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
psp1479308573013
Product Category
Teradata Tools and Utilities
Submit BTEQ commands and SQL requests using z/OS in either of two ways:
  • Within a previously created input file
  • As part of the Job Control Language (JCL) program input stream

Sample Procedure

To execute BTEQ z/OS, use the BTEQ JCL procedure TDSBTEQ located in TERADATA.PROCLIB.

Job Card Example

To use a standard z/OS JCL card, submit the BTEQ job, as in the following example:

//YNBTQ   Job 1,'User Name',CLASS=B,Notify=YN,
//            MSGCLASS=A,MSGLEVEL=(1,1)
//BTEQ EXEC PGM=BTQMAIN
//STEPLIB DD DSN=TERADATA.APPLOAD,DISP=SHR
//SYSPRINT DD SYSOUT=*,DCB=(LRECL=137)
//SYSABEND DD SYSOUT=*
//SYSTERM DD SYSOUT=*
//SYSIN DD DATA,DLM=##
Statement Description
//YNBTQ Job 1,'User Name', CLASS=B,Notify=YN,
//          MSGCLASS=A,MSGLEVEL=(1,1)
Identifies the job.
//BTEQ EXEC PGM=BTQMAIN
Identifies and executes the BTEQ program.
//STEPLIB DD DSN=TERADATA.APPLOAD,DISP=SHR
Identifies the client library where BTEQ resides.
//SYSPRINT DD SYSOUT=*,DCB=(LRECL=137)
Defines the output file and executes printing.
//SYSABEND DD SYSOUT=*
Identifies the dump file in case the mainframe-attached system fails.
Always include a SYSABEND or SYSDUMP card to capture a dump if the system fails.
//SYSTERM DD SYSOUT=*
Identifies the standard error file for error messages redirected by the BTEQ ERROROUT command.
//SYSIN DD DATA,DLM=##
Precedes the BTEQ script.
Use DD DATA,DLM=## to indicate the end of the file instead of //SYSIN DD*. The * (asterisk) character is interpreted as the SQL comment indicator.