.
contact contact


FTS Compatibility - ODX Calls

 
.
  This document describes the ODX calls implemented for FTS backwards compatibility.

The ODX compatibility is implemented in the libftc library. This library must be loaded to enable ODX calls. The libftc library internally makes use of the image3k library (implementing the TurboIMAGE compatibility) and the eqdb library (Eloquence database client library).

A separate B.08.20 "FTC" license key is required to enable ODX compatibility.

Overview

The ODX calls were originally created to allow keyword searches of IMAGE databases.
Eventually, the IMAGE "TPI" convention incorporated a major subset of the keyword search functionality in the IMAGE calls and allowed third parties to provide keyword search functionality with standardized calls.

As Eloquence supports keyword indexing natively the ODX calls (as well as the image3k TPI modes) make use of the Eloquence indexing and do not add functionality. ODX calls are intended to provide backwards compatibility for existing applications.

The ODX calls in the libftc are integrated with the image3k library (Eloquence TurboIMAGE compatibility) and you may mix and match calls from either family. Traditionally, use of the ODX calls required the use of DBI calls to open the database, decode the status array or obtaining structural information.

An important difference to IMAGE conventions is that the ODX calls, like DBI calls, use a 21 element status array of 16-bit words (rather than 10 elements with IMAGE). Also, the ODX calls use two status codes: If the first element of status array is set to 888 then the 11th status element holds a separate ODX status code. Otherwise status reflects an IMAGE status.

The following ODX calls are supported.

The following ODX calls are not supported and return ODX status -800.
  • odxtransfer
  • odxprint
  • odxview

Implementation notes

  • Eloquence does not define a separate numeric range for composite FTS fields and index items.
    As Eloquence supports more than 1024 IMAGE items the original range for composite FTS fields (larger than 1024) or composite index items (larger than 2000) would be conflicting.
    In the Eloquence DBI calls, composite FTS and index items use distinctive item numbers but not in a specific number range.

  • An FTS field is considered "composite" if it refers to more than one item (has multiple segments), defines its own name or its definition differs from the underlying data item (e.g. uses an offset or a deviating length).

  • With Eloquence, each field in a detail set may be configured individually to link to a master set (with the PATH= option). However, only one master set may be specified for a detail set (any fields configured to link to a master set must refer to the same master set).
    odxinfo assumes that a detail set is in a dataset group if at least one FTS field is linked. This may have the effect that previous search results on a detail may not be applicable to the linked master although odxinfo indicates both are part of a search group. For full ODX compatibility all fields in a linked detail should be linked.

odxfind

odxfind searches the FTS index for keywords and the records that contain them. It returns the search items and/or record numbers or just keywords, depending on the data set type and the mode value used. The odxfind results may be obtained with odxget or odxgetword.

odxfind(base,dset,mode,status,field,keywords)
base
Base is the name of an array used as the base parameter when opening the database.

dset
Dset is the name of an array containing the left-justified name of the data set to be accessed, or is an integer referencing the data set by number. The data set name can be up to 16 characters long. If shorter, it must be terminated by a semicolon, a space or the NUL character.

mode
Modes 1, 2, 3, 5, and 30 are used in conjunction with odxget; modes 10 and 11 are used with a subsequent odxgetword call.

Mode Description
1 Returns the number of qualifying FTS references based on the arguments and operations passed in the keywords parameter.
2 Same as mode 1.
3 Enables the parsing of literal and parenthetical operators in the keywords parameter. When mode 3 is specified, the keyword list must be terminated by a semicolon ( ; ).
5 Like mode 3, but precedence of operations matches that of the TPI Interface.
10 Returns the number of qualifying keywords and sets a pointer to the first qualifying keyword.
11 Same as mode 10 but does not return a qualifying count.
30 Converts the FTS result of a search on a linked detail set to the associated master set.

Mode options

  • 100 to 300 have no effect
  • 400 to 700 disable preserving results on odxfind calls that qualify no results

To select mode options, add their value to the mode value. For example, mode 401 specifies a mode 1 odxfind with mode option 400 enabled.

status
Status is the name of an array of 21 halfwords in which the odxfind call returns status information. If the call completed successfully, the first element is zero. If the first element is 888 then element 11 holds the ODX condition word.

Element Contents
1 If the procedure succeeds, the return status is 0. Otherwise it provides a status code to describe the failure.
2 Zero.
3-4 In searches on non-aggregated (record specific) FTS fields in detail sets, contains the number of qualified detail records (represented by their record numbers). In searches on FTS fields in master sets, or aggregated FTS fields in detail sets, contains the number of qualifying master entries (represented by their search items).
5-6 In most searches, contains the number of qualified masters set entries (aggregated keys). In searches on unlinked detail sets, contains the number of qualified detail records (represented by their record numbers).
7-8 contains the FTS references count for the current search before the IDs are applied to any internal ID list stored in memory.
11 ODX condition word is zero.
12-13 Number of qualifying FTS references (modes 1, 2, and 30) or number of qualifying keywords (mode 10).
14-15 not used
16-21 Contains the first 12 characters of the keyword that caused a calling error (if the call was unsuccessful because of an incorrect word in the keywords parameter).

