Getting Started with TRANSACT (32247-90007)

Chapter 3 67
Using VPLUS and IMAGE
Reporting Data from a Dataset
Reporting Data from a Dataset
Now let’s use VPLUS to display data from the customer dataset.
One way to display the data is to display a record at a time using the same form we used to
add and update data.
The following program illustrates this.
Figure 3-13. Using VPLUS to Display Data
3 The FIND verb can also be a looping verb. In this example, it serially
retrieves each record from the customer dataset. As each record is
retrieved, the PERFORM= option passes control to the routine at label
display-record. When the RETURN is encountered, control passes back to
the FIND.
6 PUT(FORM) displays the information to the screen. The WAIT= option
causes the program to wait until the user has pressed any of the function
keys before continuing with the next record. The WINDOW= option
displays a message in the VPLS window area to remind the user that he
must press one of the function keys before the program will continue.
Another way to display the information back to the terminal is to format the data to look
more like a report, but yet remain within VPLUS. To do this, we need to set up a form for
the report heading information, a form to hold the detail information for each record, and a
counter to increment so that we know when we have filled the screen.
Up until now, we have accepted the default selection as to what data elements are
extracted and reported. Now we will override the default selection by using a qualifier on
the verb to specify which subset of data we want.
The new forms we need are called vcustomerrh, and vcustomerrd. Their definition in the
dictionary and the format of the forms are shown below.
1 system ex28,base=orders,vpls=formfile;
2 list(auto) customer;
3 find(serial) customer,perform=display-record;
4 exit;
5 display-record:
6 put(form) vcustomer,wait=
,window=("press f1-f7 to continue");
7 return;