TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)
Chapter 5 177
TurboIMAGE/XL Library Procedures
DBFIND
DBFIND
INTRINSIC NUMBER 404
Can be used both when B-Tree index exists on a key item of the master and when B-Tree
index does not exist. For a detailed discussion on B-Trees, refer to chapter 11, "B-Tree
Indices."
In the absence of a B-Tree index, or when the B-Tree index exists but the BTREEMODE1 flag
is off, locates related master set key item entry that matches the specified search item
value and sets up pointers to the first and last entries of a detail data set chain in
preparation for chained access to the data entries which are members of the chain. The
path is determined and the chain pointers are located on the basis of a specified search
item and its value.
When a B-Tree index exists for the master (explicit), DBFIND can be used for B-Tree
searches both for the master data set as well as its corresponding detail data sets
(implicit). The
dset
parameter determines if the DBFIND is for the master or one of its
corresponding detail data sets. A B-Tree DBFIND using mode 1 on binary items (not X or U)
will be treated as non-B-Tree search regardless of the presence of a B-Tree index as well as
the BTREEMODE1 option. To do B-Tree index searches on binary items, use modes 4 or 24 in
conjunction with a structured argument.
Syntax
DBFIND,
base,dset,mode,status,item,argument
Parameters
base
is the name of the array used as the base parameter when opening the
database. The first element of the array must contain the base ID returned
by DBOPEN. (Refer to DBOPEN for more information about base ID.)
dset
is the name of an array containing the left-justified name of the master or
the detail 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 or a blank.
mode
must be an integer equal to 1, 4, 10, 21, or 24. If your database is enabled
for third-party indexing, refer to your vendor's documentation for
additional DBFIND modes.
Mode Method
1 Used for both B-Tree or non-B-Tree DBFIND. Perform a
B-Tree DBFIND if ALL of the following conditions prevail:
• Item type is X or U (ASCII).
• DBFIND is for master and a B-Tree index exists on the
key item or DBFIND is for detail and B-Tree index exists