Getting Started with TRANSACT (32247-90007)
Chapter 1 23
Getting Started
Sorting the Data
Selective Reporting
Now let’s see some examples of selective reporting. The first program below prints all
orders for a particular customer.
Figure 1-9. Program to Select Data for Reporting
3 The DATA verb is a data entry verb. When the program is run, the user is
prompted to enter the cust-no. By default, the prompt uses the name of the
element. This could be overridden here in several ways. For example, we
could define entry text in the dictionary to be used when prompting for
this field. We could also specify prompt text as a part of the DATA verb.
4 SET(MATCH) sets up a match criterion so that a record is selected only if
the cust-no is equal to the one entered into the program via line 3. This is
the default. We could also specify other match operators, such as LT (less
than), GT (greater than), NE (not equal), etc.
5 OUTPUT(SERIAL) specifies a serial read through the orderhead dataset.
When a cust-no matches the one entered by the user, then the record is
selected.
1 system ex3,base=orders;
2 list(auto) orderhead;
3 data cust-no;
4 set(match) list (cust-no);
5 output(serial) orderhead;