Mapping TurboIMAGE 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 TurboIMAGE Into System Dictionary
The TurboIMAGE objects listed in Figure 7-1 are supported in the core set
of the System Dictionary. For each of these objects, an example is
provided to show how to define each object in the dictionary. All of the
examples for these TurboIMAGE objects refer to the database in Figure
7-2.
_____________________________________
| |
| data item |
| |
| data set |
| |
| chain |
| |
| search item |
| |
| sort item |
| |
| path |
| |
| user class |
| |
| password |
| |
| data item class list |
| |
| data set class list |
| |
| database |
| |
_____________________________________
Figure 7-1. TurboIMAGE Objects
_________________________________________________
| |
| begin data base 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)),|
| TOTAL, |
| PURCH-DATE(!DATE-MAST), |
| DELIV-DATE(DATE-MAST); |
| capacity: 101; |
| |
| end. |
| |
_________________________________________________
Figure 7-2. STORE TurboIMAGE 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 an 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 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 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.
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 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 data set is defined by the image-dataset key
element relationship type. That is, the element (search item) is related
to the MANUAL 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 detail data set the chain is in
2. ) The search item
3. ) The sort item, if any
4. ) The path to a master 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 on N-ary (3, 4, 5, and 6-way) relationships 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.
User Class Number
A user class number is defined as an image-class entity. Note that in
the dictionary the class can be given a name instead of the actual image
class number. Password is specified in the image-class attribute
password. The user class number is stored in the image-class attribute
class-number.
Example
To define the user 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 using the ELEMENT contains IMAGE-CLASS
relationship type with access equal to W.
Data Item 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 W for CLERICAL and R
for BUYER.
Database
A database is an image-database entity. The image-database contains
image-dataset relationship type defines which data sets are contained in
an TurboIMAGE data base. Attributes of this relationship type are block
and capacity.
Example
To define the TurboIMAGE database STORE, create the image-database STORE.
To establish which data sets are in STORE, relate the data sets CUSTOMER,
DATE-MAST and SALES to database STORE using the image-database contains
image-dataset relationship type. For each of these relationships, the
attribute CAPACITY is set to 101.
Figure 7-3
MPE/iX 5.0 Documentation