Item Lists

An item list specifies the items within the file to be further processed. If no list is given, all items in the file are implied.

Types of Item List

An item list takes one of three forms: an explicit item-id list, an implicit item-id list, and an item-id selection clause. Item-id selection can be combined with implicit but not with explicit item-id lists. Every type of list can be combined with selection criteria based on attribute values.

Explicit Item-id List

An explicit item-id list lists items for processing. Each item-id is enclosed in single quotes. Spaces between item-ids are optional. An item-id list cannot include a relational operator, and any logical connectives included are ignored.

English treats the values you place between quotes as item-ids, not as value strings. This means that the left ignore, right ignore, and wild card (see Value Strings) are treated as ordinary characters, not as special characters.

When you specify an explicit item-id list, only those item-ids are processed and they are accessed directly from the file. This is generally faster and more efficient than using a selection process because the processor does not have to read all of the items in the file. When an explicit item-list is specified, English ignores any implicit item-id list that you supplied to the English command.

Syntax

'item-id' {'item-id'}...

Examples

The following sentence lists information about rooms 194, 535, 318, and 144:

:LIST ROOMS '194' '535' '318' '144'

The following example is functionally equivalent as spaces are not required between the item-ids:

:LIST ROOMS '194''535''318''144'

Implicit Item-id List

You provide an implicit item-id list by executing a command such as NSELECT or GET-LIST immediately before executing an English command (See Generating Implicit Lists for other commands). If you also specify item-id selection, the English processor effectively ANDs its results with the implicit item-id list to limit further the items selected.

If you specify an explicit item-id list the processor ignores any implicit list.

Item-id Selection Clause

An item-id selection clause expresses limits on the value of item-ids to be selected for processing. It has at least one value string that defines an item-id or part of an item-id, and at least one value string must be preceded by an explicit relational operator. The relational operator is what makes English treat item-id selection differently from an explicit item list. You can use logical connectives to combine relational operations. If you do not use an explicit logical connective, English defaults to the OR connective. English searches the file for each item-id that matches the value strings in the criteria. If an implicit item-id list has been specified, the processor checks only those item-ids present in the list.

Syntax

{'valueString'}... relationalOperator'valueString' {{logicalConnective} {relationalOperator} 'valueString'}...

Value Strings

Value strings are character strings enclosed in delimiters (usually single quotes within item-id selection criteria and double quotes within ordinary selection criteria). They are used to compare against character strings in the file. The value string cannot contain the character by which it is delimited. For example, if the value string is enclosed in single quotes, it may contain double quotes, but not single quotes. Otherwise, the value string can contain any printable character, excluding RETURN, LINE FEED, and system delimiters. The simplest value string is a character string that has precisely those characters that are to be tested for (for example, 'Johanson'). However, a value string can also include the following special characters:

Case Sensitivity

If the file specified in the English sentence has case-insensitive item-ids, the case of item-id value strings is ignored. For example:

SELECT FILE 'AbC'

will select the item with the id "AbC", "ABC", "abc", or "aBc", etc.

Note

This is only the case if attribute 8 of the data definition item is null; if attribute 8 contains any pre-processor codes, case is only ignored if data case-insensitivity is enabled.

Single and Double Quotes

