IMS status GA: Moved to a higher level
IMS status code GA means an unqualified GN or GNP call worked, but DL/I had to move up to a higher level in the hierarchy to find the segment it returned. It's informational, and the segment is in the I/O area.
Other names for this code
Also written as status code GA, IMS GA, DL/I status GA, GA status code, crossed hierarchic boundary.
What it means
An unqualified GN walks the database in hierarchic sequence. It goes down from a parent to its children, across twins, and then back up when a branch is finished. When the segment it returns sits at a higher level than the segment returned by the previous call, DL/I sets GA in the PCB. The data is in the I/O area, as with a blank status.
Take a database with CUSTOMER at level 1, ORDER at level 2 and ITEM at level 3. A program reading with unqualified GN calls gets the last ITEM of an order, and the next GN returns the next ORDER. ORDER is one level higher than ITEM, so the status is GA. If that customer has no more orders, the next segment is the next CUSTOMER root, and the status is also GA.
Only unqualified GN and GNP calls (and their hold forms) return GA. A qualified call names the segment type it wants, so there is nothing to report. A GNP can return GA too, when it moves from a deeper child back up to a child closer to its parent. When the next segment is on the same level but a different type, the code is GK instead.
Common causes
- An unqualified GN read the last dependent of a branch, and the next segment in sequence is a higher-level segment, such as the next parent or the next root.
- An unqualified GNP moved from a level-3 child back up to another level-2 child under the same parent.
- The program reads the whole database sequentially through a PCB that is sensitive to several segment types.
- The program treats any non-blank status as an error, so a normal GA stops the job.
How to find the problem
- Look at the segment name feedback field and the segment level in the PCB after the call. They tell you which segment type is now in the I/O area and at which level.
- Compare that level with the level returned by the previous call. If it is lower, which means higher in the hierarchy, GA is expected.
- If the program abended or stopped on GA, find the status check after the GN and see which values it accepts.
How to fix it
- Treat GA as a successful call. In COBOL, accept spaces, GA and GK as good results in the EVALUATE that follows the call.
- Use the segment name feedback to decide which record layout applies to the data in the I/O area.
- If the program only wants one segment type, use a qualified call or an unqualified SSA that names the type, so it won't see the other segments at all.
- Use GA as a cue to write totals for the branch you just finished, for example an order total when the next ORDER arrives.
IBM documentation
IBM documentation: status GA. Use the documentation for your installed release.
Related codes
Questions
Does GA mean the call failed?
No. The segment is in the I/O area. GA only tells you the call moved up the hierarchy to find it.
What is the difference between GA and GK?
GA means the returned segment is at a higher level than the last one. GK means it is at the same level but a different segment type.
Can a qualified GN return GA?
No. GA and GK only come back on unqualified GN and GNP calls, because a qualified call already names the segment type it wants.