1 Introduction

Specifying database Structure

Before you begin any actual database access via SORT, you have to specify the structure of that portion of the database you want to use. You specify this structure as a list of set names. If you wish you can separate them using information concerning their inter-relationship. This list is called the thread. The thread specification describes the hierarchical (or other) structure on which SORT statements operate.

SORT operations are used to extract information according to the thread specification. This information is in the form of record pointers which the program uses in direct-mode DBGETs to obtain the actual information from the database. The thread may contain from one to ten sets, depending on the particular application.

The diagram below shows the example Sales Analysis database. Among reports which you could obtain are:

  1. A list of all orders.

  2. A list of products plus the orders placed for that product.

  3. A list of products and orders, as above, but including the options contained with each order.

To produce report 1, only the CUSTOMER data set is involved. The thread list for such a structure would consist only of CUSTOMER. Report 2 involves the data sets PRODUCT and CUSTOMERS, while 3 involves the sets PRODUCT, CUSTOMER and OPTION.

Details of how to generate these are contained later in this chapter, along with the program to generate report 1. In chapter 3 you will find complete sample programs for reports 2 and 3.

Figure 1 Sales Analysis Data Base


Eloquence Sort Manual - 19 DEC 2002