Running a 3270 transaction from BTS

BTS supports the 3270 bridge function. Therefore, BTS applications can be integrated with, and make use of, existing 3270-based applications. Follow this basic mechanism for running a 3270 transaction from a BTS application.

About this task

Even though BTS activities are not terminal-related (they are never started directly from a terminal), a BTS activity can be implemented by a 3270-based transaction. The bridge exit program is used to put a “BTS wrapper” around the original 3270 transaction.

Figure 1 shows the basic mechanism for running a 3270 transaction from a BTS application.
Figure 1. Running a 3270-based transaction as a BTS activity
The picture illustrates the list of steps that follow it. It shows a BTS client activity (the parent) and a child activity. The child activity consists of a bridge exit program and a 3270 transaction.
  1. A BTS activity, known in bridge terminology as the client , creates data to run a 3270 transaction. It puts the data in a container associated with a child activity.
  2. The client runs the child activity—which is implemented by the 3270 transaction—asynchronously.
  3. The BTS XM client identifies that the transaction should use the 3270 bridge and calls the bridge XM client.
  4. On the 'bind' call to the bridge exit, the bridge exit program issues a GET CONTAINER command to retrieve the data to run the 3270 transaction.
    Note: In a bridge environment, the bridge exit program becomes part of the 3270 transaction. Thus, the exit program does not need to acquire the child activity before issuing the GET CONTAINER command—it is itself part of the child activity.
  5. The 3270 transaction is run using the retrieved data. Any output data it produces is saved in an output message.
  6. When the bridge exit program is invoked for termination of the 3270 transaction, it issues:
    1. A PUT CONTAINER command, to put the output message into a named data-container
    2. A RETURN command, which causes the child activity to complete.
  7. The firing of the completion event of the child activity causes the parent (client) activity to be reactivated.
  8. The client issues a GET CONTAINER command to retrieve the output from the 3270 transaction.
The following table contains example pseudocode for running a 3270-based transaction as a BTS activity.
Table 1. Pseudocode for running a 3270-based transaction as a BTS activity
Client activity Bridge exit program
When DFH-Initial
encode msg-in-buffer
EXEC CICS DEFINE ACTIVITY ('3270-act')
TRANSID('T327') EVENT('3270-Complete')
RESP(data-area) RESP2(data-area) END-EXEC.
EXEC CICS PUT CONTAINER('Message')
ACTIVITY('3270-act') FROM(msg-in-buffer)
RESP(data-area) RESP2(data-area) END-EXEC.
EXEC CICS RUN ACTIVITY('3270-act')
ASYNCHRONOUS
RESP(data-area) RESP2(data-area) END-EXEC.
EXEC CICS RETURN END-EXEC..
When 3270-Complete
EXEC CICS GET CONTAINER('Message')
ACTIVITY('3270-act') INTO(msg-out-buffer)
RESP(data-area) RESP2(data-area) END-EXEC.
decode msg-out-buffer
EXEC CICS RETURN ENDACTIVITY
Init.
pass userdata from the brdata to BRXA..
Bind.
EXEC CICS GET CONTAINER('Message')
INTO(3270-msg-in-buffer)
RESP(data-area) RESP2(data-area) END-EXEC..
Term.
EXEC CICS PUT CONTAINER('Message')
FROM(3270-msg-out-buffer)
RESP(data-area) RESP2(data-area) END-EXEC.
EXEC CICS RETURN END-EXEC

The child activity is implemented by the 3270 transaction and the bridge exit program. All the required BTS commands are issued by the exit program.