|
BEA eLink for Mainframe SNA 3.2 Information Center | |
|
HOME | SEARCH | CONTACT | PDF FILES | WHAT'S NEW |
||
|
TABLE OF CONTENTS | PREVIOUS TOPIC | NEXT TOPIC |
||
This section is intended for application programmers who implement and integrate BEA TUXEDO and host enterprise applications using Application Program-to-Program Communication (APPC). Although primarily oriented toward BEA TUXEDO application developers, it is also useful for non-TUXEDO application developers seeking to understand the relationship between the environments.
BEA eLink for Mainframe SNA software gives BEA TUXEDO applications access to host APPC programs acting as servers. At the same time, APPC applications can act as clients and access BEA TUXEDO system services. Because the client and server programs must be written for separate and very different environments, eLink SNA allows the applications to be written using native programming facilities:
You can continue to use the tools with which you are familiar to develop application software. It is not important that to be well versed in the programming facilities of other environments. However, proper coordination between the applications running in each environment is important.
This section illustrates the most effective ways to implement eLink SNA domain APPC programming options.
This section provides Transaction scenarios for the following programming environments supported by eLink SNA:
Application-to-Application Programming
Using the eLink SNA gateway, BEA TUXEDO applications can make ATMI service calls to invoke programs running in a remote CICS/ESA DPL environment. CICS/ESA programs can in turn use the Consider the program issuing the distributed link request or ATMI service request to be the Client program. Consider the executing remote program or service to be the Server program. The client does not have to be aware of the server's location.
BEA TUXEDO programs can use both the request/response and conversational models to invoke programs on the host. (However, request/response models are preferred.)
Local and remote services are defined with the Host DPL requests, in turn, can also be compared to BEA TUXEDO services using either call model. The request/response model is very similar to DPL. The conversational model, although supported in DTP, is less efficient and programmatically more complex than the request/response model. It is recommended that you use a DTP model when invoking conversational transactions.
It is also recommended you use a DPL model when invoking the same request/response or conversational request multiple times in a single transaction. With DPL, ISC starts a long-running mirror transaction to the CICS/ESA DPL server, enabling the server to process each of the requests over the same conversation. With DTP, each of the requests establishes a separate conversation with the server and the conversation remains outstanding until the transaction is committed.
The eLink SNA software employs a special feature that enables BEA TUXEDO clients to invoke CICS/ESA server programs and, conversely, CICS/ESA client programs to invoke BEA TUXEDO services. Based on the IBM CICS/ESA mirror transaction, this feature facilitates DPL requests to/from a remote region. The feature is called Mirror Transaction Identifier Support and it involves special treatment of the transaction ID ( This subsection discusses DPL fundamentals related to this feature and describes how eLink SNA software does the following:
Distributed Program Link (DPL)
EXEC CICS LINK command to invoke user-defined BEA TUXEDO services. This feature is available to either new or existing CICS/ESA programs and BEA TUXEDO applications. DPL can only be used by BEA TUXEDO application domains connected to a CICS/ESA system.
FUNCTION=DPL option in the DM_LOCAL_SERVICES and DM_REMOTE_SERVICES section in the DMCONFIG file, indicating that the DPL ISC function is invoked.
Special Treatment of TRANSID for DPL
TRANSID) that is part of every DPL request.
TRANSID to outbound requests only
In the CICS/ESA context, DPL requests are treated as mirror transactions, which include attachment of the server program to the requestor's When a server program receives a DPL request from a remote region, the mirror task services the request. The task attaches the request to a mirror transaction, typically CVMI for SYNCONRETURN requests or CSMI for transactional requests. The mirror task then attaches the appropriate mirror transaction to the requestor's
Note:
Implicit attachment of alternate mirror transaction identifier is not supported for inbound DPL requests to BEA TUXEDO services.
The other scenario is explicit attachment. The DPL requestor names the For outbound requests from BEA TUXEDO domains to remote CICS/ESA regions, this For inbound requests from a remote CICS/ESA region to a local BEA TUXEDO domain, the Figure 8-1 depicts an implicit attachment using the requestor's
Note:
The eLink SNA software does not support implicit attachment of TRANSID to inbound requests for BEA TUXEDO services.
CICS/ESA Fundamentals Relating to Alternate Mirror TRANSID
TRANSID. Two scenarios are possible: implicit attachment (default) and explicit attachment.
TRANSID, found in the requestor's EIBTRNID field. This is implicit attachment (default).
TRANSID that should be attached to the request instead of the default CSMI or CVMI.
TRANSID can be included in the API command (tpcall). The TRANSID must be defined in the program resource definition for the destination region and it must point to the mirror task DFHMIRS.
TRANSID is paired with a PROGRAM name to explicitly name an advertised service.
Implicit Attachment of TRANSID
TRANSID. The outbound tpcall invokes a service from the remote CICS/ESA region, but does not explicitly name a TRANSID. Instead, the TRANSID of the requestor is passed to the region as an invoking TRANSID. The mirror transaction (CSMI or CVMI) is attached and starts the mirror program, which attaches the requestor's TRANSID found in its EIBTRNID field. The mirror task then calls the application program.
Figure 8-1 Implicit Attachment of TRANSID (Outbound Requests Only)

