Previous Topic: OUTFILE Statement—Specify File for Results of SQL QueryNext Topic: OUTPUTFORMAT Statement—Specify Output Format for a Single Request or Request Set


OUTPUT_FILE Statement—Specify File for Results of SQL Query

The OUTPUT_FILE statement specifies the location of the output file that stores the SQL query results. If you omit this statement, the results are stored in the job's spool file.

Supported Job Type

This statement is optional for the SQL job type.

Syntax

This statement has the following format:

OUTPUT_FILE outfile
outfile

Specifies the location of the output file that stores the SQL query results.

Limits: Up to 256 characters; case-sensitive

Notes:

Example: Store SQL Query Results in a File

In the following example, the output from the SQL statement is directed to file /var/dblog/orderlog.

AGENT CYBDB1
SQL 'SELECT * from NEWORDS'
OUTPUT_FILE /var/dblog/orderlog