ERROROUT Command | Basic Teradata Query - ERROROUT - 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

Purpose

This control enables users to specify which output stream BTEQ is to use for writing error messages.

Syntax



where the following is true:

STDOUT
Error messages will be written to the standard output stream (SYSPRINT on mainframe-attached systems). This is mainframe BTEQ's initial default setting.
STDERR
Error messages will be written to the standard error stream (SYSTERM on mainframe-attached systems). This is workstation BTEQ's initial default setting.

Usage Notes

Error messages consist of those generated by BTEQ itself, or those passed to it by CLI or the database.

For a Unicode session on a workstation-attached system, if stdout or stderr is being redirected to a file or pipe, the job command line option can be used to insert an appropriate BOM (Byte Order Mark) to one or both streams.

The ERROROUT command is valid in an SQL macro.

Example 1 – ERROROUT Instigated By a Macro

The following shows BTEQ output (stdout/SYSPRINT). Notice that only the first invalid command produces an error message in this stream. The second invalid command produces an error message in stderr/SYSTERM (not shown).

+---------+---------+---------+---------+-----
.set errorout stdout
 *** Error messages now directed to STDOUT.
+---------+---------+---------+---------+-----
.set badcmd1
 *** Error: Unrecognized command 'BADCMD1'.
+---------+---------+---------+---------+-----
.set errorout stderr
 *** Error messages now directed to STDERR.
+---------+---------+---------+---------+-----
.set badcmd2
+---------+---------+---------+---------+-----

Example 2 – ERROROUT Instigated By a Macro

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

ECHO '.SET ERROROUT STDERR';