TRN1DATA, which is
advertised as a remote service in the DMCONFIG file. It is a DPL request to a
program named SVC1 in the CICS/ESA region.
Explicit attachment names the TRANSID to be attached instead of the default mirror transaction, CSMI or CVMI. The client might use the explicit method for the following reasons:
TRANSID, or impose scheduling constraints on the transaction itself.
Explicit attachment can be used for both outbound and inbound DPL requests. You can specify the The following example shows how to provide a A where:
TRANSID in the API command or in the RNAME parameter for the service definition in the DMCONFIG file.
TRANSID in the API command:
EXEC CICS LINK PROGRAM("SERVICE1")
SYSID("AIX1")
TRANSID("TRN1")TRANSID for an outbound DPL request is specified in the DM_REMOTE_SERVICES section of the DMCONFIG file. Conversely, a TRANSID for an inbound DPL request is specified in the DM_LOCAL_SERVICES section. The format for the TRANSID and server name in the DMCONFIG file entry is as follows:
RNAME=AAAA:BBBBBBBB
AAAA
TRANSID
BBBBBBBB
The colon is required to indicate the TRANSID/program name combination. The TRANSID must be composed of acceptable CICS/ESA characters:
A-Za-z0-9$@#./-_%&Q¢?!|"=,;<>
The following paragraphs discuss explicit attachment of TRANSID to both outbound requests for remote CICS/ESA services and to inbound requests for BEA TUXEDO services.
Figure 8-2 depicts the explicit attachment of the TRANSID to an outbound request for services in a remote CICS/ESA region. The TRANSID can be provided in the API command or in the remote-service definition in the DMCONFIG file. The RNAME value in the DMCONFIG file is used to create the alternate mirror ID and invoke the remote server.
The request passes the transaction ID of the mirror transaction to the remote CICS/ESA region. This transaction ID is defined in the remote region and must point to the mirror program DFHMIRS. When the mirror program invokes the application program, the transaction ID is passed to the program in the EIBTRNID field.
Figure 8-2 Explicit Attachment of TRANSID for Outbound Requests

SERVICE1, which is
advertised as a remote service in the DMCONFIG file. The FUNCTION option
indicates the remote service is invoked as a DPL.
Figure 8-3 depicts the explicit attachment of the TRANSID to inbound request for services in a BEA TUXEDO local domain. The TRANSID can be provided in the API command or in the local-service definition in the DMCONFIG file. The TRANSID named in the API command or in the requested program name must exactly match an RNAME in the DM_LOCAL_SERVICES section of the DMCONFIG file.
Figure 8-3 Explicit Attachment of TRANSID for Inbound Requests

