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.
-
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 -
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.
Parent topic: Client Application Considerations