Implementing the synchronous callout function
To issue a synchronous callout request from your IMS application, issue the ICAL call and specify the OTMA descriptor name.
The ICAL call can also be issued through a REXXTDLI call, or from a Java™ application that runs in a JMP or JBP region. Optionally, you can also specify a timeout value (the maximum time to wait for the response to return).
Input and output messages from IMS can be 32 KB or larger per segment for a synchronous callout request. However, the maximum segment size is 32 KB for a synchronous program switch request.
The following diagram shows the message flow of the synchronous callout function. The request starts with an IMS application that issues an ICAL call. The response is returned to the requesting IMS application.
You can make concurrent ICAL calls from your IMS applications that are routed to the same or different IMS Connect destinations. By using the RESUME TPIPE call and the send-only protocol, the synchronous callout function allows the requests to be sent and the responses to be received in different connections and threads. You can have one connection for retrieving the callout requests and use other connections to return the response messages simultaneously.
A correlation token is created by IMS to correlate the response message back to the correct IMS transaction instance. The capability of having different threads and connections for pulling callout requests and for returning response messages provides maximum concurrency.
Correlation tokens are not used for synchronous program switch requests.
Your application can make an ICAL call with the RECEIVE subfunction code to get the complete response data for a previously incomplete ICAL call with the SENDRECV subfunction code. However, your application cannot retrieve the complete response data with a RECEIVE subfunction call after issuing a subsequent call with the SENDRECV subfunction. Issuing a subsequent ICAL call with the SENDRECV subfunction code clears the ICAL response buffer in the IMS control region for the previous ICAL call.
The following high-level steps provide an overview of implementing and deploying your synchronous callout application and function.
Example COBOL program implementation of the synchronous callout function
To issue the ICAL call in a COBOL program, use the CALL statement.
CALL 'AIBTDLI' USING ICAL, AIB, CA-REQUEST, SCA-RESPONSE.
The following example demonstrates the required AIB field declaration for the ICAL call in the COBOL program. A complete COBOL example (with part name DFSSSCBL) is provided with the callout IVP sample in the SDFSSMPL sample library.
01 AIB.
02 AIBRID PIC x(8) VALUE 'DFSAIB '.
02 AIBRLEN PIC 9(9) USAGE BINARY.
02 AIBSFUNC PIC x(8) VALUE 'SENDRECV'.
02 AIBRSNM1 PIC x(8) VALUE 'OTMDEST1'.
02 AIBRSNM2 PIC x(8).
02 AIBRESV1 PIC x(8).
02 AIBOALEN PIC 9(9) USAGE BINARY VALUE 28.
02 AIBOAUSE PIC 9(9) USAGE BINARY VALUE 30.
02 AIBRSFLD PIC 9(9) USAGE BINARY VALUE 5000.
02 AIBRESV2 PIC x(8).
02 AIBRETRN PIC 9(9) USAGE BINARY.
02 AIBREASN PIC 9(9) USAGE BINARY.
02 AIBERRXT PIC 9(9) USAGE BINARY.
...
The following example shows the CA-REQUEST and SCA-RESPONSE declarations in the COBOL program.
* ICAL Request Area
01 CA-REQUEST.
02 CA-MESSAGE PIC X(45) VALUE SPACES.
* ICAL Response Area
01 SCA-RESPONSE.
02 SCA-MESSAGE PIC X(100) VALUE SPACES.