INSVC1, which is a local BEA
TUXEDO service. The SYSID and PROGRAM values in the request identify the local
system and the name of the local service. The TRANSID option indicates the mirror
transaction to be initiated.
SERVICE1, which is advertised locally in the BEA TUXEDO
application, is initiated.
You must enter the alternate mirror transaction and remote server name as RNAME values in both the DM_LOCAL_SERVICES and DM_REMOTE_SERVICES sections of the DMCONFIG file, using the format shown previously in the "Inbound Requests" section.
For outbound requests to a CICS/ESA server, the RNAME value in the DMCONFIG file is used to create the alternate mirror ID and invoke the remote server.
For inbound requests, the TRANSID named in the API command or in the PROGRAM definition is used along with the requested program name to exactly match an RNAME associated with a local service entry.
Note:
If an RNAME is not found with both the transaction ID and the PROGRAM name, an error is returned to the CICS/ESA client.
Do not insert trailing spaces between the TRANSID and colon in the RNAME option. The eLink SNA software automatically discards trailing spaces before attempting to match RNAME values.
If the specified TRANSID/PROGRAM combination in a service name (either local or remote) is not a DPL, eLink SNA software returns an error which is not detected until run time.
To translate a TUXEDO ATMI request to an EXEC CICS LINK request, the eLink SNA gateway uses the INBUFTYPE and OUTBUFTYPE of the remote service to create the COMMAREA for the DPL program.
For each remote service defined in the DMCONFIG file REMOTE_SERVICES section, INBUFTYPE is a description of the data that the service receives (the format of the request) and OUTBUFTYPE is a description of the data that the service sends as a response.
When a DPL program is invoked, it receives the request data in a COMMAREA. When the program completes, it returns this same COMMAREA to the program that invoked it. The DPL program cannot change the size of the COMMAREA; therefore, the COMMAREA must be large enough to hold both the request and the reply.
Before the gateway invokes a DPL program, it uses the INBUFTYPE and OUTBUFTYPE to calculate this size. Because CARRAY and STRING do not have sizes associated with them, the maximum size is used (4096 bytes).
Note:
You cannot specify a response buffer in a tpcall or a tpacall for the purpose of sizing a COMMAREA. The gateway is unaware of the size of the response buffer that is specified in the tpcall, and in tpacall, the response buffer is not specified until the reply is retrieved with tpgetreply.
The best approach is to use VIEW types as the INBUFTYPE and OUTBUFTYPE of DPL programs. This allows the size of the request and response to be described in exact detail. Refer to the examples below:
Listing 8-1 Example of DMCONFIG File Entry Specifying VIEWS to Size the COMMAREA
*DM_REMOTE_SERVICES
SIMPDPLV AUTOTRAN=N
LDOM="simpsnad"
RDOM=SIMPSNAG
CONV=N
RNAME="TOUPDPLS"
INBUFTYPE="VIEW:reqstr"
OUTBUFTYPE="VIEW:respstr"
FUNCTION="DPL"
The following listing shows the corresponding view descriptions:
Listing 8-2 Descriptions of VIEWS for Sizing COMMAREA
VIEW reqstr
#TYPE CNAME FBNAME COUNT FLAG SIZE NULL
string reqstring - 1 - 20 " "
END
VIEW respstr
#TYPE CNAME FBNAME COUNT FLAG SIZE NULL
string respstring - 1 - 50 " "
END
The following listing shows the code used for a client that requests the SIMPDPLV application:
Listing 8-3 Program Using Views to Size COMMAREA
/* Include header file generated by views -n myviews.v */
#include "myviews.h"
sendbuf = (struct reqstr *) tpalloc("VIEW", "reqstr", sizeof(struct reqstr));
rcvbuf = (struct respstr *) tpalloc("VIEW", "respstr", sizeof(struct respstr));
tpcall("SIMPDPLV", (char *) sendbuf, 0, (char **) &rcvbuf, &rcvlen, (long)0);
In the previous examples, the two VIEWs describe a request string of length 20 and a response string of length 50; therefore, the COMMAREA created can hold a string of 50 characters.
The examples in this section represent a few of the many programming scenarios available for using DPL and BEA TUXEDO service invocations. These examples employ the most natural and efficient approaches.
Note: To run Transaction client/server scenarios, the eLink SNA software must be licensed for sync-level 2 operations.
Figure 8-4 TUXEDO Client Request/Response to CICS/ESA DPL