If status word 1 is nonzero, word 11 contains the ODX condition word. DBERROR or DBEXPLAIN can be called to decode the status code.

field
Field is the name of an array containing a left-justified name of a FTS index item or is an integer referencing the FTS field within the data set.

keywords
Keywords is the name of an array containing a list of keywords or partial keywords separated by operators. All records that contain the keywords specified in the keywords parameter for this field (or any field in the same field group) qualify.

In mode 1 or 2 a space, a semicolon or NUL character may used be used to terminate the list. Spaces will not terminate the keywords list if they are enclosed in quotes.

When odxfind is called with mode 3 or 5, the keywords list must be terminated by a semicolon ( ; ) or NUL character. A space is parsed as an AND operator.

The keywords parameter cannot be longer than 1024 bytes. Otherwise ODX status -220 is returned.

Description

odxfind mode 1, 2, 3 or 5 qualify records based on the list of keywords in preparation to calls to odxget and returns the number of results. For aggregated FTS fields the number of results reflects the number of master entries. The keywords parameter must follow the syntax described in the section below.

odxfind mode 10 and 11 qualify keywords in preparation for a subsequent odxgetword call. The keywords parameter specifies a word, a partial word or a range.

odxfind mode 30 may be used to convert a previous detail specific search result into unique master set entries (for linked fields). As a consequence, a subsequent odxget will obtain master set entries instead of detail entries. This may also be useful when refining a previous search on a linked detail into other sets within the same set group. The keywords parameter is ignored.

odxfind keywords syntax

odxfind mode 1, 2, 3 or 5 qualify records based on the list of keywords. The keywords argument consists of keywords (or ranges), separated by operators. A leading operator applies the odxfind search results to previous search results.
[op] word [[op] word...]
  • word is a keyword or a range. Words are separated by operators. Double quotes may be used to designate a literal word.

  • The argument list is terminated with either a space, a semicolon or a NUL character. For odxfind mode 3 and 5 the keyword list must be terminated by a semicolon or NUL character.

  • op indicates an operator
The keywords are searched in the FTS dictionary index and operators define the relationship of the keywords. For example:
mike AND wuppertal
This consists of the keywords mike and wuppertal. As the boolean AND operator is used only records qualify having both mike and wuppertal.

Keywords and operators are case insensitive (with the exception of keywords designated specifically to be case sensitive).

Ranges

A keyword range may be specified by entering a minimum value, the range operator (:) and a maximum value. Either the minimum value or the maximum value is optional. For example,
A:B, 10:15, X:
indicates all words between A and B (inclusive), all keywords between 10 and 15 or any keywords larger than X.

Pattern matching and generic words

Partial words, such as MAN@ (matching MANAGER, MANAGED, ...) may be used. In addition, match characters, such as "?" or "#" may be used in a keyword. For example:
MAN@ or AB#D

This matches all words that start with "MAN" or any word that starts with "AB", followed by a digit and the character "D".

Boolean operators

The boolean operators AND, OR and NOT may be used to define keyword relationships. For example,
mike AND NOT wuppertal
NOT test
would only qualify records with "mike" but not wuppertal. The second example would qualify any records NOT having the keyword test.

odxfind Mode 1 and 2 Syntax

odxfind mode 1 and 2 implement backwards compatibility to older ODX versions. odxfind mode 1 and 2 use a different set of operators.

*   (asterisk) Refers to the previous search results, may only be used at the beginning of the search expression and must be followed by a boolean OR or AND operator.
+   (plus sign) Boolean OR operator. For example, marxmeier+software qualifies all entries that have either the keyword marxmeier OR software.
,   (comma) Boolean AND operator. For example, marxmeier,software qualifies entries that have both the keywords marxmeier AND software.
-   (minus sign) Boolean NOT operator, may be used with the boolean AND operator. For example, marxmeier,-software qualifies entries that have the keyword marxmeier but not the keyword software. The NOT operator does not separate words and is only recognized at the beginning of a word.
:   (colon) Range operator

Operator precedence

:, OR, NOT, AND

Mode 3 and 5 syntax

The odxfind modes 3 and 5 add support for literal operators (AND, OR, NOT, TO and THRU). A space is not considered a terminator but an implied AND operator. Parenthesis may be used to specify the precedence of boolean operators.

Literal operators

OR   Boolean OR operator
AND   Boolean AND operator
NOT   Boolean NOT operator
TO   Range operator
THRU   Range operator

The range operators TO and THRU may be used as an alternative to a colon.

Operator precedence

The operator precedence for odxfind mode 3 is:
:, OR, NOT, AND

The operator precedence for odxfind mode 5 is:
:, NOT, AND, OR

Syntax description

Keywords

Keywords are words or ranges, separated by operators or a space.

When searching numeric fields only numbers (or numeric ranges) are valid. In numbers a dot (.) is understood as the decimal point.

Quoting

Use double quotes around a keyword value to prevent it from being parsed. This is useful when searching for keywords that contain special characters or spaces or when a keyword could be interpreted as an operator (for example, "OR" in a search for a state code).

