IMS application programs and the asynchronous callout function

You might need to modify or create IMS application programs to support the callout function if you need IMS to process a response to the callout request, a terminal requires an acknowledgment after submitting a transaction, or a response-mode transaction initiates a program-to-program switch.

If you do not need a response to the callout request, the application program needs to specify only the appropriate OTMA destination name in an insert call to an alternate PCB. No modification of the application program is necessary.

If, however, you need a response to the callout request, you must modify the IMS application programs to correlate the response to the original input transaction. The method of correlation is ultimately up to you and your installation, but it will very likely require the application program to include in some type of data to be used for correlation purposes in the outgoing callout request message and then look for that same data in the response message.

You might also have the IMS application program that issues the callout request store correlation data or other data in an IMS database for retrieval when the callout response is returned. In a shared queues environment, such a database is also useful if the response transaction might be scheduled on a different IMS system. If a reply must be sent back to either an LTERM or an IMS Connect TCP/IP client, the LTERM name or TMEMBER and TPIPE name should also be stored in the database.

The following code samples shows an example of a COBOL copybook data structures that might be used for the callout function and the callout response.

The callout request data structure includes a correlator field, CORRID, to send correlation data to the EJB:

01 CALLREQ 
     02   LL        PIC S9(4) COMP.
     02   ZZ        PIC S9(4) COMP.
     02   CORRID    PIC (8).
     02   ACCTNUM   PIC (20).

When the response is returned, the CORRID field of the COBOL copybook data structure contains the same correlation data, which the IMS application can use to relate the response to the initial request, if needed:

01 CALLRESP
     02   LL        PIC S9(4) COMP.
     02   ZZ        PIC S9(4) COMP.
     02   CORRID    PIC(8).
     02   ACCTBAL   PIC (20).