Introduction to English
This topic introduces all of the elements of English, including the inquiry language and the dictionary items that support that language.
Overview
The Inquiry Language
English is a powerful data retrieval and report generating language.
English retrieves and organizes data in a way that is completely transparent to the user. A "read-write" program, written in any language, contains a multitude of instructions. Those, in turn, activate other instructions. English uses processors called verbs that activate predefined instructions. This makes English very powerful and easy to use.
An English sentence is basically a directive that selects, organizes, and outputs data. A directive, by definition, starts with a verb followed by an object and may have some qualifying clauses. For example, a natural English directive such as:
'Show me the accounts'
translates into an English sentence similar to the following:
LIST LEDGER
A more complex directive such as:
'Make a copy of the accounts paid in 1994 arranged alphabetically by customer'
could be set up as the following English sentence:
LIST LEDGER WITH ACCOUNT-PAID-YR = "1994" BY CUST-NAME (P)
LIST is the English command that starts the directive. LEDGER
is the file
name. The WITH
clause specifies which items are to be selected.
ACCOUNT-PAID-YR
is a user-specified attribute of the file that yields the number of the year in
which an account was paid. The word BY
begins a sort clause, which is followed
by an output option.
In the English environment, the command is a processor that acts on the contents of a specified file.
Data is stored in an internal format that may not be suitable for a report. Specifically, dates are stored in a format that requires translation. This type of data is converted to an external format through codes in the data definition items, which specify the conversions to be done.
Conversion codes can also be used to manipulate data by, for example, performing mathematical functions, concatenating fields, or extracting specific data from a field or from another file.
The command and a file name are mandatory. The subsequent phrases are optional.
Optional phrases and clauses include the following:
-
File modifiers.
-
Item list.
-
USING clause.
-
Selection criteria.
-
Collation: sort and output selection.
-
Output options.
The command must be the first word in the English sentence. Unless otherwise noted, all other components of an English sentence can be entered in any order.
The Dictionary
The dictionary contains definitions of the data in associated data files. These definitions create a correspondence between the name(s) of an attribute (otherwise known as a line or field) within data items and their position (line or attribute number) and processing or formatting that needs to be applied to that data. The attribute name is specified within the English sentence in order to refer to the corresponding piece of data.
Dictionary items and processing codes (known as conversion codes) are described in File and Data Definition Items, Conversion Codes and Macros.
Summary of English Features
In summary, English provides the following capabilities:
-
Commands based on the normal English sentence structure.
-
Retrieval is always via a specified file. Data from other files can be accessed by setting up 'translate conversions' within data definition items in the dictionary in use.
-
In the absence of a specific data definition item in the dictionary in use, the Master Dictionary of the account from which the command is executed is accessed.
-
Sorting of data in ascending or descending order.
-
Selection criteria that may include explicit or implicit item lists, logical connectives (AND/OR), relational operators, and literals.
-
User-specified formatted output including statistical information by section, totals and grand totals.
-
Stored data can be translated to a desired external format and manipulated through conversion codes in the associated data definition items.
Most of the examples given in this section are based on the HOTEL database that you can access through the ENGLISH-TUTORIAL account.