Ranges

A keyword range may be specified by supplying a start value, the range operator and a stop value. Either the start value or the stop value is optional.

[startvalue]:[stopvalue]
If both the start and stop values are present, any keywords between (and including) the specified values qualify.
If either the start or stop value is not present then a range specifies an open range qualifying any value from the start or up to the stop value. For example:
a:z
2011:2012
2011:
:2012
The first example qualifies all keywords between "a" and "z", the second example qualifies any keywords between 2011 and 2012. The third example qualifies any keyword larger than or equal to 2011. The fourth example qualifies any keyword smaller than or equal to 2012.

Ranges can also use partial keywords by appending an at sign (@).

word:word   Range with start and stop value
word TO word   Same using the TO range operator
>=word<=word   Same using relational operators to specify a range
:word   Open range with a stop value specified (<= relation)
TO word   Same using the TO range operator
<=word   Same using relational operator
word:   Open range with start value specified (>= relation)
word THRU   Same using the THRU range operator
>=word   Same using relational operator
a@:z@   Range using partial keywords
10:20   Numeric range
%DATE(...)   %DATE function with partial date format

Relational operators

Relational operators are an alternate means for specifying ranges.

=  Equal to (redundant)
>=  Greater than or equal
>  Greater than
<=  Less than or equal
<  Less than

A relational operator is specified with the keyword (no separating space allowed). For example, >=A@ has the same meaning as A@: indicating an open range starting with A.

Two relational terms may also combined to specify a range with both a lower an upper boundary. For example, >=A@<=B@ is equivalent to A@:B@. Please note that no space is allowed between the two relational terms.

Pattern matching

odxfind supports the following wildcard characters anywhere in a keyword argument:
  • ? - represents any single printable character
  • # - represents any single digit (0-9) of an ASCII number
  • @ - represents any number of ASCII characters, including spaces
In relational expressions, wildcards may only be used at the end of an argument string.

Soundex phonetic searches

To specify a phonetic or "Soundex" search on an FTS field add the Soundex operator ( ! ) to a keyword(s). For example, ALAN! AND CHRIS!.

If the FTS field does not support Soundex searches (the SX option must be specified for the FTS field) ODX status -224 "Not a Soundex field" is returned.
If a Soundex field is grouped with other fields, be sure to specify the Soundex field name in the field parameter when calling odxfind for a Soundex retrieval.

The %DATE function

The %DATE function supports the conversion of different date formats. This feature enables:
  • consistent entry formats with differing storage formats
  • partial-date arguments converted to ranges (for example, YYMM, YYYYMM, YY, etc.)
%DATE may be entered as a keyword in a keyword list using the following syntax:
%DATE(date, [date_fmt], storage_fmt)
  • date represents the date value. For example, 930512 or 050912.

  • date_fmt represents the format of the date value. The supported values for entry format are: YYMMDD (the default format), YYYYMMDD, YY, YYYY, YYMM, YYYYMM, MMDDYY, MMDDYYYY, MMYY, MMYYYY, DDMMYY and DDMMYYYY.
    If date_fmt argument is empty it defaults to YYMMDD.

  • storage_fmt represents the storage format of the date field on which you are searching. The following formats are supported: YYMMDD, YYYYMMDD, MMDDYY, MMDDYYYY, DDMMYY, DDMMYYYY.
When a partial date format is used (for example, YY, YYYY, YYMM, YYYYMM, MMYY or MMYYYY) supported storage formats are limited to YYMMDD or YYYYMMDD. Partial date formats are not supported for range operations (they already represent a range).

Below are some examples of the %DATE function.

Convert a YYMMDD date argument into the YYYYMMDD date format:

%DATE(120101,YYMMDD,YYYYYMMDD)
This converts the date 120101 to 20120101. As YYMMDD is the default the date format it may be omitted.
%DATE(120101,,YYYYMMDD)
Convert a century date format into the YYMMDD storage format:
%DATE(01012012,MMDDYYYY,YYMMDD)
The %DATE function also supports partial date formats. When a partial date format is used, odxfind converts the partial date value into an equivalent range operation. The example below converts a partial century date (MMYYYY) into a keyword range.
%DATE(012012,MMYYYY,YYYYMMDD)
This is equivalent to a range of 20120100:20120199.

Unless a partial date format is used, each %DATE expression is treated as a single keyword and may be combined in any of the operations supported for keyword keys. In the example below, two %DATE expressions are combined in a range operation:

%DATE(093012,MMDDYY,YYMMDD):%DATE(123112,MMDDYY,YYMMDD)
Note that partial date formats (like YYMM) may not be used in a range.

Multifind

The "multifind" operation allows to apply item values from previous odxfind search results as search criteria for the FTS field passed in the field parameter.
& [item]
The Multifind operator ( & ) must be specified as the first character in the keywords parameter. An item name may be specified as an option.

The specified FTS field is then searched for item values obtained from a previous FTS search.

  • If the optional item name is not present, the master set search item values are used implicitly. Any FTS results on a linked detail set (unless an aggregated FTS field is used) need to be converted to the master set (using odxfind mode 30). This mode cannot be used for unlinked detail sets.

  • If the optional item is present, the given FTS field is searched for values of the specified item. The FTS search results are consolidated if the item is in a master set to avoid duplicate values.