toupsrv service.
TOUPDPLS program and passes idata buffer
contents for processing.
TOUPDPLS program processes data.
commarea into the client's odata buffer.
Figure 8-5 TUXEDO Client Asynchronous Request/Response to CICS/ESA DPL

toupsrv service.
TOUPDPLS program and passes idata buffer
contents for processing.
TOUPDPLS program processes data.
commarea into the client's tpgetreply
odata buffer.
Figure 8-6 TUXEDO Client Asynchronous Request/Response with No Reply to CICS/ESA DPL

toupsrv service.
TOUPDPLS program and passes idata buffer
contents for processing.
HOPL invokes MIRRDPLC program.
tpreturn call returns the data into the COMM-AREA buffer.
Figure 8-8 CICS/ESA DPL to TUXEDO Request/Response Server, Service in Autonomous Transaction

H0PL invokes MIRRDPLC program.
MIRROR service request tpbegin incorporates all further operations in a
transaction.
MIRROR service processes the data.
tpreturn call returns the data into the commarea buffer.
Figure 8-9 TUXEDO Client Request/Response to CICS/ESA DPL, in Autonomous Transaction

toupsrv service.
toupsrv service issues tpbegin to start the transaction.
TOUPDPLS program and passes idata buffer
contents for processing.
TOUPDPLS program processes data.
commarea into the client's odata buffer.
Figure 8-10 Transactional TUXEDO Client Multiple Requests/Responses to CICS/ESA DPL

toupsrv service.
toupsrv service issues tpbegin to start the transaction.
TOUPDPLS program processes data.
commarea into the client's odata buffer.
toupsrv service loop end conditions
are met.
Figure 8-11 Transactional CICS/ESA DPL to TUXEDO Request/Response Server

H2PL invokes MIRRDPLC program.
MIRROR service processes the data.
tpreturn call returns the data into the commarea buffer.
The following examples represent a few programming scenarios for using DTP and BEA TUXEDO service invocations.
The recommended method of performing DTP services is to use BEA TUXEDO conversational services instead of request/response services. The conversational service enables a client and a server to communicate as needed over the eLink SNA session conversation.
Although it is most suited for the DPL environment, the tpcall is used in the examples for a request/response to a DTP server.
It is recommended you use a DPL model when invoking multiple request/response calls in a single transaction. With DPL, a long-running mirror transaction to the CICS/ESA DPL server is started, enabling the server to process each of the requests over the same conversation. With DTP, each of the ATMI requests will establish a separate conversation; the conversation remains outstanding until the transaction is committed.
The examples in this section represent a few of the many programming scenarios available for using DTP and BEA TUXEDO service invocations. These examples employ the most natural and efficient approaches.
Note: To run transactional client/server scenarios, the eLink SNA software must be licensed for sync-level 2 operations.
Figure 8-12 TUXEDO Client Request/Response to CICS/ESA DTP

toupsrv service.
DTPS starts TOUPDTPS program.
EXEC CICS RECEIVE command receives the idata buffer contents for
processing.
TOUPDTPS program processes data.
Figure 8-13 TUXEDO Client Asynchronous Request/Response to CICS/ESA DTP

