Getting Started with TRANSACT (32247-90007)

Chapter 1 19
Getting Started
Sorting the Data
Sorting the Data
Let’s change the report to be all elements except cust-no so that it will fit on one line. Also,
we will sort the report by city-state.
Figure 1-4. Program to Sort and Report Data
2 Since we do not want access to all items from the customer set, we must
individually list the items that we do want.
3 Appending the SORT= phrase to the OUTPUT verb tells Transact to sort
the data in ascending sequence by the city-state item.
By default, the OUTPUT verb retrieves and reports all items that are
LISTed to the program.
An alternative way to do the report is:
Figure 1-5. Program to Sort Data and Use FORMAT for Reporting
3 Rather than specify through the LIST verb that a subset of the customer
items is to be retrieved, all the items are retrieved, but the FORMAT verb
specifies to OUTPUT that only the named subset is to be reported.
1 system ex2,base=orders;
2 list name:
street-addr:
city-state:
zipcode;
3 output(serial) customer,sort=(city-state);
1 system ex2a,base=orders;
2 list (auto) customer:
3 format name:
street-addr:
city-state:
zipcode;
4 output(serial) customer,sort=(city-state);