The state tables for APPC basic conversations

The state tables provide the following information for writing a DTP program. Firstly, they show which commands can be issued from each conversation state. Secondly, they show the state transitions that occur and the CDB flags raised when a command is issued. CDB fields are used to return indicators from the conversation. They are described in Checking the outcome of GDS commands.

How to use the state tables

The commands you can issue, coupled with the CDB flags that can be set after execution, are shown in column 1 down the left side of the table. The possible conversation states are shown across the top of the table. The states correspond to the columns of the table. The intersection of a row (command and CDB flag) and a column (state) represents the state transition, if any, that occurs when a particular command, issued in a particular state, returns a particular CDB flag. The order in which the CDB flags appear with a command also shows the order in which you test the CDB flags in your program.

A number at an intersection indicates the next state. Other symbols represent other conditions, as follows:

Symbol Meaning
N/A Cannot occur.
× The CDB flag is any one that has not been covered in earlier rows, or it is irrelevant (but see the note on CDBSIG if you want to use GDS ISSUE SIGNAL).
Ab The command is not valid in this state. Issuing a command in a state in which it is not valid causes a bad response to be returned.
= Remains in current state.
End End of conversation.
Table 35. APPC basic conversations at sync level 0, part 1
Command issued CDB flag returned32 ALLO- CATED33 SEND PEND- RECEIVE PEND- FREE RECEIVE CONF- RECEIVE
State 1 State 2 State 3 State 4 State 5 State 6
GDS CONNECT PROCESS34
EIBERR
+ EIBFREE
   12    Ab    Ab    Ab    Ab    N/A
GDS CONNECT PROCESS34    ×    2    Ab    Ab    Ab    Ab    N/A
GDS EXTRACT PROCESS35    ×    =    =    =    =    =    N/A
GDS EXTRACT ATTRIBUTES    ×    =    =    =    =    =    N/A
GDS SEND (any valid form)
CDBERR
+ CDBFREE
   Ab    12    Ab    Ab    Ab    N/A
GDS SEND (any valid form) CDBERR    Ab    5    Ab    Ab    Ab    N/A
GDS SEND INVITE WAIT    ×    Ab    5    Ab    Ab    Ab    N/A
GDS SEND INVITE    ×    Ab    3    Ab    Ab    Ab    N/A
GDS SEND LAST WAIT    ×    Ab    12    Ab    Ab    Ab    N/A
GDS SEND LAST    ×    Ab    4    Ab    Ab    Ab    N/A
GDS SEND WAIT    ×    Ab    =    Ab    Ab    Ab    N/A
GDS SEND    ×    Ab    =    Ab    Ab    Ab    N/A
GDS RECEIVE
CDBERR
+ CDBFREE
   Ab    Ab    Ab    Ab    12    N/A
GDS RECEIVE CDBERR    Ab    Ab    Ab    Ab    =    N/A
GDS RECEIVE CDBFREE    Ab    Ab    Ab    Ab    12    N/A
GDS RECEIVE CDBRECV    Ab    Ab    Ab    Ab    =    N/A
GDS RECEIVE LLID CDBCOMPL    Ab    Ab    Ab    Ab    =    N/A
GDS RECEIVE    ×    Ab    Ab    Ab    Ab    2    N/A
GDS ISSUE ERROR CDBFREE    Ab    12    12    Ab    12    N/A
GDS ISSUE ERROR    ×    Ab    =    2    Ab    2    N/A
GDS ISSUE ABEND    ×    Ab    12    12    12    12    N/A
GDS ISSUE SIGNAL36    ×    Ab    =    =    Ab    =    N/A
GDS WAIT    ×    Ab    =    5    12    Ab    N/A
GDS FREE    ×    End    Ab    Ab    End    Ab    N/A
Note:
See topic Footnotes for footnotes.
Table 36. APPC basic conversations at sync level 0, part 2
CONF- SEND CONF- FREE SYNC- RECEIVE SYNC- SEND SYNC- FREE FREE ROLL- BACK Command returns
State 7 State 8 State 9 State 10 State 11 State 12 State 13
   N/A    N/A    N/A    N/A    N/A    Ab    N/A
