Conversation states
Thirteen conversation states have been defined for CICS DTP. The set of states possible for a particular conversation depends on the protocol and synchronization level used.
The concepts of protocol and synchronization level are explained in Selecting the protocol and Maintaining data integrity respectively. Table 1 shows which conversation states are defined for which protocols and synchronization levels.
| State number | State name | APPC sync level 0 | APPC sync level 1 | APPC sync level 2 | MRO | LUTYPE6.1 normal mode | LUTYPE6.1 migration mode |
|---|---|---|---|---|---|---|---|
| 1 | Allocated | Yes | Yes | Yes | Yes | Yes | Yes |
| 2 | Send | Yes | Yes | Yes | Yes | Yes | Yes |
| 3 | Pendreceive | Yes | Yes | Yes | No | Yes | Yes |
| 4 | Pendfree | Yes | Yes | Yes | Yes | Yes | Yes |
| 5 | Receive | Yes | Yes | Yes | Yes | Yes | Yes |
| 6 | Confreceive | No | Yes | Yes | No | No | Yes |
| 7 | Confsend | No | Yes | Yes | No | No | Yes |
| 8 | Conffree | No | Yes | Yes | No | No | Yes |
| 9 | Syncreceive | No | No | Yes | Yes | Yes | Yes |
| 10 | Syncsend | No | No | Yes | No | Yes | Yes |
| 11 | Syncfree | No | No | Yes | Yes | Yes | Yes |
| 12 | Free | Yes | Yes | Yes | Yes | Yes | Yes |
| 13 | Rollback | No | No | Yes | Yes | No | Yes |
By using a special CICS command (EXTRACT ATTRIBUTES STATE), or the STATE option on a conversation command, a program can obtain a value that indicates its own conversation state. CICS places such a value in a variable named by the program; the variable is sometimes referred to as a state variable. Knowing the current conversation state, the program then knows which commands are allowed. If, for example, a conversation is in send state, the transaction can send data to the partner. (The transaction can take other actions instead, as indicated in the relevant state table.)
When a transaction issues a DTP command, this can cause the conversation state to change. For example, a transaction can deliberately switch the conversation from send state to receive state by issuing a command that invites the partner to send data. When a conversation changes from one state to another, it is said to undergo a state transition.
Not only does the conversation state determine what commands are allowed, but the state on one side of the conversation reflects the state on the other side. For example, if one side is in send state, the other side is in either receive state, confreceive state, or syncreceive state.