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

Basic Teradata® Query Reference

Product
Basic Teradata Query
Release Number
17.00
Published
December 2020
Language
English (United States)
Last Update
2020-12-12
dita:mapPath
zqt1544831938740.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
B035-2414
lifecycle
previous
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.