Multifind requires that the target field in the target data set is an FTS field. The name of the target field for a multifind search is passed via the field parameter, as in any odxfind.

Referencing previous search results

Previous search results may be refined by subsequent searches.
  • For mode 1, start the keyword list with an asterisk ( * ).
  • For mode 3 or 5, start the keyword list with a leading AND or OR operator.
After performing an odxfind you can use an asterisk or a leading AND or OR operator (mode 3 or 5) to reference previous search results. You can then further qualify the list, add to it or subtract from it by specifying additional keywords in Boolean operations.

A leading AND operator (or *, for mode 1) and any keywords that follow it intersects the previous and current search results. A leading OR operator (or *+ for mode 1) and any keywords that follow it add the current search results. A leading AND NOT operator (or *- for mode 1) and any keywords that follow it filters the previous search results by the current search.

To reference previous search results without further qualifying, place an asterisk ( * ) alone in the keyword list.

When no records qualify

If a keyword in the keyword list does not exist for the specified FTS field or group, no entries qualify unless the non-existent keyword is combined with other keywords that do exist via an OR operation. Otherwise ODX status 217 "No entries with keyword" is returned.

Even if all keywords in the list exist, no entries may qualify based on the boolean conditions. For example, no entries qualify if two keyword arguments in an AND operation exist but do not apply to the same record (or same master record for an aggregated FTS field).
Eloquence returns ODX status 217 if no records qualify in a search.

By default, previous search results are retained so a search my be re-tried by the user. However, in batch applications (such as reports) there is typically no way to re-try a search if no records qualify and it may be critical that a keyword search returns no results rather than previous search results.
In this case the odxfind mode option 400 may be used which will cancel previous search results when a search qualifies no records. For example, to perform a mode 5 odxfind without preserving any previous results call odxfind in mode 405.

Undo previous search

After every call to odxfind in mode 1, 2, 3 or 5 (except those that qualify no records) odxfind saves currently qualified and previously qualified results in memory.

Two results are maintained:

  • The odxfind search result just performed
  • The odxfind search results that immediately preceded the search just performed
This allows to undo the most recent odxfind keyword search. For example, if 100 customers initially qualified and the result was subsequently refined to customers in Wuppertal it is possible to undo the last search and re-instate the previous result reflecting 100 customers. One may then retry the search with different arguments.

To back out of the most recent search, call odxfind in mode 1, 2, 3 or 5 and pass a less-than operator ( < ) in the keywords parameter.

Note that you can only back out of the last search performed. Any attempt to perform several undo operations in succession, will result in odxfind returning an error.

odxfind condition codes

205   No undo available
217   No entries with keyword
297   Bad base ID or database not opened
-202   Bad odxfind mode
-203   Bad data set or data set does not use FTS indexing
-205   Bad keyword list (syntax error)
-206   Invalid use of range operator
-209   Bad item specified
-210   Item not an FTS index field
-212   List must contain a generic keyword or keyword range
-214   FTC license not available
-217   Bad number on numeric field
-219   Unmatched quote
-220   Missing terminator (semicolon or blank)
-224   Not a soundex field
-232   Bad or improper multifind link item
-244   No previous search results or incompatible sets

Notes

  • odxfind mode 1, 2 and 3 implement backwards compatibility to older ODX versions. odxfind mode 5 is similar to the TPI DBFIND syntax.

  • Eloquence supports a flexible use of the NOT boolean operator. For example, "NOT testing" qualifies all records that do not contain the testing keyword.
    When using NOT search results are considered an exception list, any records on this list are not qualified. Consequently, when obtaining FTS search results with odxget and an exception list exists the data set is read sequentially, excluding any record on the exception list. This should be used with care as this could result in unexpected database workload when used inadequately.
    Please note that this is different to using a NOT with AND (as in "A AND NOT B"). This use of NOT does not cause any overhead.

  • The Eloquence odxfind "multifind" does not support referencing a file. The odxtransfer call (not supported with Eloquence) could be used to save odxfind search results to a file. This could then be referenced in odxfind by specifying the file name after a leading &. Eloquence uses this syntax to specify an item name.

  • Excluded words are ignored in odxfind and do return ODX status 217 if no records are qualified. If a search for an excluded word is used in a boolean expression it will not influence the result though. For example, "mike and stopword" will return all qualified records for the keyword mike.

  • The Eloquence odxfind call will always return ODX status 217 if no results qualify.

  • Aggregated and non-aggregated fields may be combined in a search. In this case the result is converted to an aggregated result.

  • When converting two to four digit years the %DATE function assumes years below 40 to be relative to the year 2000 and otherwise relative to the year 1900. So 12 is understood as 2012 and 80 is considered 1980.

  • The %DATE function currently does not support the PHDATE, JDATE and ASKDATE storage formats.

odxget

After qualifying records based on the desired list of keywords (with odxfind mode 1, 2, 3 or 5), odxget is then used to obtain the results.

