BEA Connect TCP for IMS allows user-written IMS application transactions to service requests received from remote systems (server requests) and to initiate requests for services provided by remote systems (client requests).
IMS Client and Server transactions are ordinary IMS Message Processing Programs (MPPs) and may be written in any programming language supported by IMS. Because COBOL is the traditional language used for this purpose, the examples in this document are based on the assumption that COBOL is the language used. However, these examples may be translated easily to other supported programming languages (such as C).
BEA Connect TCP for IMS and user-written IMS Client and Server transactions communicate by exchanging standard IMS messages (using the IMS Message Queue).
An IMS Server Transaction is one that services requests originated by a remote system.
The request message is inserted into the IMS Message Queue as a single segment. The IMS Server Transaction retrieves the request message from the IMS Message Queue and processes the request as required.
A BEA Connect TCP for IMS Server request or response has the following message format:
01 BEA-SERVER-REQUEST-RESPONSE-MESSAGE.
05 BEA-SERVER-HEADER
10 LL PIC 9(4) COMP VALUE 0.
10 ZZ PIC 9(4) COMP VALUE 0.
10 TRAN-CODE PIC X(8) VALUE SPACES.
10 FILL-CHAR PIC X VALUE SPACES.
10 BEA-RESERVED PIC X(8) VALUE LOW-VALUES.
05 USER-REQUEST-DATA.
10 (user-defined...)
05 USER-RESPONSE-DATA REDEFINES USER-REQUEST-DATA.
10 (user-defined...)
The INCLUDE distribution library contains the following header files and copybooks for use by IMS server transactions.
| Member Name | Description |
|---|---|
|
BEATCPI |
C Header file |
|
SERVER |
COBOL copybook |
Because the request message is generated by the BEA Connect TCP for IMS BMP, there is no associated LTERM (the LTERM field of the I/O PCB will be spaces).
If a response is required, the server transaction formats a response message as shown above. The Transaction Code field should be set to that of the BEA Connect TCP for IMS BMP. Note that the BEA-RESERVED field must be copied intact from the request message.
The response message is inserted into the IMS Message Queue using a (modifiable) Alternate PCB. Typically, the server transaction would issue a CHNG call to set the destination to the BEA Connect TCP for IMS BMP transaction code, followed by an ISRT call to insert the response message into the IMS Message Queue.
The response message can be inserted either as a single segment, or as multiple segments. BEA Connect TCP for IMS is capable of handling either format.
An IMS Client Transaction is one that issues a request for a service provided by a remote system.
A BEA Connect TCP for IMS Client request or response message consists of three contiguous "sections": a BEA-defined Request/Response Header, user-defined Context Data, and user-defined request or response data.
A BEA Connect TCP for IMS Client request or response has the following message format:
01 BEA-CLIENT-REQUEST-RESPONSE-MESSAGE.
05 BEA-CLIENT-HEADER.
10 LL PIC 9(04) COMP VALUE 0.
10 ZZ PIC 9(04) COMP VALUE 0.
10 TRAN-CODE PIC X(08) VALUE SPACES.
10 FILL-CHAR PIC X VALUE SPACES.
10 BEA-RESERVED-1 PIC X(03) VALUE LOW-VALUES.
10 HEADER-LENGTH PIC 9(08) COMP VALUE 0. .
10 CONTEXT-LENGTH PIC 9(08) COMP VALUE 0.
10 DATA-LENGTH PIC 9(08) COMP VALUE 0.
10 MAX-RESPONSE-LENGTH PIC 9(08) COMP VALUE 0.
10 REQUEST-TYPE PIC 9(08) COMP VALUE 0.
88 REQUEST-RESPONSE-REQUIRED VALUE 1.
88 REQUEST-NO-RESPONSE VALUE 2.
10 RESPONSE-FORMAT PIC 9(08) COMP VALUE 0.
88 RESPONSE-SINGLE-SEGMENT VALUE 0.
88 RESPONSE-MULTI-SEGMENT VALUE 1.
10 ERROR-CODE PIC S9(08) COMP VALUE +0.
88 ERR_NO_ERROR VALUE +0.
88 ERR_RESPONSE_TRUNCATED VALUE +4.
88 ERR_HOST_NOT_AVAILABLE VALUE +8.
88 ERR_HOST_BUSY VALUE 12.
88 ERR_TIMEOUT VALUE 16.
88 ERR_SERVICE_NAME VALUE 20.
88 ERR_NO_STORAGE VALUE 24.
88 ERR_REQUEST_FORMAT VALUE 28.
88 ERR_HOST_ERROR VALUE 32.
88 ERR_TP_ERROR VALUE 36.
88 ERR_INTERNAL_ERROR VALUE 40.
10 REASON-CODE PIC S9(08) COMP VALUE +0.
88 RSN_NO_REASON VALUE 0.
88 RSN_HEADER_LENGTH VALUE 4.
88 RSN_HEADER_LENGTHS VALUE 8.
88 RSN_REQUEST_TYPE VALUE 12.
88 RSN_NO_RESPONSE_TRAN VALUE 16.
88 RSN_CONTEXT_LENGTH VALUE 20.
88 RSN_DATA_LENGTH VALUE 24.
88 RSN_MAX_DATA_LENGTH VALUE 28.
88 RSN_NO_SERVICE_NAME VALUE 32.
88 RSN_SERVICE_NAME_UNDEFINED VALUE 36.
10 SERVICE-NAME PIC X(16) VALUE SPACES.
10 RESPONSE-TRAN PIC X(08) VALUE SPACES.
10 ORIGIN-TERMINAL PIC X(08) VALUE SPACES.
10 BEA-RESERVED-2 PIC X(16) VALUE LOW-VALUES.
05 USER-CONTEXT-DATA.
10 (user-defined...)|
05 USER-REQUEST-DATA.
10 (user-defined...)
05 USER-RESPONSE-DATA REDEFINES USER-REQUEST-DATA.
10 (user-defined...)
The INCLUDE distribution library contains the following header files and copybooks for use by IMS Client transactions.
| Member Name | Description |
|---|---|
|
BEATCPI |
C Header file |
|
SERVER |
COBOL copybook |
Every Client Request must designate a Response Transaction (even though the request itself may not require an application-level response). BEA Connect TCP for IMS schedules the response transaction if an error is encountered that prevents processing of the request (for example, the request may be improperly formatted, or the specified service may be unavailable).
The response transaction should always check the Error Code to determine whether or not the request was successfully processed.
An Error Code value of zero indicates that the request was processed successfully. Otherwise, the value of the Error Code indicates the type of error that occurred. Refer to Appendix F, "Error and Reason Codes," for a description of the Error Codes returned by BEA Connect TCP for IMS.
For certain kinds of errors, a Reason Code may be returned that provides additional information about the nature of the error that occurred (if the Reason Code value is zero, it indicates that no additional information is available). Refer to Appendix F, "Error and Reason Codes," for a description of the Reason Codes returned by BEA Connect TCP for IMS.
BEA Connect TCP for IMS recognizes a wide variety of error conditions that may prevent successful processing of a client request. These are briefly summarized below.
BEA Connect TCP for IMS validates a client request prior to sending it to a remote system for processing. Types of validation errors include invalid service name, invalid length values, etc.
BEA Connect TCP for IMS may be unable to process a request because the required remote system is either inaccessible or currently busy processing other requests.
BEA Connect TCP for IMS monitors each request sent to a remote system for processing. If a response is required and is not received within a prescribed period of time, the request times out.
The request may fail due to an error that occurs on the remote system. For example, the requested service may detect an application-level error, or the remote gateway may be unable to invoke the requested service.
Although unlikely, it is possible that BEA Connect TCP for IMS may be unable to process a request due to an internal or system error, such as a temporary storage shortage.
When a client program on the remote BEA TUXEDO system sends data to (or receives data from) a service routine on a different model of computer, BEA Connect TPS automatically translates data as required. Translation involves changing the representation of intrinsic data types by changing attributes such as the following:
BEA Connect TPS adheres to the following data translation rules.
BEA TUXEDO Terminology
Data Translation Rules
The following table summarizes the rules for translating between C and IBM 370 data types.
This section provides the following information:
Strings and Numeric Data: A Closer Look
When you create VIEW definitions for input and output buffers that are used by IMS applications, do not specify extra characters for terminating NULL characters that are used in string fields.
For example, when a remote IMS application program expects 10 characters in an input record, specify 10 for that field, not 10 plus 1 (for the terminating NULL character).
Note:
Although BEA Connect TPS does not require strings to be NULL-terminated, it respects NULL termination. Therefore, when BEA Connect TPS detects a NULL (zero) character within a string, it does not process any subsequent characters. To pass full 8-bit data that contains embedded NULL values, use a CARRAY type field or buffer.
The character set translations performed by BEA Connect TPS for BEA TUXEDO are fully localizable, in accordance with the X/Open XPG Portability Guides. ASCII and EBCDIC translations are loadable from message files. BEA Connect TPS contains default behaviors that should meet the requirements of most English-language applications. However, you may find it necessary to customize tables. See Appendix B in the BEA Connect TPS User Guide for complete instructions.
You can convert numeric data easily into different data types, provided that you have enough range in the intermediate and destination types to handle the maximum value you need to represent.
For example, you can convert an FML field of double into a packed decimal field on the remote target system by specifying an appropriate dec_t type VIEW element.
In addition, you can convert numeric values into strings (and the reverse). For example, while FML buffers do not directly support the dec_t type, you can place decimal values in string fields and map these to dec_t fields within VIEW definitions.
Including NULL Characters in String Length Calculations
Converting Numeric Data