Index Files (Menu item File/Open/Index File)
Hyperlinks:
The programs created with Ebus-J can access sequential
and Random files as well as Ebus Index Files (ISAM files) and (via JDBC) any
SQL databases.
Each Ebus Index File <name> consists of 3
physical files:
|
<name> |
contains the data with file type Ebus. |
|
|
|
|
<name>.i1 |
contains the indices. |
|
|
|
|
<name>.ebu |
contains the index structure. |
These three files are logically summarized into
one Index File by the Ebus-J. Only the logical file format is important for the
user, the physical data access is generated by Ebus-J. Therefore, the
descriptions of the Index Files must be recorded in the Index File
administration.
Sequential and random files
are not recorded in the Index File administration. They can be called with the
programming language of the Ebus-J by the instructions OPEN, INPUT, LINE INPUT, OUTPUT, PUT, GET and CLOSE.
The descriptions of Index Files are saved in
the library ebusdlib. Each time a new
working directory is used with the program generation, a new file library is
created automatically.
Note: The Ebus-J needs the Index File
description for the generation of
the program; it contains the name and the format of the Index File. While
the Ebus program is running, an Index File (which is completely
independent of the file library ebusdlib) with the respective filename is
opened. The data sets are saved in this Index File.

Filename: The
file name of an Index File must begin with a letter and may contain letters and
numbers only.
Button 'Save':
Data are saved and program execution continues at Filename.
Button 'Cancel':
Changed data are not saved and program execution continues at Filename.
Key <Esc>: Program
execution returns to Filename. If data have been changed, the
user will be asked first if the changes shall be saved.
The following function keys (Icons) are
available:
F2: Select Index File
F3:
Scroll forward: next file name
F4:
Scroll backward: previous file name
F5:
Delete: The entire Index File specification is deleted after confirmation.
Note: With
deleting a file description the description is deleted only, not the index
file.
F7: Select Index File
(History)
F8: Copy
Index File
F9: Print Index File

Every Index File cannot contain more than 2 to
the power of 64 data sets.
Every data set consists of any number of
fields. There are 3 different field types:
1) alphanumeric (Length maximum
99999 Byte)
2) numeric (Length maximum 15
Byte)
3) Date (Length 6 or 8 Byte)
The sum of the field lengths of all fields
defined in an Index File is the length of the data set.
The data are filed in the fields in ASCII
notation and also saved like this on the hard disk.
Texts in alphanumeric fields are saved left
justified and filled up with blanks.
Numbers in alphanumeric fields are saved as
decimal numbers. Positive numbers are saved without sign; negative numbers are
saved with sign. The number may be filled up with leading zeros in order to
fill the field completely.
|
Example: Field length 6 |
-00123 |
With fields with post decimal positions the
decimal point is not saved. Only the numbers are saved.
Example:
|
Field length 6, 2 post decimal positions |
|
|
Value |
saved string of characters |
|
- 1.23 |
-00123 |
Date fields are numeric fields and are always
saved in the format YYYYMMDD (Length 8) or YYMMDD (Length 6) by Ebus-J.
Example:
|
Date |
saved value |
|
28.07.1991 |
19910728 |
Each record of an Index File is composed of
several fields.
Each field consists of the following parts:
Field Name: The
field name is used for accessing the field of an Index File. In the macros
fields of Index Files can be accessed with <Filename>.<Fieldname>.
The field name may contain letters, numbers and dots only.
Alphanumeric fields of Index Files must end with '$'.
Type:
Specifies the field type of the Index File. There are 3 field types:
A = alphanumeric
N = numeric
D = date
Length:
Specifies the whole length (decimals included) of the field. With numeric
fields (N) the maximal length is 15. With date fields (D) only 2 different
lengths are allowed: 6 (MM/DD/YY) and 8 (MM/DD/YYYY).
PDP:
PDP means "post decimal positions"; they need to be specified with
numeric fields (N) only. Length is the whole length of the field,
PDP must therefore be <= Length.
Remark:
The remark is used for information only. With memo fields (Dbase) the
first entry must be MEMO in capital letters; after that any kind of text can be
entered. With logical field (Dbase) the first entry must be LOGIC
in capital letters; after that any kind of text can be entered.
Tab File Type

The file type specifies which format is used
for the Index File when the program is running.
The Dbase-III format is used for the file type
"Dbase". However, only the data file <FILENAME>.dbf is created
in Dbase-III format, the index (<FILENAME>.i1) is created in Ebus format.
With
the file type JDBC the Index File is opened in a SQL database. The required parameters
can be set by the following commands:
JDBC_DRIVER specifies the JDBC driver for SQL
database access.
JDBC_DATABASE specifies the name of the
database in which the Index File is opened.
JDBC_TABLE specifies the table name in the
database.
JDBC_USERID specifies the user name for
database access.
JDBC_PASSWORD specifies the password for
database access.
The following restrictions apply to Dbase:
The field name may not exceed 10 characters.
6-digit date fields are not allowed.
Memo
fields contain the type <A> (alphanumeric) and are exactly 10 units long. The first entry under
"Remark" must be MEMO in capital letters; after that any kind of text can be entered. Memo
fields can only be written with the
instruction PUT_MEMO and can only be read with
the function GET_MEMO$
Logic
fields contain the type <A> (alphanumeric) and are exactly 1 unit long. The first entry under
"Remark" must be LOGIC in capital letters; after that any kind of text can be entered.
Import Dbase File Description from file: Specifies the dbase file name from which the dbase file description is
imported.
Button ' Import Dbase File Description ': The dbase file description is imported from the specified file.
Tab Keys

Every data set of an Index Files is clearly
identified by a primary key. In addition, up to 32 secondary keys exist.
A key consists of up to 10 fields of the data
set. The key length is the sum of the field lengths. It may not exceed 100
bytes.
The contents of the fields of the key are the
value of the key, by which the sorting order of the data sets is specified. The
values of the primary key must be unique for every data set. Secondary keys can
be ambiguous, which means that several data sets may have the same secondary
key value. Within similar secondary key values the sorting order is random.
Since key values of numeric fields are
calculated according to their ASCII notation, the higher number corresponds to
the higher key value with positive numbers. Since the ASCII value of the minus
sign is lower than that of zero, all negative numbers have a lower key value
than positive numbers. However, negative numbers with a higher absolute value
have a higher key value than negative numbers with a lower absolute value,
because the ASCII values of the decimal numbers rise with their value.
Example:
|
Number |
ASCII display |
|
- 1 |
-00001 lowest
key value |
By saving date fields in the way YYMMDD or
YYYYMMDD the higher date has the higher key value.
For each Index File a primary key has to be
specified.
The primary key must be unique for every
record; it identifies the respective record.
Additionally, up to 32 secondary keys can be
defined. Secondary keys do not have to be unique, which means that several
records can have the same secondary key.
Every key can consist of up to 10 fields of the
Index File. The size of a key may not exceed 100 bytes.
With F2 a selection window is opened in
the mask fields Field Name.
Button 'New Secondary Key': A new secondary key is created.
Button 'Delete Key': The current secondary key is deleted. The primary key cannot be
deleted.
Distinguish between capital and small letters: If this checkbox is set, small and capital letters are differentiated in
alphanumeric fields.
Example:
The name "John" is saved in a record. If you try to read the record
with a respective key and the respective field is defined as "JOHN",
the record cannot be found, since "John" and "JOHN" are
read as different strings.
Tab Description

Here you can add a short and a detailed description
of the Index File.
The short description is displayed with the
file selection.
The detailed description gives information
only, it has no influence on the run of the program.