Immediately
 
   N/A    N/A    N/A    N/A    N/A    Ab    N/A Immediately
   N/A    N/A    N/A    N/A    N/A    =    N/A Immediately
   N/A    N/A    N/A    N/A    N/A    =    N/A Immediately
   N/A    N/A    N/A    N/A    N/A    Ab    N/A
After error detected
 
   N/A    N/A    N/A    N/A    N/A    Ab    N/A After error detected
   N/A    N/A    N/A    N/A    N/A    Ab    N/A After data flows
   N/A    N/A    N/A    N/A    N/A    Ab    N/A After data buffered
   N/A    N/A    N/A    N/A    N/A    Ab    N/A After data flows
   N/A    N/A    N/A    N/A    N/A    Ab    N/A After data buffered
   N/A    N/A    N/A    N/A    N/A    Ab    N/A After data flows
   N/A    N/A    N/A    N/A    N/A    Ab    N/A After data buffered
   N/A    N/A    N/A    N/A    N/A    Ab    N/A
After error detected
 
   N/A    N/A    N/A    N/A    N/A    Ab    N/A After error detected
   N/A    N/A    N/A    N/A    N/A    Ab    N/A After error detected
   N/A    N/A    N/A    N/A    N/A    Ab    N/A When data available
   N/A    N/A    N/A    N/A    N/A    Ab    N/A When data available
   N/A    N/A    N/A    N/A    N/A    Ab    N/A When data available
   N/A    N/A    N/A    N/A    N/A    Ab    N/A After response from partner
   N/A    N/A    N/A    N/A    N/A    Ab    N/A After response from partner
   N/A    N/A    N/A    N/A    N/A    Ab    N/A Immediately
   N/A    N/A    N/A    N/A    N/A    Ab    N/A Immediately
   N/A    N/A    N/A    N/A    N/A    Ab    N/A Immediately
   N/A    N/A    N/A    N/A    N/A    End    N/A Immediately
Table 37. APPC basic conversations at sync level 1, part 1
Command issued CDB flag returned32 ALLO- CATED33 SEND PEND- RECEIVE PEND- FREE RECEIVE CONF- RECEIVE
State 1 State 2 State 3 State 4 State 5 State 6
GDS CONNECT PROCESS34
EIBERR
+ EIBFREE
   12    Ab    Ab    Ab    Ab    Ab
GDS CONNECT PROCESS34    ×    2    Ab    Ab    Ab    Ab    Ab
GDS EXTRACT PROCESS35    ×    =    =    =    =    =    =
GDS EXTRACT ATTRIBUTES    ×    =    =    =    =    =    =
GDS SEND (any valid form)
CDBERR
+ CDBFREE
   Ab    12    Ab    12    Ab    Ab
GDS SEND (any valid form) CDBFREE    Ab    12    Ab    Ab    Ab    Ab
GDS SEND INVITE WAIT    ×    Ab    5    Ab    Ab    Ab    Ab
GDS SEND INVITE CONFIRM    ×    Ab    5    Ab    Ab    Ab    Ab
GDS SEND INVITE    ×    Ab    3    Ab    Ab    Ab    Ab
GDS SEND LAST WAIT    ×    Ab    12    Ab    Ab    Ab    Ab
GDS SEND LAST CONFIRM    ×    Ab    12    Ab    Ab    Ab    Ab
GDS SEND LAST    ×    Ab    4    Ab    Ab    Ab    Ab
GDS SEND WAIT    ×    Ab    =    Ab    Ab    Ab    Ab
GDS SEND CONFIRM    ×    Ab    =    537    1237    Ab    Ab
GDS SEND    ×    Ab    =    Ab    Ab    Ab    Ab
GDS RECEIVE
CDBERR
+ CDBFREE
   Ab    Ab    Ab    Ab    12    Ab
GDS RECEIVE CDBERR    Ab    Ab    Ab    Ab    =    Ab
GDS RECEIVE
CDBCONF
+ CDBFREE
   Ab    Ab    Ab    Ab    8    Ab
