Submit BTEQ commands and Teradata SQL statements using z/OS in either of two ways:
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,
|
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. |
Note: 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.