Conversational transactions

Follow this pseudocode to see how to run a conversational 3270 transaction. Potential problems with solutions are illustrated.

A potential problem is that, at one or more stages, the 3270 transaction requires further data to continue. The bridge exit program cannot obtain this data from the client. That is, it cannot end its current activation, to be reactivated with the required data—because the 3270 transaction has not completed, issuing an EXEC CICS RETURN command would merely return control to the latter. Nor can the exit program get information back to the client by issuing an EXEC CICS SYNCPOINT command, because this would modify the 3270 transaction.

One solution is for the bridge exit program itself to obtain, or compute, the required data. Perhaps a better solution is for the exit program to create a subtask to obtain the data. It could, for example, create a separate child activity (a grandchild of the client) to deal with each request for data - each intermediate map - sent by the 3270 transaction. For convenience, we shall refer to such child activities as “conversational activities”. Figure 1 illustrates this approach.
Figure 1. Running a 3270 conversational transaction as a BTS activity. The bridge exit program creates a child activity to deal with each map sent by the 3270 transaction.
The picture shows the scenario described in the preceding text. It shows a client activity communicating with a child activity. The child activity consists of a 3270 transaction and a bridge exit program. It in turn communicates with a conversational activity, which is the grandchild of the client activity. A message container is accessible by the client activity and the bridge exit program. A request container is accessible by the bridge exit program and the conversational activity.

One possible problem of creating a separate activity to deal with each intermediate map is that the output message sent to the client by the exit program at transaction end contains only the final 3270 map. If it is important that intermediate messages are preserved, the conversational activities could put them in other containers associated with the client.

The following table contains example pseudocode for running a 3270 conversational transaction.

Bridge exit program
Read_Message.
encode conv-in-buffer from 3270-msg-out-buffer
EXEC CICS DEFINE ACTIVITY (next-conv-act-name)
TRANSID(conv-transaction-id)
RESP(data-area) RESP2(data-area) END-EXEC.
EXEC CICS PUT CONTAINER('Request')
ACTIVITY(next-conv-act-name)
FROM(conv-in-buffer)
RESP(data-area) RESP2(data-area) END-EXEC.
EXEC CICS LINK ACTIVITY(next-conv-act-name)
RESP(data-area) RESP2(data-area) END-EXEC.
EXEC CICS CHECK ACTIVITY(next-conv-act-name)
COMPSTATUS(status) ABCODE(a)
RESP(data-area) RESP2(data-area) END-EXEC
If status NOT = DFHVALUE(NORMAL)
EXEC CICS ABEND ABCODE(a)
NODUMP
RESP(data-area) RESP2(data-area) END-EXEC
End-If..
EXEC CICS GET CONTAINER('Request')
ACTIVITY(next-conv-act-name)
INTO(3270-msg-in-buffer)
RESP(data-area) RESP2(data-area) END-EXEC..
Write_Message.
Intermediate writes cannot be sent
to the client.
EXEC CICS NOOP
RESP(data-area) RESP2(data-area) END-EXEC.
“Conversational” activity
WHEN DFH-Initial
EXEC CICS GET CONTAINER('Request')
INTO(msg-in-buffer)
RESP(data-area) RESP2(data-area) END-EXEC.
decode msg-in-buffer
encode msg-out-buffer.
EXEC CICS PUT CONTAINER('Request')
FROM(msg-out-buffer)
RESP(data-area) RESP2(data-area) END-EXEC.
EXEC CICS RETURN END-EXEC

The exit program issues a LINK ACTIVITY, rather than a RUN ACTIVITY SYNCHRONOUS, command to activate the “conversational” child activity. This is necessary to ensure that the child executes in the same unit of work as the exit program.



dfhp9c0050.html | Timestamp icon Last updated: Monday, 5 June 2017