| Oracle Procedural Gateway for APPC User's Guide Release 9.0.1.0.1 for UNIX Part Number A90397-01 |
|
This Oracle Procedural Gateway for APPC User's Guide is intended for users of the the following UNIX-based platforms:
The Oracle Procedural Gateway for APPC allows you to initiate transaction program execution on remote online transaction processors (OLTPs). The Oracle Procedural Gateway for APPC provides Oracle applications seamless access to IBM mainframe data and services through remote procedural call (RPC) processing.
Read this chapter to learn more about the architecture, uses and features of the Oracle Procedural Gateway for APPC.
This chapter contains the following sections:
The Oracle Procedural Gateway for APPC extends the remote procedural call (RPC) facilities available with the Oracle® server. The gateway enables any client application to use PL/SQLTM to request execution of a remote transaction program residing on a host. The gateway provides RPC (remote procedural call) processing to systems using the SNA APPC (Advanced Program-to-Program Communication) protocol. This architecture allows efficient access to invaluable data and transactions available on the IBM mainframe.
The use of a generic and standard protocol, APPC, allows the gateway to access a multitude of systems. The gateway can communicate with virtually any APPC-enabled system, including IBM Corporation's CICS on any platform, IBM Corporation's IMS and APPC/MVS, and CA's IDMS. These transaction monitors provide access to a broad range of systems, allowing the gateway to access many datastores, including VSAM, DB2 (static SQL), IMS, IDMS, ADABAS, and others.
The gateway requires no Oracle software on the remote system. Thus, the gateway uses existing transactions with little or no programming effort on the remote system. The gateway helps leverage your investment in existing applications and gives you the ability to move toward new distributed environments.
The following terms are used throughout this guide as follows:
This file is known as initsid.ora and it contains parameters that govern the operation of the gateway. Refer to Appendix A of the Oracle Procedural Gateway for APPC Installation and Configuration Guide for your platform more information.
Oracle Procedural Gateway for APPC provides pre-built remote procedures. In general, functions: the following three remote procedures are used:
Refer to "Remote Procedural Call Functions", as well as to Appendix C, "Gateway RPC Interface" for more information about gateway remote procedures.
This is any Oracle server instance that communicates with the Oracle Procedural Gateway for APPC for purposes of performing remote procedural calls to execute remote transaction programs (RTP). The Oracle integrating server can be on the same machine with the gateway or on a different machine. If it is on a different machine, then Oracle® Net is required on both systems. Refer to Figure 1-1, "Relationship of Gateway and Oracle Integrating Server on UNIX Host" and Figure 1-2, "Oracle Procedural Gateway for APPC Architecture" for a view of the gateway architecture.
OLTP is any of a number of online transaction processors available from other vendors, including CICS, IMS/TM, and IDMS-DC.
PGA is a general reference within this guide to all or most components comprising the Oracle Procedural Gateway for APPC. This term is used when references to a specific product or component are too narrow.
PGAU is the tool that is used to define and generate PL/SQL transaction interface packages (TIPs). Refer to Chapter 2, "Procedural Gateway Administration Utility" for more information about PGAU.
This component of the Oracle Procedural Gateway for APPC is a repository of remote host transaction definitions and data definitions. PGAU accesses definitions in the PG DD when generating TIPs. The PG DD has datatype dependencies because it supports the PGAU and is not intended to be directly accessed by the customer. Refer to Appendix A, "Procedural Gateway for APPC Data Dictionary" for a list of PG DD tables.
PGDL is the collection of statements used to define transactions and data to the PGAU.
This is a precompiled PL/SQL procedure that is stored in the Oracle integrating server.
RPC is a programming call that executes program logic on one system in response to a request from another system. See "gateway remote procedure" for more information, and refer to Appendix C, "Gateway RPC Interface" as well.
A remote transaction program is a customer-written transaction, running under the control of an OLTP, which the user invokes remotely using a PL/SQL procedure. To execute a remote transaction program through the gateway, you must use RPC to execute a PL/SQL program to call the gateway functions.
A TIP is an Oracle PL/SQL package that exists between your application and the remote transaction program. The transaction interface package, or TIP, is a set of PL/SQL stored procedures that invoke the remote transaction program through the gateway. TIPs perform the conversion and reformatting of remote host data using PL/SQL and UTL_RAW/UTL_PG functions.
This component of the Oracle Procedural Gateway for APPC is a series of data conversion functions for PL/SQL RAW variables and remote host data. The types of conversions performed depend on the language of the remote host data. Refer to "UTL_RAW Functions" in Appendix D for more information.
This component of the Oracle Procedural Gateway for APPC is a series of COBOL numeric data conversion functions.
Refer to "NUMBER_TO_RAW and RAW_TO_NUMBER Argument Values" in Appendix D for supported numeric datatype conversions.
Figure 1-1 illustrates where the terminology discussed above applies to the gateway's architecture.