GDS RECEIVE
CDBCONF
+ CDBRECV
   Ab    Ab    Ab    Ab    6    Ab
GDS RECEIVE CDBCONF    Ab    Ab    Ab    Ab    7    Ab
GDS RECEIVE CDBFREE    Ab    Ab    Ab    Ab    12    Ab
GDS RECEIVE CDBRECV    Ab    Ab    Ab    Ab    =    Ab
GDS RECEIVE LLID CDBCOMPL    Ab    Ab    Ab    Ab    =    Ab
GDS RECEIVE    ×    Ab    Ab    Ab    Ab    2    Ab
GDS ISSUE CONFIRMATION    ×    Ab    Ab    Ab    Ab    Ab    5
GDS ISSUE ERROR CDBFREE    Ab    12    12    Ab    12    12
GDS ISSUE ERROR    ×    Ab    =    2    Ab    2    2
GDS ISSUE ABEND    ×    Ab    12    12    12    12    12
GDS ISSUE SIGNAL36    ×    Ab    =    =    Ab    =    =
GDS WAIT    ×    Ab    =    5    12    Ab    Ab
GDS FREE    ×    End    Ab    Ab    End    Ab    Ab
Note:
See topic Footnotes for footnotes.
CONF- SEND CONF- FREE SYNC- RECEIVE SYNC- SEND SYNC- FREE FREE ROLL- BACK Command returns
State 7 State 8 State 9 State 10 State 11 State 12 State 13
   Ab    Ab    N/A    N/A    N/A    Ab    N/A
Immediately
 
   Ab    Ab    N/A    N/A    N/A    Ab    N/A Immediately
   =    =    N/A    N/A    N/A    =    N/A Immediately
   =    =    N/A    N/A    N/A    =    N/A Immediately
   Ab    Ab    N/A    N/A    N/A    Ab    N/A
After error flow detected
 
   Ab    Ab    N/A    N/A    N/A    Ab    N/A After error flow detected
   Ab    Ab    N/A    N/A    N/A    Ab    N/A After data flows
   Ab    Ab    N/A    N/A    N/A    Ab    N/A After response from partner
   Ab    Ab    N/A    N/A    N/A    Ab    N/A After data buffered
   Ab    Ab    N/A    N/A    N/A    Ab    N/A After data flows
   Ab    Ab    N/A    N/A    N/A    Ab    N/A After response from partner
   Ab    Ab    N/A    N/A    N/A    Ab    N/A After data buffered
   Ab    Ab    N/A    N/A    N/A    Ab    N/A After data flows
   Ab    Ab    N/A    N/A    N/A    Ab    N/A After response from partner
   Ab    Ab    N/A    N/A    N/A    Ab    N/A After data buffered
   Ab    Ab    N/A    N/A    N/A    Ab    N/A
After error detected
 
   Ab    Ab    N/A    N/A    N/A    Ab    N/A After error detected
   Ab    Ab    N/A    N/A    N/A    Ab    N/A
After confirm flow detected
 
   Ab    Ab    N/A    N/A    N/A    Ab    N/A
After confirm flow detected
 
   Ab    Ab    N/A    N/A    N/A    Ab    N/A After confirm flow detected
   Ab    Ab    N/A    N/A    N/A    Ab    N/A After error detected
   Ab    Ab    N/A    N/A    N/A    Ab    N/A When data available
   Ab    Ab    N/A    N/A    N/A    Ab    N/A When data available
   Ab    Ab    N/A    N/A    N/A    Ab    N/A When data available
   2    12    N/A    N/A    N/A    Ab    N/A Immediately
   12    12    N/A    N/A    N/A    Ab    N/A After response from partner
   2    2    N/A    N/A    N/A    Ab    N/A After response from partner
   12    12    N/A    N/A    N/A    Ab    N/A Immediately
   =    =    N/A    N/A    N/A    Ab    N/A Immediately
   Ab    Ab    N/A    N/A    N/A    Ab    N/A Immediately
   Ab    Ab    N/A    N/A    N/A    End    N/A Immediately