Depending on the mode and data set type, odxget can either move the position in the search results, or move the position and return search items, record numbers, or both, to the calling application.
The search item or record number values are then used to retrieve records using calls to DBGET or DBFIND plus DBGET for detail records.

By default, odxget returns the search item value for master sets or aggregated FTS fields and a record number for detail sets. Mode option 10 returns the record number instead of the search item value so a DBGET mode 4 may be used to retrieve the record. Mode option 20 returns both the search item value and the record number.

odxget(base,mode,status,si_list,si_count)
base
Base is the name of an array used as the base parameter when opening the database.

mode
Mode indicates the type of retrieval and the positioning in the search results.

Mode Description
0 rewind. Resets the position in the search results. If the next operation is a forward read or spacing (mode 1 or 3) results are obtained from the beginning of the list. If the next operation is a backward read or spacing (modes 2 or 4) results are obtained from the end of the results.
If the previous ODXFIND was performed on a record specific field, status word 16 contains the value -1. Otherwise it contains zero.
1 forward read. Reads the next si_count results into the si_list array and updates the internal position.
2 backward read. Reads the previous si_count results into the si_list array and updates the internal position.
3 space forward. Moves the result position forward by the count specified in si_count. Does not return any data.
4 space backward. Moves the result poisition backward by the count specified in si_count. Does not return any data.

Mode options

Mode options may be used to specify how results are obtained. To use a mode option, add its value to the appropriate mode value. For example, to perform a forward read of record numbers after an odxfind on a key in a linked detail set, add mode option 10 to mode option 1 to get mode 11.

  • 10 - returns the record numbers of qualified records.

  • 20 - returns the search item and the record numbers of qualified records.

status
Completion status, 21 16-bit integer words. If the call completed successfully, word 1 is zero. If word 1 is 888 then word 11 holds the ODX condition word.

Element Contents
1 If the procedure succeeds, the return status is 0. Otherwise it provides a status code to describe the failure.
2-10 Unused
11 ODX condition word is zero.
12-13 Number of search item values or record numbers returned in si_list for modes 1-4. Number of qualified FTS references for mode 0.
14 Search item length in bytes.
15 Current data set number.
16 Contains a nonzero value if the previous odxfind was performed on a record specific (not aggregated) FTS field in a detail set; otherwise contains zero.
17-21 Unused

si_list
si_list is the name of the array into which the requested search items or record numbers are moved. The array must be defined as binary or ASCII, depending on the data type of search items to be returned, and must be large enough to hold the number of search items specified by si_count.

si_count
si_count is a single 16-bit word integer (between 1 and 4096) that indicates how many results to move into si_list. If si_count exceeds the number of results all the remaining results are returned. If no results are left odxget returns an error. The status words 12-13 contain the number of results returned.

In mode 3 or 4, si_count specifies the number of positions the pointer is to be moved forward or backward through the results. This number can be between 1 and 32,767. If the requested si_count would move the pointer to a position before the beginning, or past the end an error is returned and the pointer's position is left unchanged.

odxget condition codes

310   Beginning of result list
311   End of result list
397   Bad base ID or database not opened
-300   Bad odxget mode
-303   No preceding odxfind
-304   Bad count
-314   FTC license not available

Notes

  • Eloquence supports obtaining record numbers also for a master set.

  • The max. size of the result buffer pointed to by the si_list parameter is limited to 32000 bytes. odxget will return once the result buffer reaches this limit, indicating the number of results obtained.

odxgetword

odxfind is first called using mode 10 or 11. The keywords parameter specifies a single keyword, a partial keyword or a keyword range.

odxfind mode 10 returns the number of qualifying keywords in the specified range. Mode 11 does not return a count.

odxgetword is then called to move one keyword into the target array. odxgetword may be called repeatedly to retrieve all the keywords in the list. After the last qualifying keyword is reached, an End of Range condition is returned.

odxgetword automatically converts numeric fields into ASCII characters.

odxgetword(base,mode,status,target)
base
Base is the name of an array used as the base parameter when opening the database.

mode
Mode 1 returns the next keyword in ascending sequential order.
Mode 2 in addition returns the number of references.

status
Status is the name of an array of 21 halfwords in which the odxgetword call returns status information. If the call completed successfully, the first element is zero. If the first element is 888 then element 11 holds the ODX condition word.

Element Contents
1 If the procedure succeeds, the return status is 0. Otherwise it provides a status code to describe the failure.
2-10 Unused
11 ODX condition word is zero.
12-13 For mode 2 returns the number of references for the keyword.
14-15 Zero
16-21 Unused

target
Target is a 32 byte buffer into which the keyword is transferred.

odxgetword condition codes

314   End of Range
397   Bad base ID or database not opened
-300   Bad odxgetword mode
-302   No preceding odxfind mode 10 or 11
-314   FTC license not available

Notes

  • The Eloquence odxgetword returns ODX status 314 if no or no more results are available.

  • The Eloquence odxfind mode 10 or 11 support @ to qualify all keywords (also applicable to numeric items) and relational operators.

  • Using odxfind mode 11 and odxgetword mode 1 is more efficient as odxfind mode 10 requires to read the dictionary index twice, first to count the qualifying keywords and a second time to obtain the keywords. odxgetword mode 2 requires to read all references rather than returning on the first reference.