Throughout this book, we use a CICS-DB2 inquiry as an example. Transaction Interface Package (TIP) PGADB2I sends an employee number, empno, to a DB2 application and receives an employee record, emprec.
The CICS-DB2 inquiry sample and its associated PGAU commands are documented in Appendix F, "CICS APPC Transaction Samples" and Appendix E, "Administration Utility Samples" respectively. These samples are also available in the $ORACLE_HOME/pg4appc/demo/CICS directory. The sample CICS-DB2 inquiry used as an example in this chapter is in files pgadb2i.pkh and pgadb2i.pkb. Refer to the README.doc file in the same directory for information about installing and using the samples.
Using the Oracle Procedural Gateway for APPC to access data has the following advantages:
The gateway is optimized so that remote execution of a program is achieved with minimum network traffic. The interface to the gateway is an optimized PL/SQL stored procedure specification (called the "PL/SQL package") precompiled in the Oracle integrating server. Because there are no additional software layers on the remote system, overhead occurs only when your program executes.
Client applications need not be operating system-specific. For example, your application can call a program in a CICS region on MVS. If you move the program to a CICS region on OS/2, then you need not change the application.
Users calling applications that execute a remote transaction program are unaware that a request is sent to a host.
You can use the gateway to interface with existing procedural logic or to integrate new procedural logic into an Oracle integrating server environment.
The integration of the Oracle server with the gateway enables the gateway to benefit from existing and future Oracle features. For example, the gateway can be called from an Oracle stored procedure or database trigger.
The gateway and the Oracle integrating server allow remote transaction updates and Oracle server updates to be performed in a coordinated fashion. Oracle two-phase commit protection is extended to remote transactions without any special programming in the Oracle application.
The gateway supports any tool or application that supports PL/SQL.
The Oracle Procedural Gateway for APPC provides a powerful development environment, including:
The Oracle Procedural Gateway for APPC provides site autonomy, allowing you to do such things as authenticate users. It also provides role-based security compatible with any security package running on your mainframe computer.
Through the TIP, the following conversions are performed:
The architecture of the Oracle Procedural Gateway for APPC consists of three components:
This server should include the distributed option. The Oracle integrating server is usually installed on the same UNIX system as the Oracle Procedural Gateway for APPC.
If you install the Oracle integrating server on a system other than the UNIX system on which the gateway is installed, then you must install Oracle Net with the Oracle integrating server and with the gateway. The Oracle integrating server must be capable of connecting to the gateway through any supported Oracle Net protocol. The Oracle integrating server can also be used for non-gateway applications. Refer to the Oracle Procedural Gateway for APPC Installation and Configuration Guide for your platform for a list of Oracle Net protocols supported by the gateway and tools.
The Oracle Procedural Gateway for APPC must be installed on a UNIX operating system.
The OLTP must be on a system accessible to UNIX using the SNA APPC protocol. Multiple Oracle integrating servers can access the same gateway. A single UNIX gateway installation can be configured to access more than one OLTP.
The following diagram illustrates the architecture of the Oracle Procedural Gateway for APPC as described above.

