Using Phrases

A phrase may be made up of any elements of an INFO/ACCESS query except for a command, a file name, or a parenthetical option. Some sample phrases include:

WITH AMOUNT > "100"

 

BY AMOUNT BY QTY

 

AMOUNT QTY DATE

 

HEADING "LARGE ORDERS"

 

WITH AMOUNT > "100"BY AMOUNT BY QTY AMOUNT QTY DATE HEADING "LARGE ORDERS"

Phrases are especially useful for saving complex or lengthy report formatting specifications. The user may save and reuse phrases by defining them as items in the file dictionary. For example, define the last phrase in the preceding list as an item in the ORDERS dictionary and call it LARGE-ORDERS. Then, produce a customized report at any time by typing:

>SORT ORDERS LARGE-ORDERS

This query produces a report that contains a list of the amounts, numbers, and dates of all orders larger than $100, sorted in ascending order by amount, then by number. Each page of the report begins with the heading LARGE ORDERS.

When creating a phrase, there is no need to break the lines in any particular way, except for readability; nor is it necessary to use CTRL+_ (underscore) to break the lines.

The dictionary item for LARGE-ORDERS might look like this:

   LARGE-ORDERS

001   I

002   WITH AMOUNT > "100"

003   BY AMOUNT BY QTY

004   AMOUNT QTY DATE

005   HEADING "LARGE ORDERS"

The I code in line 1 is required to identify the item as a phrase. These rules apply when creating phrases:

One or more phrase names may themselves be included in a phrase definition. This allows a phrase to call and expand other phrases, and phrases may be nested in this manner up to 50 levels.

NOTE

Avoid creating loops. Do not include a phrase name that calls another phrase that refers back to itself.

Phrases may also be defined in the Master Dictionary, making it possible to include a phrase in any INFO/ACCESS query entered, and not just in a query accessing a specific file. For example, the user may create a phrase called CALCULATIONS that displays a listing of only those dictionary items containing an A or F expression in lines 7 or 8.

See Also

Using INFO/ACCESS Syntax

Syntax Overview

Default Processing of INFO/ACCESS Parameters

The USING Connective

The WITHIN Connective

How Queries Are Processed

Entering Literal Values

Entering Multiple-line Queries

Using Throwaway Connectives