Running Under z/OS

Basic Teradata Query Reference

brand
Teradata Tools and Utilities
prodname
Basic Teradata Query
vrm_release
16.20
category
Programming Reference
featnum
B035-2414-108K

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
//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 Teradata SQL comment indicator.