External Level of IMS
External Level of IMS
INTRODUCTION
IMS database has a rule that each segment type can have only one parent. This limits
the complexity of the physical database. Many DL/I applications require a complex structure
that allows a segment to have two parent segment types. To overcome this limitation, DL/I
allows the DBA to implement logical relationships in which a segment can have both
physical and logical parents. We can create additional relationships within one physical
database. The new data structure after implementing the logical relationship is known as the
Logical Database.
A logical relationship is a path between two segments which are related logically
and not physically.
Usually a logical relationship is established between separate databases. But it is
possible to have a relationship between the segments of one particular database.
The following image shows two different databases. One is a Student database, and
the other is a Library database. We create a logical relationship between the Books Issued
segment from the Student database and the Books segment from the Library database.
1
This is how the logical database looks when you create a logical relationship:
LOGICAL TWINS
Logical twins are the occurrences of a logical child segment type that are all
subordinate to a single occurrence of the logical parent segment type. DL/I makes the logical
child segment appear similar to an actual physical child segment. This is also known as a
virtual logical child segment.
2
There are three types of logical relationships:
Unidirectional
Bidirectional Virtual
Bidirectional Physical
Unidirectional
The logical connection goes from the logical child to the logical parent and it cannot
go the other way around.
Bidirectional Virtual
It allows access in both the directions. The logical child in its physical structure and
the corresponding virtual logical child can be seen as paired segments.
Bidirectional Physical
The logical child is a physically stored subordinate to both its physical and logical
parents. To application programs, it appears the same way as a bidirectional virtual logical
child.
CONCATENATED SEGMENT
A logical child segment always begins with the complete concatenated key of the
destination parent. This is known as the Destination Parent Concatenated Key (DPCK). You
need to always code the DPCK at the start of your segment I/O area for a logical child. In a
logical database, the concatenated segment makes the connection between segments that are
defined in different physical databases. A concatenated segment consists of the following two
parts:
3
Destination Parent Concatenated Key (DPCK)
Logical child user data
When we work with concatenated segments during update, it may be possible to add
or change the data in both the logical child and the destination parent with a single call. This
also depends on the rules the DBA specified for the database. For an insert, provide the
DPCK in the right position. For a replace or delete, do not change the DPCK or the sequence
field data in either part of the concatenated segment.
IMS Control Blocks define the structure of the IMS database and a program's access
to them. The following diagram shows the structure of IMS control blocks.
4
DL/I uses the following three types of Control Blocks:
CONCLUSION
Database is a collection of correlated data items. These data items are organized and
stored in a manner to provide fast and easy access. IMS database is a hierarchical database
where data is stored at different levels and each entity is dependent on higher level entities.
IMS database management system maintains integrity and allows fast recovery of data by
organizing it in such a way that it is easy to retrieve. IMS maintains a large amount of world's
corporate data with the help of its database management system.
REFERENCES
http://www.tutorialspoint.com/ims_db/ims_db_control_blocks.htm
www.ibm.com/support/SSEPH2ims13/ims_speclogrellogdbd.htm
http://www.conceptsolutionsbc.com/mvs-articles/37-ibm-mainframe/202-what-is-
an-ims-database-
5
http://support.sas.com/documentation/cdl/en/acims/59519/HTML/default/hierdb.h
tm
http://ibmmainframes.com/about5980.html