toupsrv service.
TOUPDTPS program.
EXEC CICS RECEIVE command receives the idata buffer contents for
processing.
TOUPDTPS program processes data.
Figure 8-14 TUXEDO Client Asynchronous Request/Response with No Reply to CICS/ESA DTP

toupsrv service.
TOUPDTPS program.
EXEC CICS RECEIVE command receives the idata buffer contents for
processing.
TOUPDTPS program processes data.
Figure 8-15 TUXEDO Conversational Client to CICS/ESA DTP, Server Gets Control

toupsrv service.
TOUPDTPS program.
EXEC CICS RECEIVE command receives the idata buffer contents for
processing.
TOUPDTPS program processes data.
Figure 8-16 TUXEDO Conversational Client to CICS/ESA DTP, Client Sends/Receives Data

toupsrv service.
TOUPDTPS program.
EXEC CICS RECEIVE command receives the tpconnect idata buffer
contents for processing.
TOUPDTPS program processes data.
EXEC CICS RECEIVE command receives the tpsend idata contents into
the server's IN-BUFFER.
Figure 8-17 TUXEDO Conversational Client to CICS/ESA DTP, Client Grants Control

toupsrv service.
TOUPDTPS program.
EXEC CICS RETURN ends the conversation, communicated to the tprecv as
TPEV_SVCSUCC.
Figure 8-18 CICS/ESA DTP to TUXEDO Conversational Server, Client Retains Control

H0TP invokes MIRRDTPC program.
EXEC CICS ALLOCATE acquires a session to the remote BEA TUXEDO
domain.
Figure 8-19 CICS/ESA DTP to TUXEDO Conversational Server, Client Relinquishes Control

MIRRDTPC program.
EXEC CICS ALLOCATE acquires a session to the remote BEA TUXEDO
domain.
EXEC CICS SEND command relinquishes control with the INVITE WAIT
option.
EXEC CICS RECEIVE command receives the tpsend idata buffer contents
into the IN-BUFFER.
Figure 8-20 Transactional TUXEDO Client Request/Response to CICS/ESA DTP

Note: This is not the recommended method of performing a DTP transactional service. Please refer to the transactional DPL using request/response for the recommended method.
toupclt invokes toupsrv service. (Note that each tpcall
made in the program must be bookended with a tpbegin and a tpcommit.)
tpbegin to start a transaction.
TOUPDTPS program.
EXEC CICS RECEIVE command receives the idata buffer contents for
processing.
TOUPDTPS program processes data.
Figure 8-21 Transactional TUXEDO Conversational Client to CICS/ESA DTP, Server Gets Control

toupsrv service.
toupsrv service issues tpbegin to start the transaction.
TOUPDTPS program.
EXEC CICS RECEIVE command receives the idata buffer contents for
processing.
TOUPDTPS program processes data.
Figure 8-22 Transactional CICS/ESA DTP to TUXEDO Conversational Server, Host Client Relinquishes Control

MIRRDTPC program.
EXEC CICS ALLOCATE acquires a session to the remote BEA TUXEDO
domain.
EXEC CICS ISSUE CONFIRMATION verb responds positively to the confirm
request.
EXEC CICS FREE verb explicitly frees the outstanding conversation.
The Common Programming Interface for Communications (CPI-C) is an implementation choice for program-to-program communications. The reason that CPI-C may be used over other implementations is that CPI-C defines a single programming interface to the underlying network protocols across many different programming languages and environments.
Also, you can use the CPI Resource Recovery interface to provide a consistent interface to system services that allow your programs to coordinate data exchange and updates of databases and resources.
The examples in this section show the protocol exchanges between the local BEA TUXEDO and remote host application program. With BEA TUXEDO, the type of ATMI service request determines the nature of the client/server communication model. For requests initiated by the host application, the configuration information for the local service determines the protocol exchanges on the conversation.
The recommended method of performing APPC services is to use BEA TUXEDO conversational services instead of request/response services. The conversational service enables a client and a server to communicate as needed over the eLink SNA session conversation.
Although it is most suited for the DPL environment, the tpcall is used in the examples for a request/response to an APPC server.
It is recommended you use aDPL model when invoking multiple request/response calls in a single transaction. With DPL, a long-running mirror transaction to the CICS/ESA DPL server is started, enabling the server to process each of the requests over the same conversation. With APPC, each of the ATMI requests will establish a separate conversation; the conversation remains outstanding until the transaction is committed.
The examples in this section represent a few of the many programming scenarios available for using CPI-C and BEA TUXEDO service invocations. These examples employ the most natural and efficient approaches.
Note: To run transactional client/server scenarios or the CPI Resource Recovery interface, the eLink SNA software must be licensed for sync-level 2 operations.
Figure 8-23 TUXEDO Client Request/Response to Host CPI-C

