Changing the Command Sequence - 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

Only a few changes are needed to the sequence of requests and commands to produce a report. Use an editor to add the following commands to the file:

1 Insert an EXPORT command after the LOGON command to divert the report results to a file called report.out.

For mainframe-attached systems, enter the following commands:

.tso allocate ddname(repfile) dsname(report.out) shr
.export report ddname=repfile

For workstation-attached systems, enter the following command:

.export report file=report.out 

2 After the EXPORT command, enter the following RTITLE command to place a report title at the top of each page of the report, along with the date and page number.

.set rtitle 'Department Information'

3 To enable (activate) page formatting commands, add a FORMAT command before and after the SQL EXECUTE command as follows:

.set format on
execute deptdisplay;
.set format off

4 Use the RESET option of the EXPORT command to end diversion of the report results:

.export reset