odxinfo

odxinfo returns information on FTS indexes.
odxinfo(base,qualifier,mode,status,buffer)
base
Base is the name of an array used as the base parameter when opening the database.

qualifier
Qualifier is the name of an array, its content depends on the odxfind mode.

mode
Mode is an integer indicating the type of information desired.

1 - Identifies the FTS fields for a data set
2 - Identifies the FTS field groups for a data set
3 - Identifies all data sets linked to the specified master
4 - Identifies all field groups in the specified master or any linked details
5 - Identifies all master sets with FTS fields or detail sets without linked FTS fields for a data base
6 - Identifies all FTS fields that belong to the specified group
7 Identifies FTS fields and options for the specified data set
8 - Indicates the type of ID used for a master or unlinked detail set
9 - Indicates the next "free" ID value for the specified master (not supported)
10 - Indicates the next "unused" ID value for the specified master (not supported)
20 - Indicates number of FTS fields in database
312 - Indicates whether the specified FTS field is a composite field, and the location of composite components

status
Completion status, 21 16-bit integer words. If the call completed successfully, word 1 is zero. If word1 is 888 then word 11 holds the ODX condition word. Word 2 returns number of words returned in info area.

Element Contents
1 If the procedure succeeds, the return status is 0. Otherwise it provides a status code to describe the failure.
2 Number of words transferred to buffer.
3-10 Unused
11 ODX condition word is zero.
12 Call id
13 Mode
14-21 Not used

buffer
Buffer is the name of an array in which the requested information is returned. The contents of the buffer array vary according to the mode parameter used.

odxinfo condition codes

597   Bad base ID or database not opened
-500   Bad odxinfo mode
-501   Bad data set or data set does not use FTS indexing
-502   Data set not a master or unlinked detail
-503   Undefined field group
-505   Invalid FTS field
-514   FTC license not available

Notes

  • Eloquence FTS does not need (and does not support) "alternate IDs". It implements the equivalent of "transparent IDs". As Eloquence does not use hashing there is no need to maintain a separate ID to identify the record.
    Consequently, odxinfo mode 8 returns a hard coded response indicating use of transparent IDs and odxinfo modes 9 and 10 are not available.

  • With Eloquence, each field in a detail set may be configured individually to link to a master set (with the PATH= option). However, only one master set may be specified for a detail set (any fields configured to link to a master set must refer to the same master set). odxinfo assumes that a detail set is in a dataset group if at least one field is linked.

odxinfo mode 1

odxinfo mode 1 identifies the FTS fields for a given set.

Qualifier identifies the data set name or number for which the information is requested. The data set must have FTS fields defined or is a master set that has FTS fields linked to it in related details.

Buffer returns the following (each element is a 16-bit word or two bytes):

------------------------------------------------------
|  Element  |              Content                   |
------------------------------------------------------
|    1      | Set number of the specified data set   |
------------------------------------------------------
|    2      | Set number of the linked master for    |
|           | this set                               |
------------------------------------------------------
|    3      | Item number of the search item         |
|           | for this set                           |
------------------------------------------------------
|    4      | Offset in words of the search item     |
|           | in this set                            |
------------------------------------------------------
|    5      | Number of FTS fields in the set        |
------------------------------------------------------
|    6..n   | Item number of the FTS field           |
------------------------------------------------------
Elements 3 and 4 are zero if the set is a detail set without linked FTS fields (unlinked detail).

The size of the array depends on number of FTS fields in the set (as counted in element 5). One 16-bit word is used for each FTS field.

Notes:

  • Eloquence does not have a defined limit on the number of FTS fields per set.

  • For a master set the search item number and offset identify the search item and its offset into the record buffer. For a linked detail set the search item number and offset identify the detail search item (that is used to link the FTS field) and its offset into the record buffer. For an unlinked detail the search item number and offset are zero.

  • Composite FTS fields use separate item number. Otherwise the data item number is used.

  • Eloquence does not define a separate numeric range for composite FTS fields and index items.

odxinfo mode 2

odxinfo mode 2 identifies the FTS fields and grouping for a given set.

Qualifier identifies the data set name or number for which the information is requested. The data set must have FTS fields defined or is a master set that has FTS fields linked to it in related details.

Buffer returns the following (each element is a 16-bit word or two bytes):

------------------------------------------------------
|  Element  |              Content                   |
------------------------------------------------------
|    1      | Set number of the specified data set   |
------------------------------------------------------
|    2      | Set number of the linked master for    |
|           | this set                               |
------------------------------------------------------
|    3      | Item number of the search item         |
|           | for this set                           |
------------------------------------------------------
|    4      | Offset in words of the search item     |
|           | in this set                            |
------------------------------------------------------
|    5      | Number of FTS fields in the set        |
------------------------------------------------------
|    6..    | Item number of the FTS field           |
------------------------------------------------------
|    7..    | Group number for the FTS field         |
------------------------------------------------------
Elements 3 and 4 are zero if the set is a detail set without linked FTS fields (unlinked detail).

