IMS status GP: No parentage for GNP
IMS status code GP means a GNP or GHNP call couldn't run because no parentage was established on the PCB, or because its SSA asked for a segment that isn't at a lower level than the parent.
Other names for this code
Also written as status code GP, IMS GP, DL/I status GP, GP status code, GNP no parentage.
What it means
GNP (Get Next within Parent) reads only the dependents of one parent segment. IMS sets that parent, called parentage, at the segment returned by the last successful GU or GN on the PCB (or their hold forms). GNP calls then work through that parent's children, and they don't change the parentage themselves.
GP comes back in two situations. Either there is no parentage on the PCB, so IMS doesn't know whose children to read. Or the GNP's SSA names a segment type at the same level as the parent or above it, which a GNP can never reach. Only GNP and GHNP return GP, and it's a programming error.
Common causes
- The program issued GNP before any GU or GN on that PCB, for example at the start of a run.
- The GU or GN meant to set the parent didn't succeed, often with GE, and the program issued GNP anyway.
- The GNP's SSA names the parent's own segment type, or a segment higher in the hierarchy.
- The program set parentage on one PCB and issued GNP on another.
- A call on the same PCB between the parent's GU and the GNP changed or removed the parentage.
How to find the problem
- Trace the calls on the PCB. Find the last GU or GN before the GNP and check its status.
- Display the GNP's SSA and compare its segment's level with the parent's level in the DBD. The SSA must be for a dependent of the parent.
- Check that the GU or GN and the GNP use the same PCB.
- Look at the segment level and name in the PCB after the call that should have set parentage. That is where the parent is.
How to fix it
- Issue a successful GU or GN for the parent before the GNP loop, and check its status before starting the loop.
- Use SSAs on the GNP that name segments below the parent.
- Use the same PCB for the parent call and the GNP calls.
- If you need parentage at a higher level than the segment the GU returns, use the P command code on that level's SSA.
IBM documentation
IBM documentation: status GP. Use the documentation for your installed release.
Related codes
Questions
What sets parentage in IMS?
A successful GU or GN, or their hold forms, on the same PCB. GNP calls use the parentage but don't change it.
What is the difference between GP and GE on a GNP?
GE means parentage is fine but there are no more matching children. GP means the call can't run at all, because there's no parent or the SSA asks for something that can't be a child.
Can I get GP with a DEDB secondary index?
IBM fixed a case where GP was returned in error during GNP processing through a DEDB secondary index on IMS 14 (APAR PI97151). If your logic looks right, check that your system has that fix.