toupsrv service.
tpname TPNCPIC invokes TOUPCPIC program.
cmrcv request receives the idata buffer contents for processing
TOUPCPIC program processes data.
cmsst request prepares the next send request by setting the send type to
CM_SEND_AND_DEALLOCATE.
Figure 8-24 TUXEDO Client Asynchronous Request/Response to Host CPI-C

toupsrv service.
tpname TPNCPIC invokes TOUPCPIC program.
cmrcv request receives the idata buffer contents for processing.
TOUPCPIC program processes data.
cmdeal flushes the data to the client, and indicates the conversation is
finished.
Figure 8-25 TUXEDO Client Asynchronous Request/Response to Host CPI-C with No Reply

toupsrv service.
tpname TPNCPIC invokes TOUPCPIC program.
TOUPCPIC program processes data.
Figure 8-26 TUXEDO Conversational Client to Host CPI-C, Server Gets Control

toupsrv service
tpname TPNCPIC invokes TOUPCPIC program.
cmrcv request receives the idata buffer contents for processing.
TOUPCPIC program processes data
cmsst request prepares the next send request by setting the send type to
CM_SEND_AND_FLUSH.
cmdeal request ends the conversation.
Figure 8-27 TUXEDO Conversational Client To Host CPI-C, Client Retains Control

toupsrv service.
tpname TPNCPIC invokes TOUPCPIC program.
TOUPCPIC program processes data.
Figure 8-28 TUXEDO Conversational Client to Host CPI-C, Client Grants/gets Control

toupsrv service.
tpname TPNCPIC invokes TOUPCPIC program.
cmrcv requests receives the indicator that control has been granted to the
server.
cmptr request flushes the data to the client, and grants control to the client.
cmdeal indicates a successful completion of the conversation to the tprecv;
no data is passed.
Figure 8-29 Host CPI-C to TUXEDO Asynchronous Request/Response Server with No Reply

MIRRCPIC is invoked using environment start-up
specifications.
Figure 8-31 Host CPI-C to TUXEDO Conversational Service, Client Retains Control

Figure 8-32 Host CPI-C TUXEDO to Conversational Service, Client Grants Control

MIRRCPIC is invoked using environment start-up
specifications.
Figure 8-33 Transactional TUXEDO Client Request/Response to Host CPI-C

toupsrv service.
toupsrv service issues tpbegin to start the transaction.
tpname TPNCPIC invokes TOUPCPIC program.
cmrcv request receives the idata buffer contents for processing.
Figure 8-34 Transactional TUXEDO Conversational Client to Host CPI-C, Server Gets Control

toupsrv service.
toupsrv service issues tpbegin to start the transaction.
tpname TPNCPIC invokes TOUPCPIC program.
cmrcv request receives the idata buffer contents sent on the tpconnect
for processing.
TOUPCPIC program processes the data.
Figure 8-35 Transactional Host CPI-C to TUXEDO Conversational Server, Client Grants Control

MIRRCPIC is invoked using environment start-up
specifications.
cmcfmd.
Additional information on the subject of CICS/ESA Intersystem Communications may be found in the following IBM publications: