Mapping HP IMAGE Into System Dictionary [ HP System Dictionary XL Gen. Ref. Vol. 1 ] MPE/iX 5.0 Documentation
HP System Dictionary XL Gen. Ref. Vol. 1
Mapping HP IMAGE Into System Dictionary
The System Dictionary core set supports the HP IMAGE objects listed below
in Figure 7-4. This subsection provides a description and an example of
each of these objects, to show how to define them in the dictionary. All
of the examples for these HP IMAGE objects refer to the database in
Figure 7-5.
_____________________________________
| |
| data item |
| |
| data set |
| |
| chain |
| |
| search item |
| |
| SEARCH ITEM |
| |
| sort item |
| |
| path |
| |
| security class |
| |
| password |
| |
| data item class list |
| |
| data set class list |
| |
| database |
| |
| DBEnvironment |
| |
| DBEFile |
| |
_____________________________________
Figure 7-4. HP IMAGE Objects
____________________________________________________________
| |
| begin database STORE; |
| |
| |
| passwords: |
| |
| 1 clrk; << CLERICAL class >> |
| 2 bbb12; << BUYER class >> |
| 3 mgr; << MANAGER class >> |
| |
| |
| items: |
| |
| ACCOUNT, J2; |
| CITY, X40 (1,2/3); |
| DATE, X6; |
| DELIV-DATE, X6 (/1); |
| NAME, 3X30; |
| PURCH-DATE, X6 (2/1); |
| TOTAL, J2; |
| |
| |
| sets: |
| |
| name: CUSTOMER, manual (1/2,3); |
| entry: ACCOUNT(1), |
| NAME, |
| CITY; |
| capacity: 101; |
| |
| name: DATE-MAST,automatic; |
| entry: DATE(2); |
| capacity: 101; |
| |
| name: SALES, detail (2/1); |
| entry: ACCOUNT(CUSTOMER(PURCH-DATE,DELIV-DATE)),|
| TOTAL, |
| PURCH-DATE(!DATE-MAST), |
| DELIV-DATE(DATE-MAST); |
| capacity: 101; |
| |
| end. |
| |
____________________________________________________________
Figure 7-5. STORE HP IMAGE Database Schema
Data Item
A data item is an ELEMENT entity. The sub-item count, type designator
and sub-item length of a data item is stored in the ELEMENT attributes
count, element-type and byte-length, respectively.
Example
To define the data item NAME, create the ELEMENT NAME with the following
attributes:
count = 3
element-type = X
byte-length = 30
Data Set
A data set is a IMAGE-DATASET entity. The data set type is stored in the
data set attribute image-dataset-type. A manual master data set has
the image-dataset-type MANUAL. An automatic master data set has
the image-dataset-type AUTOMATIC. A relation data set has the
image-dataset-type RELATION. A detail data set has the image-dataset-type
DETAIL.
For each data set there should be a RECORD entity occurrence that defines
the record layout for that data set entry. Each ELEMENT (data item) that
is in that data set should be related to the RECORD with a specified byte
offset for the relative position of that ELEMENT within that RECORD. The
RECORD should be related to the MANUAL, AUTOMATIC, RELATION, or DETAIL
data set entity occurrence that it describes. This relationship is
established with the IMAGE-DATASET contains RECORD relationship type.
Typically, only one record is related to a data set to define a data set
entry layout. However, you have the flexibility of defining more than
one record layout for an IMAGE-DATASET entity. Each IMAGE-DATASET can
have one primary record layout which is indicated with the IMAGE-DATASET
contains RECORD relationship type attribute primary-record. To define
the DBEFiles associated to a data set, use the IMAGE-DATASET contains
HPDBE-FILE relationship type.
Example
To define the data set CUSTOMER, create the data set CUSTOMER with
image-dataset-type equal to MANUAL.
Create the RECORD CUSTOMER-REC to define the record layout of data set
CUSTOMER.
Create each of the ELEMENTs ACCOUNT, NAME and CITY.
Relate each of these ELEMENTs to RECORD CUSTOMER-REC using the RECORD
contains ELEMENT relationship type. The byte-offset for ACCOUNT is 1,
for NAME is 5, for CITY is 95.
Relate CUSTOMER-REC to CUSTOMER using the IMAGE-DATASET contains RECORD
relationship type.
Search Item
The search item of a master or relation data set is defined by the
IMAGE-DATASET key ELEMENT relationship type. That is, the ELEMENT
(search item) is related to the MANUAL or RELATION data set for which it
is a key. Note that the primary record layout for this data set should
contain this ELEMENT. Also note that there is no need to establish a key
for an AUTOMATIC data set since the primary record layout should contain
only the search item.
Example
To define the search item for data set CUSTOMER, relate the ELEMENT
ACCOUNT to the data set CUSTOMER with the IMAGE-DATASET key ELEMENT
relationship type.
Chain
Every chain within a detail data set is fully defined by:
1. ) The child (detail or relation) data set the chain is in
2. ) The search item
3. ) The sort item, if any
4. ) The path to a parent (master or relation) data set
5. ) The database the chain is in
This is considered a five-way relationship. To define this five-way
relationship in the dictionary, use the five-way relationship type:
image-dataset
element
element
image-dataset
image-database
where the relationship class is chains. Note that the order of these
entity types is very important. Information regarding the order of
entity types in a relationship type is located in Chapter 3 of this
manual.
Example
To define the ACCOUNT chain in data set SALES, relate the detail data set
SALES, the ELEMENT ACCOUNT, the ELEMENT PURCH-DATE, the data set
CUSTOMER, the database STORE, in that order, with the relationship class
chains. To indicate that this is the primary path, set the attribute
primary-flag to true.
Note that there is more than one sort item for this path. To define the
second sort item, create the exact same relationship just described
except for the sort item, as follows: Relate the detail data set SALES,
the ELEMENT ACCOUNT, the ELEMENT DELIV-DATE, the data set CUSTOMER, the
database STORE, in that order. The attribute relationship-position keeps
track of the order of the sort items.
Security Class Number
A security class number is defined as an IMAGE-CLASS entity. Note that
in the dictionary you must give the class a name and you should reference
the class by that name, not the Image class number. Password is an
IMAGE-CLASS attribute.
Example
To define the security class number 1, create the IMAGE-CLASS CLERICAL
(or any name that implies which class this is) with password equal to
clrk, and class-number equal to 1. To establish that class-number 1 is
in database STORE, use the relationship type IMAGE-DATABASE contains
IMAGE-CLASS.
Data Item Class List
A data item class list is defined by the ELEMENT contains IMAGE-CLASS
relationship type. An ELEMENT (data item) should be related to each
IMAGE-CLASS in its class list with READ/WRITE access specified in the
ELEMENT contains IMAGE-CLASS relationship type attribute access.
Example
To define the class list for ELEMENT DELIV-DATE, relate the ELEMENT
DELIV-DATE to the class CLERICAL with the ELEMENT contains IMAGE-CLASS
relationship type with access equal to WRITE.
Data Set Class List
A data set class list is defined by the IMAGE-DATASET contains
IMAGE-CLASS relationship type. A data set should be related to each
class in its class list with READ/WRITE access specified in the
IMAGE-DATASET contains IMAGE-CLASS relationship type attribute access.
Example
To define the class list for data set SALES, relate the data set SALES to
the classes CLERICAL and BUYER using the IMAGE-DATASET contains
IMAGE-CLASS relationship type with access equal to WRITE for CLERICAL and
READ for BUYER.
Database
A database is a IMAGE-DATABASE entity. The IMAGE-DATABASE contains
IMAGE-DATASET relationship type defines which datasets are contained in
an IMAGE database. Attributes of this relationship type are BLOCK and
CAPACITY.
Example
To define the Image database STORE, create the IMAGE-DATABASE STORE.
To establish which data sets are in STORE, relate the IMAGE-DATASETs
CUSTOMER, DATE-MAST and SALES to IMAGE-DATABASE STORE using the
IMAGE-DATABASE contains IMAGE-DATASET relationship type. For each of
these relationships, set the attribute CAPACITY to 101.
DBEnvironment
A DBEnvironment is a HPDBENVIRONMENT entity. The HPDBENVIRONMENT
contains IMAGE-DATABASE relationship type defines which databases are
contained in an DBEnvironment. The HPDBENVIRONMENT contains
HPDBE-LOGFILE relationship type defines which log files are contained in
a DBEnvironment.
Figure 7-6
MPE/iX 5.0 Documentation