Specifying a Standard Error Output File - Basic Teradata Query

Basic Teradata Query Reference

Product
Basic Teradata Query
Release Number
15.10
Language
English (United States)
Last Update
2018-10-07
dita:id
B035-2414
lifecycle
previous
Product Category
Teradata Tools and Utilities

By default, BTEQ writes error messages to the standard output file (STDOUT), along with the data retrieved from the Teradata Database in response to BTEQ commands and SQL requests. On Mainframe-attached systems, and some workstation-attached systems, a standard error output file (STDERR) can be specified for error messages.

For more information about specifying a standard error output file, refer to “Handling Errors” on page 89 and to “ERROROUT” on page 152.

Depending on the system configuration, a standard error output file can be specified either when BTEQ is invoked or before logging on to a Teradata Database.

Use the following table to specify a standard error output file:

 

System Type

Error Output File

Mainframe-attached

Use either the BTEQ TDSBTEQ JCL procedure or a DD statement in a standard JCL file to define the ddname of SYSTERM for the STDERR device before invoking BTEQ.

Mainframe-attached

Also use the BTEQ TSO command to define the ddname of SYSTERM for the STDERR device.

Workstation-attached

Use the > or >> characters to define a standard error output file when BTEQ is invoked.

Using the > or >> Characters

Use the > and >> characters to specify output files in a UNIX environment, as follows:

 

Redirection Operator

Filename State

Results

> (single character)

New

The new file is created as the standard output file.

> (single character)

Existing

The existing file is overwritten with new records.

>> (double characters)

New

The new file is created as the standard output file.

>> (double characters)

Existing

The new records are added to the end of the existing file.

Note: The >& and >&1 redirection syntax can be used to specify the name of a new file to be created for both standard output and error messages.

Shell Output Stream Differences on SUN Systems

On SUN systems, the direction of the standard output stream and error messages is not the same under the sh shell and the C shell.

 

Shell Type

Redirection Syntax

Results

sh shell

>out

Sends error messages to the file called out.

sh shell

>out&

Sends the standard output stream to the system console and runs BTEQ in the background.

sh shell

>out>&1

Sends both error messages and the standard output stream to the file out.

C shell

>out

Sends the standard output stream to the file out, and error messages to the workstation screen.

C shell

>&out

Sends both error messages and the standard output stream to the file called out.