Connecting the partner transaction

When a session has been acquired, the next step is to cause the partner transaction to be initiated.

The state table shows that, in allocated state (state 1), one of the commands available is SEND. Using this command, the back-end transaction’s identifier can be specified in the first four bytes of the data which, when transferred to the partner system, will be used to attach the required back-end transaction. The send buffer containing the transaction identifier together with any other data, will be flushed immediately and the front-end transaction will wait until a response is received from the back end. Figure 1 shows an example in which a transaction identifier is sent.

Alternatively, when a session has been acquired, the front-end transaction can build and send an attach header with the first transmission of data. The attach header can be built using the BUILD ATTACH command.

When using the BUILD ATTACH command, an eight-character name must be given to the built attach header which can then be used in the ATTACHID option of the first SEND (or CONVERSE) command. The back-end transaction identifier should also be specified.
Figure 1. Starting an MRO conversation
 * ...
DATA DIVISION.
WORKING-STORAGE SECTION.
* ...
01 FILLER.
02 WS-CONVID PIC X(4).
02 WS-RESP PIC S9(8) COMP.
02 WS-STATE PIC S9(8) COMP.
02 WS-SYSID PIC X(4) VALUE 'SYSB'.
02 WS-PROC PIC X(4) VALUE 'BBBB'.
02 WS-LEN-PROCN PIC S9(5) COMP VALUE +4.
* ...
PROCEDURE DIVISION.
* ...
EXEC CICS ALLOCATE SYSID(WS-SYSID) RESP(WS-RESP) END-EXEC.
IF WS-RESP = DFHRESP(NORMAL)
THEN MOVE EIBRSRCE TO WS-CONVID
ELSE
* ... No session allocated. Examine EIBRCODE.
END-IF.
* ...
EXEC CICS SEND CONVID(WS-CONV)
RESP(WS-RESP) STATE(WS-STATE)
FROM(WS-PROC) LENGTH(WS-LEN-PROCN)
END-EXEC.
IF WS-RESP = DFHRESP(NORMAL)
THEN
* ... No errors, conversation started.
ELSE
* ... Conversation not started. Examine EIBRCODE.
END-IF.


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