Getting Started with TRANSACT (32247-90007)

Chapter 1 21
Getting Started
Sorting the Data
Formatting Options
The FORMAT verb also provides extensive reporting options for such things as field
editing, heading text, line breaks, column positioning, etc.
The following program illustrates a few of the options available on the FORMAT verb.
Figure 1-7. Options for FORMAT
3 $TODAY is a special name that means print today’s date. The edit options
specify to print the first three characters of the day of the week followed by
a period, then print the first three characters of the month, then the
numeric day of the month, and last the year.
4 Any literal to be displayed is placed in quotation marks. The COL= option
indicates an absolute report column number for the start of the display of
an item. In the example the literal value begins in column 30.
6 $PAGE is a special name that means print the current page number here.
7 The LINE= option indicates the number of lines to advance before
displaying the item that the option is attached to. In the example, the line
count is advanced by two lines. The TITLE option indicates that all report
definitions that precede this, including the current report item, make up a
report heading or title. These items appear at the top of each new page.
8 The NOHEAD option specifies that no column heading is to be generated
for this item. We have decided to provide our own column heading called
CUSTOMER.
Note that the LINE= option is used here to indicate that the report is to
advance two lines before printing the customer name.
9 This line prints the value of the street address immediately under the
name and suppresses the generation of a column heading.
1 system ex2b,base=orders;
2 list(auto) customer;
3 format $today,edit="3w. 3m DD, YYYY":
4 "LIST OF CUSTOMERS REPORT",col=30:
5 "PAGE",col=60:
6 $page:
7 "CUSTOMER",line=2,title:
8 name,nohead,line=2:
9 street-addr,line,nohead:
10 city-state,line,nohead:
11 zipcode,nohead,join=1;
12 output(serial) customer,sort=(city-state);