Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 17 Multiple-Session Execution Environments in Batch : Sample Programs

Sample Programs
Programs Provided
Four programs are provided as a guideline for you to implement your own environmental wait routine. They can be found in the ASM and COBOL data sets distributed with TIBCO Object Service Broker. These programs are:
S6BEWTIN
This is an initialization transaction program to bring up the Execution Environment and supply the address of the environmental wait routine (also located in this program). A significant portion of this program involves setting up the ninth parameter to the STARTEE call.
Must be Resident to TP Monitor
As this program contains the environmental wait routine it is extremely important that it be marked resident to your TP monitor. This insures that the code pointed to by HRNXDEP (the Entry Point of your wait routine) does not relocate in memory. It is also mandatory that the environmental wait routine be written as reentrant.
You can ensure that the environmental wait routine is resident by having the initialization program use CSA storage to LOAD the exit routine there, or use other facilities possibly available in your TP environment, such as making the program resident.
S6BEWTSD
This transaction program is provided as the shutdown program. It should be executed as the last program to call TIBCO Object Service Broker. Failure to execute this program likely causes a System Abend Code A03.
Typically, this program would reside in your shutdown table. Its purpose is to tell the Execution Environment to shutdown. It first performs a STARTEE to initialize the HRNHLLWA work area, and performs the number of STOPEE calls required according to the program logic.
Program Logic
The Execution Environment maintains one internal counter, EECNT, for the number of STARTEE calls issued. When the shutdown program (S6BEWTSD) is executed, under normal circumstances there is one outstanding STARTEE call, from the initialization program (S6BEWTIN), plus one STARTEE call from this program. Therefore, the shutdown transaction must issue at least two STOPEE calls to quiesce the Execution Environment. The shutdown transaction contains logic to catch the situation where a user application program fails to issue a STOPEE call. In this case, extra STOPEE calls are issued and a warning message appears.
S6BEWTSS
This assembler program would assist in setting up the Exit Descriptor (ninth parameter) for the STARTSS call in your COBOL client programs. It takes two input parameters. As part of the setup, a copy of the COBOL’s original first-level save area (the CICS DFHEISTG Control Block) is made, and its address is placed in the HRNXDUSR field of the data area named HRNXD further down in the code.
Calling Requirements
If you use an external routine that is link-edited with your main program to issue the STARTSS call, you must pass the HRNXD data field as a parameter to that external routine. You must first initialize the data field in your mainline code of the originating program with the call to S6BEWTSS.
If the external routine is executed via the TP monitor’s LINK facility (such as a CICS command-level EXEC CICS LINK call), it should be sufficient to place the S6BEWTSS call in the external routines mainline code.
Example
COBOL programmers do not need to be concerned with individual data elements within the two following data areas, but they must provide adequate storage as noted by the following example. Modify this example program according to the TP monitor conventions for your TP environment.

 
*
* The following is used as the ninth parameter on the STARTSS Call.
*
01 HRNXD PIC X(48).
..
..
* The following is used as a copy of the CICS DFHEISTG Control Block.
*
01 HRNEISTG PIC X(248).
..
..
CALL 'S6BEWTSS' USING HRNXD, HRNEISTG.
..

 
COBCAPI3
This is a COBOL program used to execute a TIBCO Object Service Broker rule.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved