Getting Started with TRANSACT (32247-90007)

Chapter 1 25
Getting Started
Sorting the Data
The following example is an expansion of the example in Figure 1-9.
Figure 1-12. Program to Let User Set Selection Criteria
We have combined lines 3 and 4 into a single DATA(MATCH) verb. This verb not only
provides data entry, but also recognizes a variety of relational conditions that can be
provided by the user at run time. These relational conditions are used as the selection
criteria for data retrieval.
The following examples demonstrate how to run the program and enter various relational
conditions.
Figure 1-13. User-Entered Selection Criteria
In this example, the user specified that cust-no 1 and 2 are to be retrieved. If data values
are provided without any relational conditions, equality is assumed. That is, retrieve the
data if it matches any of the data values provided in the list.
1 system ex4a,base=orders;
2 list(auto) orderhead;
3 data(match) cust-no:
order-status:
order-date;
4 output(serial) orderhead;
CUST-NO> 1,2
ORDER-STATUS>
ORDER-DATE>
ORDER-NO: CUST-NO: ORDER-STATUS: ORDER-DATE:
po1001 1 o 850101
po1002 1 o 850203
po1003 1 0 850127
po1004 1 0 850301
po1005 1 c 850212
po2001 2 h 880301
po2002 2 o 880312