Getting Started with TRANSACT (32247-90007)

Chapter 1 17
Getting Started
Reporting From a Dataset
Reporting From a Dataset
The first program we look at is a simple, three-line program to report the contents of a
dataset. Then we will expand this program and give it many more capabilities as the
section progresses. However, this should not be viewed as implying that Transact is a
report writer. Transact’s power lies in several areas: it provides a high-level interface for
database and file access, a high level interface with VPLUS for online database updating,
and an automatic error handling facility that makes prototyping of a system possible in a
very short time frame.
In addition, when Transact is interfaced with Report/V, it is possible to write complex
reports that no nonprocedural report writer can do. The procedural power of Transact is
used to retrieve and manipulate the data and then Report is used to format the data and
provide summarization as necessary. We will see an example of that later on.
Getting a Complete Listing
One of the simplest tasks to perform with TRANSACT is to display the contents of a data
set. The three-line program shown in Figure 1-2 lists the contents of a data set called
customer.
Figure 1-2. Program to Display a Dataset
1 The first statement in a Transact program is always a SYSTEM
statement, in which we give a name to the current program and identify
the database (and other files) to be used by the program. In this example,
the program is called EX1. This is the name we will provide to Transact
when we want to run the program. We also tell Transact that our Image
database is named ORDERS.
2 The Image dataset that we want to list is called customer. We don’t need to
tell Transact what data elements are in the dataset. LIST(AUTO)
instructs TRANCOMP to go to the dictionary and extract the names of all
the data elements for the named dataset. Appendix G lists the data
element or item content of each dataset and file used throughout this
manual, and also displays a diagram that shows the relationship of the
sets.
In this example, the LIST(AUTO) statement is equivalent to individually
listing each of the data elements as in:
list cust-no:
name:
1 system ex1,base=orders;
2 list(auto) customer;
3 output(serial) customer;