Beruflich Dokumente
Kultur Dokumente
All statements in the physical DBD are coded with the same format used when a logical relationship is not
defined, except for the SEGM and LCHILD statements. The SEGM statement, which describes a segment
and its length and position in the database hierarchy, is expanded to include the new types of pointers.
The LCHILD statement is added to define the logical relationship between the two segment types.
In the SEGM statements of the examples associated with the following figures, only the pointers required
with logical relationships are shown. No pointers required for use with HD databases are shown. When
actually coding a DBD, you must ask for these pointers in the PTR= parameter. Otherwise, IMS™ will not
generate them once another type of pointer is specified.
1 of 3 11/04/2015 01:10 PM
IMS V13 - Database administration - Specifying lo... https://www-01.ibm.com/support/knowledgecente...
This is the hierarchical structure of the two databases involved in the logical relationship. In this example,
we are defining a unidirectional relationship using symbolic pointing. ORDITEM has an LPCK and fixed
intersection data, and DELIVERY and SCHEDULE are variable intersection data.
DBD NAME=ORDDB
SEGM NAME=ORDER,BYTES=50,FREQ=28000,PARENT=0
FIELD NAME=(ORDKEY,SEQ),BYTES=10,START=1,TYPE=C
FIELD NAME=ORDATE,BYTES=6,START=41,TYPE=C
SEGM NAME=ORDITEM,BYTES=17,PARENT=((ORDER),(ITEM,P,ITEMDB))
FIELD NAME=(ITEMNO,SEQ),BYTES=8,START=1,TYPE=C
FIELD NAME=ORDITQTY,BYTES=9,START=9,TYPE=C
SEGM NAME=DELIVERY,BYTES=50,PARENT=ORDITEM
FIELD NAME=(DELDAT,SEQ),BYTES=6,START=1,TYPE=C
SEGM NAME=SCHEDULE,BYTES=50,PARENT=ORDITEM
FIELD NAME=(SCHEDAT,SEQ),BYTES=6,START=1,TYPE=C
DBDGEN
FINISH
END
DBD NAME=ITEMDB
SEGM NAME=ITEM,BYTES=60,FREQ=50000,PARENT=0
FIELD NAME=(ITEMKEY,SEQ),BYTES=8,START=1,TYPE=C
LCHILD NAME=(ORDITEM,ORDDB)
DBDGEN
FINISH
END
In the ORDER database, the DBD coding that differs from normal DBD coding is that for the logical child
2 of 3 11/04/2015 01:10 PM
IMS V13 - Database administration - Specifying lo... https://www-01.ibm.com/support/knowledgecente...
ORDITEM.
1. The BYTES= parameter is 17. The length specified is the length of the LPCK, plus the length of
the fixed intersection data. The LPCK is the key of the ITEM segment, which is 8 bytes long. The
length of the fixed intersection data is 9 bytes.
2. The PARENT= parameter has two parents specified. Two parents are specified because
ORDITEM is a logical child and therefore has both a physical and logical parent. The physical
parent is ORDER. The logical parent is ITEM, specified after ORDER. Because ITEM exists in a
different physical database from ORDITEM, the name of its physical database, ITEMDB, must be
specified. Between the segment name ITEM and the database name ITEMDB is the letter P. The
letter P stands for physical. The letter P specifies that the LPCK is to be stored on DASD as part of
the logical child segment.
1. ITEMNO is the sequence field of the ORDITEM segment and is 8 bytes long. ITEMNO is the
LPCK. The logical parent is ITEM, and if you look at the FIELD statement for ITEM in the ITEM
database, you will see ITEM's sequence field is ITEMKEY, which is 8 bytes long. Because ITEM is
a root segment, the LPCK is 8 bytes long.
2. ORDITQTY is the fixed intersection data and is coded normally.
In the ITEM database, the DBD coding that differs from normal DBD coding is that an LCHILD statement
has been added. This statement names the logical child ORDITEM. Because the ORDITEM segment
exists in a different physical database from ITEM, the name of its physical database, ORDDB, must be
specified.
Related concepts:
PSBs, PCBs, and DBDs in logical relationships
3 of 3 11/04/2015 01:10 PM