Running Under z/OS - Basic Teradata Query

Basic Teradata Query Reference

Product
Basic Teradata Query
Release Number
16.00
Published
November 2016
Language
English (United States)
Last Update
2018-04-25
dita:mapPath
hyz1479325149183.ditamap
dita:ditavalPath
Audience_PDF_include.ditaval
dita:id
B035-2414
lifecycle
previous
Product Category
Teradata Tools and Utilities

Submit BTEQ commands and Teradata SQL statements 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 to the Teradata Database, 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
//        DD DSN=TERADATA.TRLOAD,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

//               DD DSN=TERADATA.TRLOAD,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 Teradata SQL comment indicator.