5.1.2 Making Calls from a CICS Client Program

To make a service call from a CICS program to a remote Oracle Tuxedo domain, make an EXEC CICS LINK call to the Pre-requester. The service you want to access must be configured by the Oracle TMA Administrator, but from a programming point of view the LINK call is all you need. The following COBOL record is in the COBOL copybook client.cbl.

Listing COBOL Record

01 REQUEST-RECORD.
    05 REQUEST-HEADER.
         10 DATALEN             PIC S9(08) COMP.
         10 SVCNAME[16]         PIC X(16).
         10 REQUESTCD           PIC S9(08) COMP.
         10 RETURNCD            PIC S9(08) COMP.
         10 REQRETURNCD         PIC S9(08) COMP.
    05 REQUEST-DATA.
         10 DATA-AREA           PIC X(DATALEN).

The layout of the structure in C that must be passed in the LINK call is shown in the listing. The following C structures are in the clienth.h INCLUDE file.

Listing C Structures

typedef struct CLIENTHDR
{
 long DataLen;              /* THE LEN OF THE DATA FROM AND TO APPL */
 char SvcName[16];          /* THE SERVICE NAME */
 long RequestCd;            /* THE REQUEST COMMAND FROM THE APPL */
 long ReturnCd;             /* THE RETURN CODE TO THE APPL */
 long ReqReturnCd;          /* THE RETURN CODE FROM THE PREQ AND REQ */
} CLIENTHDR;

typedef struct CMAREA
{
CLIENTHDR CltHdr;                     /*HEADER */
 char Request_data[MAX_DATA_LENGTH];  /* REQUEST DATA */
} CMAREA;

The variables in the previous COBOL and C examples are defined as follows.

DataLen
The length of the data in the Request_data field.
SvcName
The service request name (ask the administrator for the names).
RequestCd
A predefined numeric value that indicates the type of call this is.
BEA_REQUEST_NORESPONSE
Value is 7. A No Reply Service Request. In this case the request is sent over to Oracle Tuxedo for the service to be performed, but no response data is sent back.
BEA_REQUEST_RESPONSE
Value is 5. A Request/Response Request. A request is sent to Oracle Tuxedo and a response is expected back.

Table 5-1 Request Codes

Code Value
BEA-REQUEST-RESPONSE +5.
BEA-REQUEST-NORESPONSE +7.
ReturnCd
This code is the return code from the CICS Requester. All return codes are listed in the following table. Notify the administrator if any of the return codes indicate a processing or network problem.

Note:

For a complete description of these codes, refer to the Codes Returned to a CICS Client Program

Table 5-2 Return Codes

Code Value
BEA-NORMAL +0
BEA-ERR-LENGTH +1
BEA-ERR-MISSING-SRV-NAME +2
BEA-ERR-REQ-CODE +3
BEA-ERR-SRC-NOT-FOUND +4
BEA-ERR-READ-UMT +5
BEA-ERR-SERVER +6
BEA-ERR-POST +7
BEA-ERR-CANCEL +8
BEA-ERR-WAIT +9
BEA-ERR-LMID-NOT-FOUND +10
BEA-ERR-START-TRANSID +11
BEA-ERR-DISABLE-ACQUIRING +12
BEA-ERR-DISABLE-NOT-FND +13
BEA-ERR-DISABLE-NOT-RESPOND +14
BEA-ERR-DISABLE +15
BEA-ERR-ALLOC +16
BEA-ERR-TIMEOUT +17
BEA-ERR-TSQ +18
BEA-ERR-SOCKET-FAILURE +19
BEA-ERR-PROTOCOL +20
BEA-ERR-QUEUE-OVERFLOW +21
ReqReturnCd
This code is the return code from the Oracle Tuxedo Domain. See the Oracle Tuxedo documentation for a complete list of Tuxedo error codes.
Request_data
This area is the area where request data gets placed and in which your returned data arrives. The length depends on how long this particular service is configured. Check with the administrator for each service. The maximum value is 32000.