OUTPUT statement

Use the OUTPUT statement to send the results of a query to an operating-system file or to a program.

Syntax

(explicit id oput002) oput002 OUTPUT TO { filename | PIPE program } [ WITHOUT HEADINGS ] <SELECT Statement>[]
Element Description Restrictions Syntax
filename Path and filename where query results are written. The default path is the current directory. Can specify a new or existing file. If the file exists, query results overwrite the current contents of the file. Must conform to the rules of your operating system.
program Name of a program to receive the query results as input Program must exist, must be known to the operating system, and must be able to read the results of a query. Must conform to the rules of your operating system.

Usage

The OUTPUT statement writes query results in an operating-system file, or pipes query results to another program. You can optionally specify whether column headings are omitted from the query output. This statement is an extension to the ANSI/ISO standard for SQL. You can use this statement only with DB-Access.