The gateway is not started in the same way as an Oracle database instance. It has no background processes and does not need a management utility such as Oracle® Enterprise Manager. Each Oracle integrating server user session that accesses a particular gateway creates an independent process on the UNIX system that runs the gateway server and executes SNA functions to communicate with an OLTP.
All of the communication between the Oracle integrating server, the gateway, and the target system are handled through a Transaction Interface Package (TIP). The TIP is a standard PL/SQL procedural gateway program (PL/SQL package) that provides the following functions:
The Procedural Gateway Administration Utility (PGAU), provided with the gateway, automatically generates the TIP specification.
The gateway is identified to the Oracle integrating server using a database link. The database link is the same construct used to identify other Oracle server databases. The functions in the gateway are referenced in PL/SQL as:
function_name@dblink_name
The Oracle Procedural Gateway for APPC provides a set of functions that are invoked by the client through remote procedural call (RPC). These functions direct the gateway to initiate, transfer data with, and terminate remote transaction programs running under an OLTP on another system.
The remote procedural call functions and the correlating commands invoked in the gateway and remote system are shown in the following table.
The TIP initiates a connection to the target system using one of the gateway functions, PGAINIT. PGAINIT provides, as input, the required SNA parameters to start a conversation with the target transaction program. These parameters are sent across the SNA network, which returns a conversation identifier to PGAINIT. Any future calls to the target program use the conversation identifier as an INPUT parameter.
After the conversation is established, a procedural gateway function called PGAXFER can exchange data in the form of input and output variables. PGAXFER sends and receives buffers to and from the target transaction program. The gateway sees a buffer as only a RAW stream of bytes. The TIP that is residing in the Oracle integrating server is responsible for converting the application's PL/SQL datatypes to RAW before sending the buffer to the gateway. It is also responsible for converting RAW to the PL/SQL datatypes before returning the results to the application.
When communication with the remote program is complete, the gateway function PGATERM terminates the conversation between the gateway and the target system. PGATERM uses the conversation identifier as an INPUT parameter to request conversation termination.
The Oracle Procedural Gateway for APPC supports three types of transactions that read data from and write data to remote systems:
In a one-shot transaction, the application executes initialization, exchanges data and terminates the connection, all in a single call.
In a persistent transaction, multiple calls to exchange data with the remote transaction can be executed before terminating the conversation.
In a multi-conversation transaction, the procedural gateway server can be used to exchange multiple records in one call to the remote transaction program. This transaction type is only supported for AIX users of the Oracle Procedural Gateway for APPC.
Refer to "Remote Host Transaction Types" in Chapter 4, "Client Application Development" for more information about transaction types.
The following examples demonstrate the power of the Oracle Procedural Gateway for APPC:
The Oracle Procedural Gateway for APPC lets you write your own procedures to begin transferring information between the Oracle integrating server and a variety of programs on an IBM mainframe, including IBM CICS, IMS, and APPC/MVS.
For an illustration of the communications function of the Oracle Procedural Gateway for APPC, refer to "Sample pgacics.sql File" in Appendix F, which is a simple sample communication between the Oracle server and CICS on an IBM mainframe. Executing a simple PL/SQL procedure (like pgacics.sql) causes the Oracle server to invoke the procedural gateway, which uses APPC to converse with the PGAFLIP RTP in the mainframe.
The following steps describe the UNIX-to-mainframe communications process illustrated in Figure 1-3, "Communication Between the Oracle Server and the Mainframe".
$sqlplus <userid>/<password>@<database_specification_string SQL> execute pgacics('==< .SCIC htiw gnitacinummoc si yawetag ruoy ,snoitalutargnoC >==');
==> Congratulations, your gateway is communicating with CICS. <== PL/SQL procedure successfully completed.
Figure 1-3, "Communication Between the Oracle Server and the Mainframe" illustrates the communications process described in steps one through four, above.

Most transactions are much larger and more complex than the simple sample pgacics.sql file referred to above and communication with a normal-sized RTP (remote transaction program) would require you to create an extremely long PL/SQL file. Oracle Procedural Gateway for APPC's TIP function generates the PL/SQL procedure for you.
Following is a brief description of the four steps necessary for you to generate a TIP. Refer to Chapter 3, "Creating a TIP" for detailed information about this procedure, and refer to Chapter 2, "Procedural Gateway Administration Utility" for more information about PGAU.
All parameter names in this section are taken from a file called pgadb2i.ctl in the $ORACLE_HOME/pga4appc/demo/CICS directory. Refer to "Sample PGAU Script File (pgadb2i.ctl)" in Appendix E, "Administration Utility Samples" to see a sample of the entire file.
Sample define data:
define data empno plsdname(empno) usage(pass) language(ibmvscobolii) infile("empno.cob");
Sample define call:
define call db2imain pkgcall(pgadb2i_main) parms((empno in),(emprec out));
Sample define transaction:
define transaction db2i call(db2imain,db2idiag) sideprofile(CICSPGA) tpname(DB2I) logmode(oraplu62) synclevel(0) nls_language("american_america.we8ebcdic37c");
Sample generate transaction:
generate db2i pkgname(pgadb2i) pganode(pga) outfile("pgadb2i");
$pgau PGAU>CONNECT<userid>/<password>@<database>_specification_string> PGAU>@pgadb2i.ctl
$sqlplus<userid>/<password>@<database_specification_string> SQL>@pgadb2i.pkh; SQL>@pgadb2i.pkb;
$sqlplus<userid>/<password>@<database_specification string> SQL>@pgadb2id.sql SQL>execute db2idriv('000320');
|
|
![]() Copyright © 2001 Oracle Corporation. All Rights Reserved. |
|