Page 1 of 1

Explain with sample records about GU,GN,GNP call

PostPosted: Tue Jan 29, 2008 7:19 pm
by whale
Can anyone explain with sample records about GU,GN,GNP calls ?
i have known theoretically but i want this info with sample records.

Re: Explain with sample records about GU,GN,GNP call

PostPosted: Wed Jan 30, 2008 5:26 pm
by whale
I learnt myself,here are the explanation.

GU - It is dynamic fetching a record from IMS DataBase.Once the call over if you try to give one more GU call , the search will start from ROOT segment . This is the drawback of more then one GU call in one program.

GN-It is sequential fetching . If you give first time GN call fetch will start from root otherwise it will start from where the database pointer positioned previously.Fetching is done till the last record for both quallified as well as unqualified ssa.

GNP-After assign the parentage (by using GU or GN ) the GNP calls will fetch the all dependent segment occurance of the
parent segment.Status code never be GA .

Re: Explain with sample records about GU,GN,GNP call

PostPosted: Wed Jan 30, 2008 5:39 pm
by whale
After understanding the theroy here is the Example.
             A
        B          F
 
C      D     E


GU
SSA_A = SEGMENT A KEY VALUE
SSA_B = SEGMENT B KEY VALUE
SSA_C = SEGMENT D KEY VALUE
PLITDLI(FOUR,GU,DB_PNT,IO_AREA,SSA_A,SSA_B,SSA_C);
Above call retrives segment D occurence

GN
UNQUL_SSA_B = B
PLITDLI(FOUR,GN,DB_PNT,IO_AREA,UNQUL_SSA_B);
Above call retrives all segment b ocuurence

GNP
PLITDLI(FOUR,GNP,DB_PNT,IO_AREA);
Above call retrives all dependent segment occurence of
C D E .