The call sequence to be used by an implicit-mode client
program is:
- Call
- Explanation of Function
- INITAPI
- Open the interface. (Required only for client programs that use MVS™ TCP/IP Sockets calls).
- SOCKET
- Obtain a socket descriptor.
- CONNECT
- Request connection to the IMS™ Listener
port.
- WRITE
- Send a transaction-request message (TRM).
- WRITE
- Send server input data formatted as IMS segments.
- READ
- Receive response.
- If the request was rejected, a request-status message (RSM) will
be received.
- If the transaction was scheduled and executed properly, application
data will be received.
Thus, logic in the client must test the output message for the
characters *REQSTS* to distinguish between application data and a
request-status message (RSM).
- READ
- Upon successful completion of the database updates, the Assist
module sends a complete-status message (*CSMOKY*) to the client, indicating
that the transaction has completed successfully.
If this message
is not received, the client must assume that the application failed
to complete properly; in this case, a return code of –1 and ERRNO
(typically set to 54) will indicate that application failed. The client
must take whatever action is appropriate (for example, reschedule
the transaction, resynchronize data).
- CLOSE
- Terminate the connection and release the socket resources.