| Oracle Procedural Gateway for APPC User's Guide Release 9.0.1.0.1 for UNIX Part Number A90397-01 |
|
This chapter shows in detail how you can define, generate and compile a Transaction Interface Package (TIP). It assumes that a remote host transaction program (RTP) already exists. This transaction program has operational characteristics that dictate how the TIP is defined and how the TIP is used by the client application.
This chapter contains the following sections:
The following steps create a TIP for use with a remote host transaction (RHT):
This chapter also discusses the generated TIP content file.
Every TIP developer requires access to the following PL/SQL packages, which are shipped with the Oracle server:
If anyone other than the PG ADMIN will be developing TIPs, they will need explicit grants to perform these operations. Refer to the Optional Configuration Steps section in Chapter 4 of the Oracle Procedural Gateway for APPC Installation and Configuration Guide for your platform for more information about private and public grants.
Follow the steps below to identify and become familiar with your remote host transaction data exchanges.
The three important parameters that you will use for each call are:
cname: the name of the call definition to be created;
dname: the name of the data structure to be exchanged; and
OUT) or receive (IN)
RHT send corresponds to a TIP OUT and RHT receive corresponds to a TIP IN. Refer to "APPC Send/Receive Synchronization" for more information.
PGAU call entries are only defined once, so eliminate any duplicates.
This call list defines the TIP function calls, not the order in which they are used. Note that the order in which each call is made is a behavior of the transaction and dictates the order of calls made by the high-level application to the TIP, which then calls the RHT through the Procedural Gateway server. While this calling sequence is critical to maintaining the synchronization between the application and the RHT, the TIP is only an access method for the application and has no knowledge of higher level sequencing of calls.
Make a data list of every such structure. This list dictates a series of PGAU DEFINE DATA statements.
The two important parameters that you will use for DEFINE DATA are:
dname: the name of the data definition to be created; and
dname.ext: the file in which the data definition is stored.
PGAU data entries are only defined once, so eliminate any duplicates.
|
Note: Move COBOL record layouts (copybooks) to the gateway machine. PGAU can use copybooks as input when defining the data items. Once you have identified the data items to be exchanged, use a file transfer program to download the copybooks to the gateway machine. The copybooks are later used to define the data items. The sample copybook used in the example is documented in Appendix E, "Administration Utility Samples". |
The five important parameters that you will use for PGAU DEFINE TRANSACTION are:
You must also identify the Oracle NLS character set (charset) for the language in which the OLTP expects the data.
After evaluating the RHT, define the TIP to PGAU for placement in the PG DD.
DEFINE DATA dname1 LANGUAGE(IBMVSCOBOLII) INFILE(dnamel.ext); DEFINE DATA dname2 LANGUAGE(IBMVSCOBOLII) INFILE(dname2.ext); DEFINE DATA dname3 LANGUAGE(IBMVSCOBOLII) INFILE(dname3.ext);
Then you must copy or transfer the source file containing these data definitions to the directory where PGAU can read them as input.
DEFINE CALL cname1 PARMS((dnamel IN)); DEFINE CALL cname2 PARMS((dname2 OUT)); DEFINE CALL cname3 PARMS((dname3 IN)); DEFINE CALL cname4 PARMS((dname2 OUT));
|
NOTE: Optionally, you can rewrite your call definitions to consolidate the data transmission into fewer exchanges, as long as you do not alter the data transmission sequence. For example:
This reduces the calls between the application and the TIP from four calls to two calls passing an IN and OUT parameter on each call. Because TIPs always process IN parameters before OUT parameters, the data transmission sequence is unchanged. However, this consolidation is not always possible. Refer to "APPC Send/Receive Synchronization" for more information. |
DEFINE TRANSACTION tname CALLS(cname1 cname2, .... cnameN) ENVIRONMENT(IBM370) SIDEPROF(profname) | TPNAME(tpid) LUNAME(luname) LOGMODE(mode) SYNCLEVEL(n) NLS_LANGUAGE(charset);
GENERATE tname
The previous section describes the three steps you need to follow in order to execute PGAU statements via your PGAU command line processor. As a time saving measure, you can choose to write all of the statements (DEFINE DATA, DEFINE CALL, AND DEFINE TRANSACTION) into a single PGAU script file named tname.ctl, in the following order:
This is an example of a tname.ctl PGAU script file:
UNDEFINE TRANSACTION tname Version(all); UNDEFINE CALL cname1 Version(all); UNDEFINE CALL cname2 Version(all); UNDEFINE DATA dname1 Version(all); UNDEFINE DATA dname2 Version(all); UNDEFINE DATA dname3 Version(all); DEFINE DATA dname1 LANGUAGE(IBMVSCOBOLII) INFILE(dnamel.ext); DEFINE DATA dname2 LANGUAGE(IBMVSCOBOLII) INFILE(dname2.ext); DEFINE DATA dname3 LANGUAGE(IBMVSCOBOLII) INFILE(dname3.ext); DEFINE CALL cname1 PARMS(dname1 IN), (dname2 OUT)); DEFINE CALL cname2 PARMS(dname3 IN), (dname2 OUT)); DEFINE TRANSACTION tname CALLS(cname1, cname2, .... cnameN) ENVIRONMENT(IBM370) SIDEPROF(profname) | TPNAME(tpid) LUNAME(luname) LOGMODE(mode) SYNCLEVEL(n) NLS_LANGUAGE(charset); Generate tname
After you have created your control file, use PGAU to create the PG DD entries and the TIP specification files.
Invoke PGAU against your PG DD stored in the Oracle Procedural Gateway for APPC Administrator's user ID:
$ pgau PGAU> connect pgaadmin/pw@database_specification_string
Issue the following commands:
$PGAU> set echo on PGAU> spool tname.def PGAU> @tname.ctl PGAU> spool off
The TIP is now ready to be compiled. By default, the GENERATE statement writes your TIP specifications to the following output files in your current directory:
pgau.pkh (TIP Header) pgau.pkb (TIP Body) pgau.doc (TIP content documentation)
|
Note:
You can optionally add spool and echo to your script ( |
Exit PGAU. Remain in your current directory and invoke SQL*Plus.
$ sqlplus userid/pw@database_specification_string SQL> set echo on SQL> @pgau.pkh SQL> @pgau.pkb
The last two commands compile the TIP specification and body, respectively.
You have now compiled a TIP which can be called by your client application. If your client application is already written you can begin testing.
For more information about designing your client application and compiling a TIP, refer to Chapter 1, "Introduction to Oracle Procedural Gateway for APPC" and Appendix B, "TIP Internals" and refer to Chapter 4, "Client Application Development" for information about PGAU statement syntax and usage.
This section discusses the TIP documentation file that is produced when the user issues a PGAU GENERATE command. This TIP content file describes the function calls and PL/SQL variables and datatypes available in the TIP.
PGAU GENERATE always produces a TIP content file named tipname.doc. The filename is the name of the transaction that was specified in the PGAU GENERATE command, and the filetype is always .doc. This TIP content file contains the following sections:
This section contains the status under which the TIP is generated.
This section identifies the defined transaction attributes. These result from the PGAU DEFINE TRANSACTION definition.
This section identifies the syntax of the calls made by the user's application to initialize and terminate the transaction. PGAU generates these calls into every TIP regardless of how the TIP or transaction is defined.
This section identifies the syntax of the calls which the user defines for the application to interact with the transaction.
This section identifies the TIP package public datatype declarations, implied by the user's data definition specified in each call parameter.
This section contains TIP variables that can be referred to by applications or referenced by applications.
|
|
![]() Copyright © 2001 Oracle Corporation. All Rights Reserved. |
|