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:
Carriage returns used to break phrases into multiple lines are automatically converted to blank spaces, except when text is enclosed in quotes or backslashes (\). This might occur, for example, if a phrase includes header text extending over two or more lines. Also, if a line begins with a colon (:), the carriage return at the end of the preceding line is not converted to a space.
Any line that begins with an exclamation point is treated as a comment and ignored during processing. With an exclamation point at the beginning of line 1 (that is, before the I code), the entire phrase will be ignored.
A null phrase (i.e., a phrase containing no words apart from comments) is ignored.
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
Default Processing of INFO/ACCESS Parameters