Page 1 of 1

'Parentage' in IMS Database.

Posted: Fri Nov 27, 2020 5:34 pm
by Munish Sharma
Hi,

Many a times I've seen my Team lead making use of the phrases like 'setting up' the parentage in IMS database. What exactly does it mean? And why do we need to set-up the parentage, what happens if it is not set-up, can someone please guide me.

Re: 'Parentage' in IMS Database.

Posted: Sat Nov 28, 2020 9:56 pm
by Anuj Dhawan
The search for the requested segment is limited to the dependents of the lowest-level segment most recently accessed by a GU or GN call. Parentage determines the end of the search and is in effect only following a successful GU or GN call.

You can set parentage in two ways:
  1. By issuing a successful GU or GN call. When you issue a successful GU or GN call, IMS sets parentage at the lowest-level segment returned by the call. Issuing another GU or GN call (but against a different PCB) does not affect the parentage that you set using the first PCB in the previous call. An unsuccessful GU or GN call cancels parentage.
  2. By using the P command code with a GU, GN, or GNP call, you can set parentage at any level.

Re: 'Parentage' in IMS Database.

Posted: Sat Nov 28, 2020 10:07 pm
by Anuj Dhawan

Re: 'Parentage' in IMS Database.

Posted: Tue Dec 01, 2020 10:17 pm
by Robert Sample
IMS, unlike DB2 and most recent databases, is hierarchical and not relational. A hierarchical database has a root node and every data group attaches at a lower level (possibly several levels down depending upon the definition of the database). The parent is the data group at the next higher level (hence the ultimate parent is the root node).