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 allos a segment to have to parent segment types. To overcome this limitation! DL/I allos allos the D"# to implem implement ent logical logical relations relationship hipss in hich hich a segmen segmentt can have have both both physical and logical parents. $e can create additional relationships ithin one physical database. The ne data structure after implementing the logical relationship is %non as the Logical Database.
LOGICAL RELATIONSHIP AND DATABASES DATABASES # logical relationship has the folloing properties& •
# logical logical relationship relationship is a path beteen to segments hich are related logically
•
and not physically. 'sually a logical logical relationship relationship is established established beteen separate databases. "ut it is possible to have a relationship beteen the segments of one particular database.
The folloing image shos to different databases. (ne is a Student database! and the other is a Library database. $e create a logical relationship beteen the "oo%s Issued segment from the Student database and the "oo%s segment from the Library database.
1
This is ho the logical database loo%s hen you create a logical relationship&
LOGICAL CHILD SEGMENT Logical child segment is the basis of a logical relationship. It is a physical data segment but for DL/I! it appears as if it has to parents. The "oo%s segment in the above example has to parent segments. Issued boo%s segment is the logical parent and Library segment is the physical parent. (ne logical child segment occurrence has only one logical parent segment occurrence and one logical parent segment occurrence can have many logical child segment occurrences.
LOGICAL TWINS Logical tins 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 ma%es the logical child segment appear similar to an actual physical child segment. This is also %non as a virtual logical child segment.
TYPES OF LOGICAL RELATIONSHIPS # D"# creates logical relationships beteen segments. To implement a logical relationship! the D"# has to specify it in the D"D)*+s for the involved physical databases.
2
There are three types of logical relationships& •
'nidirectional
•
"idirectional ,irtual
•
"idirectional -hysical
Unidirection!
The logical connection goes from the logical child to the logical parent and it cannot go the other ay around. Bidirection! Virt"!
It allos access in both the directions. The logical child in its physical structure and the corresponding virtual logical child can be seen as paired segments. Bidirection! P#$%ic!
The logical child is a physically stored subordinate to both its physical and logical parents. To application programs! it appears the same ay as a bidirectional virtual logical child.
CONCATENATED SEGMENT # logical child segment alays begins ith the complete concatenated %ey of the destination parent. This is %non as the Destination -arent oncatenated ey 0D-1. 2ou need to alays code the D- at the start of your segment I/( area for a logical child. In a logical database! the concatenated segment ma%es the connection beteen segments that are defined in different physical databases. # concatenated segment consists of the folloing to parts& • •
Logical child segment Destination parent segment
# logical child segment consists of the folloing to parts&
3
• •
Destination -arent oncatenated ey 0D-1 Logical child user data
$hen e or% ith concatenated segments during update! it may be possible to add or change the data in both the logical child and the destination parent ith a single call. This also depends on the rules the D"# specified for the database. 3or an insert! provide the D- in the right position. 3or a replace or delete! do not change the D- or the sequence field data in either part of the concatenated segment.
PROGRAM COMMUNICATION BLOC&S IMS ontrol "loc%s define the structure of the IMS database and a program4s access to them. The folloing diagram shos the structure of IMS control bloc%s.
4
DL/I uses the folloing three types of ontrol "loc%s& • • •
CONCLUSION Database is a collection of correlated data items. These data items are organi5ed and stored in a manner to provide fast and easy access. IMS database is a hierarchical database here data is stored at different levels and each entity is dependent on higher level entities. IMS database management system maintains integrity and allos fast recovery of data by organi5ing it in such a ay that it is easy to retrieve. IMS maintains a large amount of orld4s corporate data ith the help of its database management system.