ERROROUT Command | Basic Teradata Query - ERROROUT (EO) - Basic Teradata Query

Basic Teradata® Query Reference - 20.00

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Basic Teradata Query
Release Number
20.00
Published
October 2023
ft:locale
en-US
ft:lastEdition
2025-04-02
dita:mapPath
gxl1691484661681.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
psp1479308573013
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



Shorthand Syntax (Interactive Mode Only)
Command Shorthand
ERROROUT EO
Option Shorthand Option Shorthand
STDOUT SO STDERR SE

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.

The DEFAULTS command does not affect ERROROUT setting on mainframe-attached systems. For workstation-attached systems it resets ERROROUT to STDERR.

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';