TSO-ISPF JCL COBOL VSAM DB2 CICS IMS-DB Tools Articles Forum Quiz Interview Q&A

IMS Status Code Check


Status Code Check after GU call:

Following each retrieval call, the status of the call whether successful or not needs to be checked. There is a two-position field in the PCB called status code field. It keeps track of what happened as a result of the call.

When GU call is used to retrieve segments to an existing database, the status codes for the following codes needs to be checked. " "(Blank), "GE".

Blank indicates that the retrieval call is successful. Return Status "GE" indicates that the segment could not be found.


Status Code Check after GN call:

When GN call is used to retrieve segments to an existing database, the status codes for the following codes needs to be checked. " "(Blank), "GE", "GA", "GK", "GB".

Blank indicates that the retrieval call is successful. Return Status “GE” indicates that the segment could not be found. In scanning though the database sequentially, a program normally test for the GB status code to find out when the end of the data base has been reached.

If the program issues another call after the GB status code has been returned, IMS goes back to the beginning of the database. When a program issues unqualified Get-Next calls, it can test for the GA and GK status codes to help determine which segment type has been retrieved. When a call retrieves a segment at a higher level, IMS returns a status code of GA. If the call retrieves a segment of a differrent type, but at the same level, IMS returns a status code of GK.



If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on IBMMainframer Community!

Are you looking for Job Change? Job Portal