Table 38. APPC basic conversations at sync level 2, part 1
Command issued CDB flag returned32 ALLO- CATED33 SEND PEND- RECEIVE PEND- FREE RECEIVE CONF- RECEIVE
State 1 State 2 State 3 State 4 State 5 State 6
GDS CONNECT PROCESS34
EIBERR
+ EIBFREE
   12    Ab    Ab    Ab    Ab    Ab
GDS CONNECT PROCESS34    ×    2    Ab    Ab    Ab    Ab    Ab
GDS EXTRACT PROCESS35    ×    =    =    =    =    =    =
GDS EXTRACT ATTRIBUTES    ×    =    =    =    =    =    =
GDS SEND (any valid form)
CDBERR
+ CDBFREE
   Ab    12    Ab    12    Ab    Ab
GDS SEND (any valid form) CDBERR    Ab    5    Ab    12    Ab    Ab
GDS SEND INVITE WAIT    ×    Ab    5    Ab    Ab    Ab    Ab
GDS SEND INVITE CONFIRM    ×    Ab    5    Ab    Ab    Ab    Ab
GDS SEND INVITE    ×    Ab    3    Ab    Ab    Ab    Ab
GDS SEND LAST WAIT38    ×    Ab    12    Ab    Ab    Ab    Ab
GDS SEND LAST CONFIRM38    ×    Ab    12    Ab    Ab    Ab    Ab
GDS SEND LAST    ×    Ab    4    Ab    Ab    Ab    Ab
GDS SEND WAIT    ×    Ab    =    Ab    Ab    Ab    Ab
GDS SEND CONFIRM    ×    Ab    =    5    1237    Ab    Ab
GDS SEND    ×    Ab    =    Ab    Ab    Ab    Ab
GDS RECEIVE
CDBERR
+ CDBSYNRB
   Ab    Ab    Ab    Ab    13    Ab
GDS RECEIVE
CDBERR
+ CDBFREE
   Ab    Ab    Ab    Ab    12    Ab
GDS RECEIVE CDBERR    Ab    Ab    Ab    Ab    =    Ab
GDS RECEIVE
CDBSYNC
+ CDBFREE
   Ab    Ab    Ab    Ab    11    Ab
GDS RECEIVE
CDBSYNC
+ CDBRECV
   Ab    Ab    Ab    Ab    9    Ab
GDS RECEIVE CDBSYNC    Ab    Ab    Ab    Ab    10    Ab
GDS RECEIVE
CDBCONF
+ CDBFREE
   Ab    Ab    Ab    Ab    8    Ab
GDS RECEIVE
CDBCONF
+ CDBRECV
   Ab    Ab    Ab    Ab    6    Ab
GDS RECEIVE CDBCONF    Ab    Ab    Ab    Ab    7    Ab
GDS RECEIVE CDBFREE    Ab    Ab    Ab    Ab    12    Ab
GDS RECEIVE CDBRECV    Ab    Ab    Ab    Ab    =    Ab
GDS RECEIVE LLID CDBCOMPL    Ab    Ab    Ab    Ab    =    Ab
GDS RECEIVE    ×    Ab    Ab    Ab    Ab    2    Ab
Note:
See topic Footnotes for footnotes.
Table 39. APPC basic conversations at sync level 2, part 2
CONF- SEND CONF- FREE SYNC- RECEIVE SYNC- SEND SYNC- FREE FREE ROLL- BACK Command returns
State 7 State 8 State 9 State 10 State 11 State 12 State 13
   Ab    Ab    Ab    Ab    Ab    Ab    Ab
Immediately
 
   Ab    Ab    Ab    Ab    Ab    Ab    Ab Immediately
   =    =    =    =    =    =    = Immediately
   =    =    =    =    =    =    = Immediately
   Ab    Ab    Ab    Ab    Ab    Ab    Ab