The size of the array depends on number of FTS fields in the set (as counted in element 5). Two 16-bit words are used for each FTS field. The first word returns the FTS item number and the second word the FTS field group id or zero if the field is ungrouped.

Notes:

  • This is substantally the same as odxinfo mode 1 but in addition returns the FTS field group id.

odxinfo mode 3

odxinfo mode 3 identifies all sets in a set group.

Qualifier identifies the data set name or number for which the information is requested. The data set must be a master or unlinked detail set that has FTS fields defined or must be a master set that has FTS fields linked to it in a related detail.

Buffer returns the following (each element is a 16-bit word or two bytes):

------------------------------------------------------
|  Element  |              Content                   |
------------------------------------------------------
|    1      | Set number of the specified data set   |
------------------------------------------------------
|    2      | number of sets in the set group        |
------------------------------------------------------
|    3..    | set number in the set group            |
------------------------------------------------------
The size of the array depends on number of data sets in the set group (as counted in element 2). One 16-bit word is used for each data set.

Notes:

  • Eloquence does not have a defined limit on the number data sets in a set group. It is limited by the PATH limit for a master set (currently 64) plus one entry for the master set.

  • The set must either be a master set with FTS fields or linked FTS fields in a related detail or a detail set without any linked FTS fields.

odxinfo mode 4

odxinfo mode 4 identifies all FTS field groups in a set group.

Qualifier identifies the data set name or number for which the information is requested. The data set must be a master or unlinked detail set that has FTS fields defined or must be a master set that has FTS fields linked to it in a related detail.

Buffer returns the following (each element is a 16-bit word or two bytes):

------------------------------------------------------
|  Element  |              Content                   |
------------------------------------------------------
|    1      | Set number of the specified data set   |
------------------------------------------------------
|    2      | Number of field groups defined for     |
|           | this set group                         |
------------------------------------------------------
|    3..    | Item in field group                    |
------------------------------------------------------
|    4..    | Data set containing the item           |
------------------------------------------------------
The size of the array depends on number of field groups in the set group (as counted in element 2). Two 16-bit words are used for each field group id. The first word is the number of an item in the group. The second word is the data set number containing that item.

Notes:

  • Eloquence does not have a defined limit on the group ID number (other than it must be a positive integer) or the number of group IDs in a set group.

  • Each distinctive field group is listed once per set group. Please note that while FTS fields may use the same group ID number they may be maintained separately, for example aggregated and non-aggregated FTS fields in the same field group are considered different.

  • The set must either be a master set with FTS fields or linked FTS fields in a related detail or a detail set without any linked FTS fields.

odxinfo mode 5

odxinfo mode 5 identifies all set groups in the database.

Qualifier is ignored.

Buffer returns the following (each element is a 16-bit word or two bytes):

------------------------------------------------------
|  Element  |              Content                   |
------------------------------------------------------
|    1      | Number of set groups in the database   |
------------------------------------------------------
|    2..    | Data set number of each set group      |
------------------------------------------------------
A data set is included in the list if it is either a master or unlinked detail set that has FTS fields defined or a master set that has FTS fields linked to it in a related detail.

The size of the array depends on number of set groups in the database (as counted in element 1). One 16-bit word is used for each set group.

Notes:

  • Eloquence does not have a defined limit on the number of set groups per database. It is limited by the number of data sets per database (currently 500).

  • This will list any master set that has either FTS fields or a linked FTS field in a related detail set or any unlinked detail set that has FTS fields defined.

odxinfo mode 6

odxinfo mode 6 identifies the FTS fields for a given set and field group.

Qualifier identifies the data set name or number for which the information is requested followed by a group ID at word 9.
The data set must be a master or unlinked detail set that has FTS fields defined or must be a master set that has FTS fields linked to it in a related detail. The group ID may not be zero.

Buffer returns the following (each element is a 16-bit word or two bytes):

------------------------------------------------------
|  Element  |              Content                   |
------------------------------------------------------
|    1      | Set number of the specified data set   |
------------------------------------------------------
|    2      | Number of fields in the specified      |
|           | field group                            |
------------------------------------------------------
|    3..    | Item number in field group             |
------------------------------------------------------
|    4..    | Data set containing the item           |
------------------------------------------------------
The size of the array depends on number of FTS fields in the set group that use the same group ID (as counted in element 2). Two 16-bit words are used for each FTS field in the given set group and field group ID. The first word is the item number and the second word is the data set number containing that item.

Notes:

  • Eloquence does not have a defined limit on the group ID number (other than it must be a positive integer) or the number of group IDs in a set group.

  • The set must either be a master set with FTS fields or linked FTS fields in a related detail or a detail set without any linked FTS fields.

odxinfo mode 7

odxinfo mode 7 identifies the FTS fields for a given set.

Qualifier identifies the data set name or number for which the information is requested. The data set must have FTS fields defined or is a master set that has FTS fields linked to it in related details.

Buffer returns the following (each element is a 16-bit word or two bytes):

