Status Codes
Summary
IMS returns a status code that describes the success or failure or the call in the PCB. The status code should be verified after EVERY call to IMS to check whether the call is successful or not.
The application program should test for expected status codes. If an unexpected status code is encountered, the program should handle the abend occurred.
The application program is responsible for display all the error details before the program abends. IMS status codes can be classified in to three types.
- Informational errors
- Program errors
- IO errors
Informational errors -
The status code returned by the IMS can be neither good nor bad; The application program must determine if the result is expected or not expected.
BLANKS - The call was successful
‘GA’ - During unqualified sequential processing, IMS crossed to a higher level of the hierarchy
‘GB’ - End of database was reached.
‘GE’ - No segment was found which matches the criteria specified.
‘GK’ - During unqualified sequential processing, IMS crossed to a different segment type at the same level.
Program Error -
The call was not attempted because the information passed to DL/I was invalid. This is always an abend condition.
‘AD’ - The function code is invalid.
‘AK’ - The field name does not match the name in the DBD.
‘AJ’ - The SSA is coded incorrectly.
IO Error -
An IO Error was encountered during the call was attempted. An unusual occurrence should cause an abend.
‘AI’ - Open error.Probably a missing DD statement.
Additional IMS Status codes -
‘DA’ – An attempt to modify the key field on replace or delete call.
‘DJ’ – An attempt to replace/delete a segment that was not held.
‘II’ – An attempt insert a duplicate.