After error flow detected
 
   Ab    Ab    Ab    Ab    Ab    Ab    Ab After error flow detected
   Ab    Ab    Ab    Ab    Ab    Ab    Ab After data flows
   Ab    Ab    Ab    Ab    Ab    Ab    Ab After response from partner
   Ab    Ab    Ab    Ab    Ab    Ab    Ab After data buffered
   Ab    Ab    Ab    Ab    Ab    Ab    Ab After data flows
   Ab    Ab    Ab    Ab    Ab    Ab    Ab After response from partner
   Ab    Ab    Ab    Ab    Ab    Ab    Ab After data buffered
   Ab    Ab    Ab    Ab    Ab    Ab    Ab After data flows
   Ab    Ab    Ab    Ab    Ab    Ab    Ab After response from partner
   Ab    Ab    Ab    Ab    Ab    Ab    Ab After data buffered
   Ab    Ab    Ab    Ab    Ab    Ab    Ab
After rollback flow detected
 
   Ab    Ab    Ab    Ab    Ab    Ab    Ab
After error detected
 
   Ab    Ab    Ab    Ab    Ab    Ab    Ab After error detected
   Ab    Ab    Ab    Ab    Ab    Ab    Ab
After sync flow detected
 
   Ab 
   Ab    Ab    Ab    Ab    Ab    Ab
After sync flow detected
 
   Ab    Ab    Ab    Ab    Ab    Ab    Ab After sync flow detected
   Ab    Ab    Ab    Ab    Ab    Ab    Ab
After confirm flow detected
 
   Ab    Ab    Ab    Ab    Ab    Ab    Ab
After confirm flow detected
 
   Ab    Ab    Ab    Ab    Ab    Ab    Ab After confirm flow detected
   Ab    Ab    Ab    Ab    Ab    Ab    Ab After error flow detected
   Ab    Ab    Ab    Ab    Ab    Ab    Ab When data available
   Ab    Ab    Ab    Ab    Ab    Ab    Ab When data available
   Ab    Ab    Ab    Ab    Ab    Ab    Ab When data available
table continued ...
Table 40. APPC basic conversations at sync level 2, part 3
Command issued CDB flag returned32 ALLO- CATED33 SEND PEND- RECEIVE PEND- FREE RECEIVE CONF- RECEIVE
State 1 State 2 State 3 State 4 State 5 State 6
GDS ISSUE CONFIRMATION    ×    Ab    Ab    Ab    Ab    Ab    5
GDS ISSUE ERROR CDBFREE    Ab    12    12    Ab    12    12
GDS ISSUE ERROR    ×    Ab    =    2    Ab    2    2
GDS ISSUE ABEND    ×    Ab    12    12    12    12    12
GDS ISSUE SIGNAL    ×    Ab    =    =    Ab    =    =
GDS ISSUE PREPARE
CDBERR
+ CDBSYNRB
   Ab    13    13    13    Ab    Ab
GDS ISSUE PREPARE
CDBERR
+ CDBFREE
   Ab    12    12    12    Ab    Ab
GDS ISSUE PREPARE CDBERR    Ab    5    5    5    Ab    Ab
GDS ISSUE PREPARE    ×    Ab    10    9    11    Ab    Ab
SYNCPOINT39 EIBRLDBK    = 2 or 540 2 or 540 2 or 540    Ab    Ab
SYNCPOINT39    ×    =    =    5    12    Ab    Ab
SYNCPOINT ROLLBACK39    ×    = 2 or 540 2 or 540 2 or 540 2 or 540 2 or 540
GDS WAIT    ×    Ab    =    5    12    Ab    Ab
GDS FREE    ×    End    Ab    Ab    End    Ab    Ab

 

Table 41. APPC basic conversations at sync level 2, part 4
CONF- SEND CONF- FREE SYNC- RECEIVE SYNC- SEND SYNC- FREE FREE ROLL- BACK Command returns
State 7 State 8 State 9 State 10 State 11 State 12 State 13
   2    12    Ab    Ab    Ab    Ab    Ab Immediately
   12    12    12    12    12    Ab    Ab After response from partner
   2    2    2    2    2    Ab    Ab After response from partner
   12    12    12    12    12    Ab    Ab Immediately
   =    =    =    =    =    Ab    Ab Immediately
   Ab    Ab    Ab    Ab    Ab    Ab    Ab