------------------------------------------------------
|  Element  |              Content                   |
------------------------------------------------------
|    1      | Set number of the specified data set   |
------------------------------------------------------
|    2      | Set number of the linked master for    |
|           | this set                               |
------------------------------------------------------
|    3      | Item number of the search item         |
|           | for this set                           |
------------------------------------------------------
|    4      | Offset in words of the search item     |
|           | in this set                            |
------------------------------------------------------
|    5      | Number of FTS fields in the set        |
------------------------------------------------------
|    6..    | Item number of the FTS field           |
------------------------------------------------------
|    7..    | Bit mapped field options               |
------------------------------------------------------
Elements 3 and 4 are zero if the set is a detail set without linked FTS fields (unlinked detail).

The size of the array depends on number of FTS fields in the set (as counted in element 5). Two 16-bit words are used for each FTS field. The first word returns the FTS item number and the second word the FTS field options.

Field options

Bit:length Option Bit Mask
0:1 No Exclude (NE) 0x8000
1:1 No Parse (NP) 0x4000
2:1 Record specific 0x2000
3:1 No Translate (NT) 0x1000
4:1 Soundex (SX) 0x0800
5:3 Not used, zero 0x0700
8:4 Not used, zero 0x00F0
12:4 Field type
0 TEXT (U,X,Z)
1 Integer (I,J)
2 Unsigned integer (K)
3 Packed (P)
4 Real (R), not used
5 IEEE floating point (E)
6 Not used
7 Zoned (Z)
0x000F

Notes:

  • This is substantally the same as odxinfo mode 1 but in addition returns the FTS field options.

odxinfo mode 8

odxinfo mode 8 identifies the item number for the alternate ID field.

Qualifier identifies the data set name or number for which the information is requested. The data set must be a master or unlinked detail set that has FTS fields defined or must be a master set that has FTS fields linked to it in a related detail.

Buffer returns the following (each element is a 16-bit word or two bytes):

------------------------------------------------------
|  Element  |              Content                   |
------------------------------------------------------
|    1      | ID type                                |
|           |  0 - search item or ID                 |
|           | -1 - transparent ID (master)           |
|           | -2 - unlinked detail set               |
------------------------------------------------------
Notes:
  • The set must either be a master set with FTS fields or linked FTS fields in a related detail or a detail set without any linked FTS fields.

  • Eloquence does not need (and does not support) "alternate IDs". It implements the equivalent of "transparent IDs". As Eloquence does not use hashing there is no need to maintain a separate ID to identify the record.
    Consequently, odxinfo mode 8 returns a hard coded response indicating use of transparent IDs and odxinfo modes 9 and 10 are not available.

  • The returned ID type is -1 for a master set or -2 for an unlinked detail set.

odxinfo mode 20

odxinfo mode 20 obtains the number of FTS fields in the database

Qualifier is ignored.

Buffer returns the following (each element is a 16-bit word or two bytes):

------------------------------------------------------
|  Element  |              Content                   |
------------------------------------------------------
|    1      | Number of FTS fields                   |
------------------------------------------------------

odxinfo mode 312

odxinfo mode 312 indicates whether the specified FTS field is a composite field, and the location of composite field components.

Qualifier identifies the data set name or number for which the information is requested followed by a field name or number starting at word 9.

Buffer returns the following (each element is a 16-bit word or two bytes):

------------------------------------------------------
|  Element  |              Content                   |
------------------------------------------------------
|    1      | FTS item number                        |
------------------------------------------------------
|    2      | FTS field group                        |
------------------------------------------------------
|    3      | Length in bytes                        |
|           | For compound items this value          |
|           | represents the sub-item length.        |
------------------------------------------------------
|    4      | Number of components in composite key  |
|           | or compound item                       |
|           | A positive number indicates the        |
|           | number of segments                     |
|           | A negative number indicates a          |
|           | compound (array) field                 |
------------------------------------------------------
|    5..    | Record byte offset of component        |
------------------------------------------------------
|    6..    | Length of component                    |
------------------------------------------------------
Elements 5 and 6 each must contain as many 16-bit words as there are segments counted in element 4.

Notes:

  • Composite FTS fields uses separate item number. Otherwise the data item number is used.

  • Eloquence does not define a specific numeric range for composite FTS item numbers.

  • A positive number returned in element 4 indicates the number of segments. A negative number indicates a compound field (array). For example, for a 5X40 item the value would be -5. In this case only a single segment is present.

Unsupported ODX calls

The following ODX calls are not supported and return ODX status -800.
odxtransfer(base,mode,status,filename,options)
odxprint(filename,keywords,control,status,plabels)
odxview(filename,keywords,control,status,plabels)
odxtransfer was used to transfer odxfind search results to a file that could subsequently be referenced in another odxfind. The Eloquence odxfind uses a different approach to allow applying previous odxfind search results to another set or field.

status is a 21 16-bit integer words array holding the return status. The first element is set to 888 and the eleventh element to -800.


 
 
.
 
 
  Privacy | Webmaster | Terms of use | Impressum Revision:  2016-06-01  
  Copyright © 2012 Marxmeier Software AG