Using Select-lists

The preceding five sections describe how to enter INFO/ACCESS queries that define the contents, scope, and format of a report. This section describes a group of INFO/ACCESS commands that create and manipulate select-lists. Select-lists provide added flexibility in extracting information from a database and in generating reports.

A select-list is a list of item-IDs created by an INFO/ACCESS query. These item-IDs identify the items in a file whose data meets specified criteria. The select-list may then be used as input to another process or query. For example, the user may create a select-list from the CUSTOMERS file that identifies customers from a particular state and then use these item-IDs as input to an mvBASIC program. Or the user might save the select-list in a chosen file (with POINTER-FILE as the default), edit it with the Editor, then reactivate it and use it in another query.

Creating a select-list may be compared to using a selection expression in a query that generates a report. In both cases, only those items meeting the specified criteria are selected. Using a selection expression to generate a report is a one-step operation. A select-list, on the other hand, merely identifies the selected items. How the list will then be used (the second step) is up to the user.

Select-lists may be used to reference data in any file, not just the file from which the select-list was generated. For example, create a select-list from the ORDERS file of all customers whose accounts are overdue by more than $100, then use the select-list to access the CUSTOMERS file to extract these customers’ addresses for a mailing.

A select-list is always temporary; that is, it is available only for the execution of the next command, query, or program. This next operation must immediately follow the query that created the select-list. It it does not, the select-list is lost. For example, this query creates a select-list from the CUSTOMERS file dictionary; the items in this list are then processed by the Editor:

>SELECT DICT CUSTOMERS WITH A/AMC = "2"

4 ITEMS SELECTED.

>ED DICT CUSTOMERS

LAST-NAME

TOP

.

The SELECT command creates a select-list of all Attribute Definition items in the CUSTOMERS dictionary that have an attribute number of 2. The ED command then invokes the Editor on these items starting with the first item, LAST-NAME. After the first item is filed (or exited), the next item in the select-list is automatically edited, and so on. When the user has finished editing the items, the select-list is automatically cancelled.

Make a select-list permanent by saving it to a file of choice (with POINTER-FILE as the default) with the SAVE-LIST command. The POINTER-FILE is a special file in the SYSPROG account that is used to store saved select-lists. Every account on the system has a Q-pointer to this file, so once a select-list has been saved, it is accessible to other users and may be retrieved and used at any time. The GET-LIST, EDIT-LIST, COPY-LIST, and DELETE-LIST commands are used to access and manipulate saved select-lists.

It is possible to create a local POINTER-FILE in any account. If this is done, all saved lists are stored in the local POINTER-FILE rather than in the system POINTER-FILE (in the SYSPROG account). Saved lists stored in a local POINTER-FILE are available only to users who have access to that account. To create a local POINTER-FILE in any account, first remove the Q-pointer to the system POINTER-FILE from the account’s Master Dictionary. Then create a dictionary-level file with this command:

>CREATE-BFILE DICT POINTER-FILE 7

This creates a file that may point to compiled code (such as mvBASIC object code) as well as to select-lists. For more information about DC-type files see the mvBase Operation and Administration Guide.

The following topics are presented in this section:

Processors That Use Select-lists

Creating Select-lists

Saving a Select-list

Working with Saved Select-lists

See Also

mvBase INFO/ACCESS User Reference Guide Overview

Syntax Notations

An Overview of INFO/ACCESS

Using INFO/ACCESS Syntax

Producing Reports with LIST and SORT

Formatting INFO/ACCESS Reports

Using INFO/ACCESS Commands for Special Processing

Generating Forms with INFO/ACCESS

Using INFO/ACCESS Connectives, Modifiers and Options

Using INFO/ACCESS Correlatives and Conversions