After response from partner
 
   Ab    Ab    Ab    Ab    Ab    Ab    Ab
After error detected
 
   Ab    Ab    Ab    Ab    Ab    Ab    Ab After error detected
   Ab    Ab    Ab    Ab    Ab    Ab    Ab After response from partner
   Ab    Ab 2 or 540 2 or 540 2 or 540    =    Ab After response from partner
   Ab    Ab    5    2    12    =    Ab After response from partner
2 or 540 2 or 540 2 or 540 2 or 540 2 or 540    Ab 2 or 540 After rollback across UOW
   Ab    Ab    Ab    Ab    Ab    Ab    Ab Immediately
   Ab    Ab    Ab    Ab    Ab    End    Ab Immediately

Initial states

The front-end transaction in a conversation must issue a GDS ALLOCATE command to acquire a session. If the session is successfully allocated, the front-end transaction’s side of the conversation goes into allocated state (state 1).

A back-end transaction is initially in receive state (state 5).

Testing the conversation state

There are two ways for an application to inquire on the current conversation state. The first is to use the EXEC CICS GDS EXTRACT ATTRIBUTES STATE command and the second is to use the STATE parameter on the GDS commands. In both cases the current state is returned to the application in a CICS value data area (cvda). Table 42 shows how the cvda codes relate to the conversation state. The table also shows the symbolic names defined for the cvda values.

Table 42. The conversation states
States used in this book States used in DTP programs
State name State number Symbolic name cvda code
Allocated 1 DFHVALUE(ALLOCATED) 81
Send 2 DFHVALUE(SEND) 90
Pendreceive 3 DFHVALUE(PENDRECEIVE) 87
Pendfree 4 DFHVALUE(PENDFREE) 86
Receive 5 DFHVALUE(RECEIVE) 88
Confreceive 6 DFHVALUE(CONFRECEIVE) 83
Confsend 7 DFHVALUE(CONFSEND) 84
Conffree 8 DFHVALUE(CONFFREE) 82
Syncreceive 9 DFHVALUE(SYNCRECEIVE) 92
Syncsend 10 DFHVALUE(SYNCSEND) 93
Syncfree 11 DFHVALUE(SYNCFREE) 91
Free 12 DFHVALUE(FREE) 85
Rollback 13 DFHVALUE(ROLLBACK) 89

32.
CDBSIG has been omitted. This is because its use is optional and is entirely a matter of agreement between the two conversation partners. In the worst case, it can occur at any time after every command that affects the CDB flags. However, used for the purpose for which it was intended, it usually occurs after a GDS SEND command. Its priority in the order of testing depends on the role you give it in the application.
33.
Before a session is allocated, there is no conversation, and therefore no conversation state. The GDS ALLOCATE command does not appear in the tables. This is because each GDS ALLOCATE gets a session to start a new conversation and does not affect any conversation that is already in progress. After GDS ALLOCATE is successful, the front-end transaction starts the new conversation in allocated state.
34.
The back-end transaction starts in receive state after the front-end transaction has issued GDS CONNECT PROCESS.
35.
You can issue the GDS EXTRACT PROCESS command from the back-end transaction transaction only.
36.
GDS ISSUE SIGNAL sets the partner transaction’s CDBSIG flag.
37.
No data may be included with GDS SEND CONFIRM.
38.
Although CICS® allows you to terminate a sync level-2 conversation using the GDS SEND LAST WAIT or GDS SEND LAST CONFIRM commands, doing this deviates from the APPC architecture and should be avoided. See CICS deviations from the APPC architecture.
39.
The commands SYNCPOINT and SYNCPOINT ROLLBACK do not relate to any particular conversation. They are propagated on all the conversations that are currently active for the task, including MRO conversations.
40.
The state of each conversation after rollback depends on several factors:

A conversation may be in free state after rollback if the it has been terminated in one of these ways:

After a syncpoint or rollback, it is advisable to determine the conversation state before issuing any further commands against the conversation.


[[ Contents Previous Page | Next Page Index ]]