Value string delimiters are single quote (') and double quote ("). An item-id or item-id value string can be enclosed in double quotes, but only if it is entered immediately after the file name. You are recommended to use single quotes within item-id selection clauses and double quotes within ordinary selection criteria except when you are searching for an item-id that includes single quotes.

Relational Operators

Expresses a relationship between an item-id (or attribute value in the case of selection criteria) and the value string. At least one relational-operator is required in an item-id selection clause. Value strings within the clause not preceded by a relational-operator are treated as if preceded by the equal operator.

The operators test for relationships equal (=), less than (<), greater than or equal (>=), and so on. The result of a relational operation is a truth value: true or false. You can enter relational operators as special character symbols or as their mnemonic equivalents. The operators are listed in the table below.

Symbol

Synonyms

Meaning

=

EQ

Equal

#

NE, NOT, NO

Not Equal

GT, AFTER

Greater Than (After)

>=

=>

GE

Greater Than or Equal

LT, BEFORE

Less Than (Before)

<=

=<

LE

Less Than or Equal

Logical Connectives

The logical connectives AND and OR join two relational expressions. The default connective is OR. Thus, if two relational expressions are given without a logical operator between them, items satisfying either expression are selected (as if OR had been used). The AND connective is processed before OR (or implicit OR).

Logical connectives combine truth values. The connective AND yields a truth value of true if all of the truth values it is combining are true. If any truth value is false, the result of the AND connective is false. The OR connective yields a truth value of true if at least one of the truth values it is combining is true.

Synonyms

The ampersand (&) is a synonym for AND. The exclamation mark (!) is a synonym for OR.

BETWEEN Connective

The connective BETWEEN followed by two value strings separated by AND is a shorthand way of saying 'all values greater than the first value string and less than the second'. The value of the second value string must be greater than the value of the first to select items. Value strings including special characters ^, [ and ] are not valid.

Examples

Item-id List Example

The following sentence lists information about rooms 117 and 119. Because there is no explicit relational operator, this is an item-id list, and the processor accesses the items directly.

:LIST ROOMS '117' '119'

Value String Example

The following sentence lists information about rooms with numbers matching "117" or "119". Note that the equal sign makes these values strings rather than item-ids. Hence, without an implicit item-id list, the processor must search the entire file, comparing all item-ids against these two value strings; thus it would be better to omit the equal sign, as shown in the previous example, to avoid this.

:LIST ROOMS = '117' '119'

Implicit List Examples

The following sentences will not list anything because the value strings cannot match any item-id in the implicit list.

:SELECT ROOMS GT '200'
23 ITEMS SELECTED. >LIST ROOMS = '117' '119'

The following sentences list information about rooms 117 and 119 because the process ignores an implicit item-id list when an explicit item-id list is in the sentence.

:SELECT ROOMS GT '200' 
23 ITEMS SELECTED.
>
LIST ROOMS '117' '119'

Left Ignore Examples

The following sentence lists information about all rooms with numbers ending in 23.

:LIST ROOMS = '[23'

The following sentence does not list any rooms. Because there is no relational operator, the value [23 is treated as an item-id.

:LIST ROOMS '[23'

Wild Card Examples

The following sentence lists information about all rooms with numbers that begin with 3, end with 5, and have a single intervening character of any value.

:LIST ROOMS = '3^5'

The following sentence does not list any rooms. Because there is no relational operator, the string 3^5 is treated as an item-id.

:LIST ROOMS '3^5'

Wild String Example

The following sentence lists all rooms with numbers starting with 3 and ending with 5:

:LIST ROOMS = '3]5'

AND Connective Examples

The following sentences both list information about all rooms numbered 200 to 399.

:LIST ROOMS => '200' AND < '400'
:LIST ROOMS BETWEEN '199' AND '400'

The following sentence results in a report listing information only about room 119 because in the absence of a relational operator, an equal (=) is assumed. The only room number which is both greater than 117 and equal to 119 is 119.

:LIST ROOMS > '117' AND '119'

Apparent Item-id List Example

The following sentences do not list information about rooms 117 and 119 because they would not be on the implicit list. Although this sentence seems to have an explicit item-id list and an item-id selection clause, the whole series is treated as an item-id selection clause because there is a relational operator somewhere in the list.

:SELECT ROOMS GT '500'
4 ITEMS SELECTED. >LIST ROOMS '117' '119' OR = '[27'

Further Examples of Item Lists

The following sentence lists information about rooms with numbers that are both greater than or equal to 400 and less than 700:

:LIST ROOMS >= '400' AND LT '700'

The following sentence displays information about rooms with numbers less than 200 and with available dates after May 17, 1988.

:LIST ROOMS < '200' WITH AVAILABLE AFTER "17 MAY 88"

The following sentence displays information about rooms with numbers less than 500 and greater than 199 and with bed codes equal to either suite or double. The second AND arises because the sentence includes both item selection and data selection criteria: these operations are carried out one after the other, giving an effective AND function.  The OR between "ST" and "D" is implicit.

:LIST ROOMS LT '500' AND GT '199' WITH ROOM-CODE "ST" "D"

The following sentence lists rooms with numbers less than 200 or greater than 399.

:LIST ROOMS < '200' OR > '399'

The following sentence is equivalent:

:LIST ROOMS < '200' > '399'