All item names in a self-describing file must be unique unless
all the duplicate items are in data item equivalences. (Refer to
the JOIN command for more information on data item equivalences.)
Entries retrieved with a FIND have unique item names because
they are retrieved from a single data set. However, entries retrieved
with a MULTIFIND may have duplicate item names because they are
retrieved from more than one data set. The duplicate items must have
been used in the JOIN data item equivalence(s). An exception is
made because the duplicate items are of the same value although
they may be of different data types.
The first occurence of the item in the compound data set entry
is the one recorded in the item description. Other occurences are
skipped because the item has already been described. The data in
the file contains all occurences of the data item even though the item
description appears only once. The offset reflects the first location
in the record where the data item value can be accessed.
Refer to example 2 for a self-describing file created from
a MULTIFIND where the JOIN item names are identical.
Examples
Example 1 - Single Data Set Retrieval
Given the following IMAGE data base:
BEGIN DATA BASE SD;
PASSWORDS:
ITEMS:
NAME, U10;
OCCUP, U16;
CITY, U10;
STATE, I2; << contains a numeric code for each state >>
SETS:
NAME: SET1, D;
ENTRY: NAME, OCCUP, CITY, STATE;
CAPACITY: 11;
END.
and the following FIND and SAVE commands:
>FIND STATE=2 OR STATE=3
USING SERIAL READ
4 ENTRIES QUALIFIED
>SAVE SAVEFILE
the SD file, SAVEFILE, appears as follows:
------------------------------
| labels 0-9 |
------------------------------
| item description label |
------------------------------
| global information label |
------------------------------
| |
| data |
| |
------------------------------
where the global information label contains:
(version) (length) (#items) (#labels) (#items/label) (size)
------------------------------------------------------------------
| A.00.00 | 38 | 4 | 2 | 8 | 15 |
------------------------------------------------------------------
and the item description label contains:
(name) (type) (offset) (length) (unused)
--------------------------------------------------------
| NAME | 1 | 0 | 10 | 0 |
--------------------------------------------------------
| OCCUP | 1 | 10 | 16 | 0 |
--------------------------------------------------------
| CITY | 1 | 26 | 10 | 0 |
--------------------------------------------------------
| STATE | 3 | 36 | 2 | 0 |
--------------------------------------------------------
and the data in the file is (binary data is represented as periods):
M FULLER ENGINEER CUPERTINO ..
H THOREAU ENGINEER SAN DIEGO ..
W EMERSON ENGINEER FT COLLINS..
G SAND TECH WRITER CUPERTINO ..
Example 2 - Compound Data Set Retrieval
Given the following IMAGE data base:
BEGIN DATA BASE SD2;
PASSWORDS:
ITEMS:
NAME, U10;
OCCUP, U16;
CITY, U10;
STATE, I1;
NAME2, U10;
OCCUP2, U16;
CITY2, U10;
SETS:
NAME: SET1, D;
ENTRY: NAME, OCCUP, CITY, STATE;
CAPACITY: 11;
NAME: SET2, D;
ENTRY: NAME2, OCCUP2, CITY2, STATE;
CAPACITY: 11;
END.
and the following JOIN, MULTIFIND, and SAVE commands:
>JOIN SET1.STATE TO SET2.STATE
>MU STATE=2 OR STATE=3
USING SORT/MERGE
USING SERIAL READ
10 COMPOUND ENTRIES QULIFIED
>SAVE SAV2FILE
the SD file, SAV2FIL would look like this:
------------------------------
| labels 0-9 |
------------------------------
| item description label |
------------------------------
| global information label |
------------------------------
| |
| data |
| |
------------------------------
where the global information label contains:
(version) (length) (#items) (#labels) (#items/label) (size)
------------------------------------------------------------------
| A.00.00 | 74 | 7 | 2 | 8 | 15 |
------------------------------------------------------------------
and the item description label contains:
(name) (type) (offset) (length) (unused)
--------------------------------------------------------
| NAME | 1 | 0 | 10 | 0 |
--------------------------------------------------------
| OCCUP | 1 | 10 | 16 | 0 |
--------------------------------------------------------
| CITY | 1 | 26 | 10 | 0 |
--------------------------------------------------------
| STATE | 3 | 36 | 2 | 0 |
--------------------------------------------------------
| NAME2 | 1 | 38 | 10 | 0 |
--------------------------------------------------------
| OCCUP2 | 1 | 48 | 16 | |
--------------------------------------------------------
| CITY2 | 1 | 64 | 10 | 0 |
--------------------------------------------------------
and the data in the file is (binary data is represented as periods):
M FULLER ENGINEER CUPERTINO ..M FULLER2 ENGINEER CUPERTINO
M FULLER ENGINEER CUPERTINO ..H THOREAU2ENGINEER CUPERTINO
M FULLER ENGINEER CUPERTINO ..G SAND2 TECH WRITER CUPERTINO
H THOREAU ENGINEER SAN DIEGO ..M FULLER2 ENGINEER CUPERTINO
H THOREAU ENGINEER SAN DIEGO ..H THOREAU ENGINEER CUPERTINO
H THOREAU ENGINEER SAN DIEGO ..G SAND2 TECH WRITER CUPERTINO
G SAND TECH WRITER CUPERTINO ..M FULLER2 ENGINEER CUPERTINO
G SAND TECH WRTIER CUPERTINO ..H THOREAU2ENGINEER CUPERTINO
G SAND TECH WRITER CUPERTINO ..G SAND2 TECH WRITER CUPERTINO
W EMERSON ENGINEER FT COLLINS..W EMERSON2ENGINEER FT COLLINS
|