Algebraic Expressions

Key structures and column structures are defined by entering algebraic expressions. These expressions are compiled into the internal formats required by the BTREE routines. Algebraic expressions may have the following elements:

Sort Order

BY

A separator that is required before each key portion to indicate the sort order for a particular portion of the key. Multiple exploding keys may be created by entering the equation as:

BY ... BY ... BY ...

BY-AL

The same as BY alone. Indicates ascending left-justified sorting.

BY-AR

BY clause indicating ascending right-justified sorting. Right justifying makes numbers sort as numeric instead of as string.

BY-DL

BY clause indicating descending left-justified sorting.

BY-DR

BY clause indicating descending right-justified sorting.

BY-EXP

BY clause for MultiValued keys. Forces individual attribute references to all be MultiValued.

BY-DSND

BY clause for descending keys.

Elements

###

An integer positive numeric entry refers to an attribute within the data structure. An 0 may be used to specify the item-ID.

###.###

A specific value of the specified attribute.

M###

The letter M followed by a positive integer refers to an attribute within the data structure that is MultiValued. It is valid to mix MultiValues and non-MultiValued data references.

“...”

A quoted string is used to specify constants. Either single or double quotes may be used. System delimiters are not valid within quoted strings.

Operators

:

The : (colon) is used to concatenate elements together.

+ - * /

Integer math functions may be performed on elements.

Syntax Modifiers

( )

Parentheses may be used to group elements.

OR

Pseudo MultiValued (exploding) elements may be created by combining multi or non-MultiValued elements together with the OR clause.

Functions

OCONV(,)

Conversions may be performed. Access to the Conversion Processor allows operations such as text extracts, group extracts, and file translates to be performed.

ICONV(,)

Input Conversions may also be performed.

KEYWORD (expression, separator)

Exploding sorts are created on each word in a field (or combination of fields) using a specified separator.

MULTIWORD (expression {,separator {,exclusion file}})

An extension to the KEYWORD( ) function, MULTIWORD( ) allows you to also exclude unwanted words from the MultiValued result by using an exclude file.

EXCLWORD (expression, exclude file)

The exclusion function of MULTIWORD( ) is also available separately.

See Also

Defining Key Structures

Activating the BTREE Key Definition Program

Displaying and Printing Key Structures

Entering Key Definitions

Saving and Compiling Key Definitions

Suppressing Automatic Uppercase in Keys

Key ICONV Functions

Key Browse Column Definitions

Using Key Definitions