Hello.
I am having this problem in a Cobol BMP program:
I have an HIDAM db with a root segment and several children segments.
I have an input file with key data to use for all segments needed.
I do a fully qualified GU call for the root segment. I also have the 'P' command code in the SSA for parentage.
The next call I do is a GHNP for the child segment. The IMS call has two SSAs - one is the fully qualified root segment (with 'P' command code), and the other is a fully qualified child segment (no comand codes).
This call works fine.
The next call is a REPL call against the child segment.
The next call is another fully qualified GHNP for the child segment under the same root.
The GU call works fine, the 1st GHNP call works fine. The REPL call works fine. The 2nd GHNP fails with a 'GP' status code.
I thought the 'P' on the qualified root SSA would keep parentage on the root for subsequent GNP calls? Likewise I thought the REPL would not "destroy" parentage?
Can someone tell me what I am doing wrong and why I am losing parentage?
Note: as I have segment key information for both root and child segments (multiple children can exist) from a data file I was thinking that instead of GHNP calls I could do just GHU calls for each child.
Thoughts and any additional assistance are appreciated.
your second GHNP call fails with GP. as for as my meagre knowledge goes, as you complete the REPL call after the first GHNP call, the parentage will be now in that segment or the pointer will be in that segment. so as you try to give a second GHNP call, you don't have parentage on the parent segment for this child. instead you have the parentage only on the previous occurence of this segment.
this is what my idea is. i'm not sure to what extent this is correct. please bear with me.