ERROROUT - 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

Purpose

Routes the standard error stream and the standard output stream to two files or devices for mainframe-attached systems, or to one file or device for workstation-attached client systems.

Syntax



where the following is true:

STDERR
Default and normal output file for workstation-attached client systems, called STDERR
STDOUT
Default and normal output file for mainframe-attached systems, called STDOUT

Usage Notes

The ERROROUT command affects error and output streams differently for mainframe-attached client and workstation-attached systems.

Specifying STDERR on a mainframe-attached system, causes errors and output to split into two separate files or devices.

When specifying STDOUT on a workstation-attached system, both STDERR and STDOUT merge to one file or device.

PC users can direct errors and output to one file or device by specifying STDOUT.
If STDERR is specified in a z/OS batch environment on a mainframe-attached system, BTEQ writes error messages to the ddname SYSTERM. If STDERR is specified in a z/OS/TSO environment, BTEQ displays error messages on the terminal.

The ERROROUT command is valid in a Teradata SQL macro.

Example 1 – ERROROUT

In this example, the standard error stream and standard output stream on a mainframe-attached system are directed to one file:

BTEQ -- Enter your Teradata SQL request or BTEQ command:
.set errorout stderr
.set errorout stderr
*** Error messages now directed to STDERR.

Example 2 – ERROROUT instigated by a macro

To have a Teradata SQL macro issue the ERROROUT command, embed it within the string portion of an SQL ECHO statement as follows:

ECHO '.SET ERROROUT STDERR';