CICS Distributed Transaction Guide
CICS Distributed Transaction Guide
SC33-1691-02
CICS® Transaction Server for OS/390® IBM
SC33-1691-02
Note!
Before using this information and the product it supports, be sure to read the general information under “Notices” on page ix.
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
What this book is about . . . . . . . . . . . . . . . . . . . . . xi
Who this book is for. . . . . . . . . . . . . . . . . . . . . . . xi
What is not covered by this book . . . . . . . . . . . . . . . . . . xi
What you need to know to understand this book . . . . . . . . . . . . xi
How to use this book . . . . . . . . . . . . . . . . . . . . . . xi
Determining if a publication is current . . . . . . . . . . . . . . . xii
Biliography . . . . . . . . . . . . . . . . . . . . . . . . . xiii
CICS Transaction Server for OS/390 . . . . . . . . . . . . . . . . xiii
CICS books for CICS Transaction Server for OS/390 . . . . . . . . . xiii
CICSPlex SM books for CICS Transaction Server for OS/390 . . . . . . xiv
Other CICS books . . . . . . . . . . . . . . . . . . . . . . xiv
Books from related libraries . . . . . . . . . . . . . . . . . . . . xiv
IMS. . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Systems Application Architecture (SAA) . . . . . . . . . . . . . . xiv
Systems Network Architecture (SNA) . . . . . . . . . . . . . . . xv
Contents v
Checking the outcome of a DTP command . . . . . . . . . . . . . . 111
Considerations for the front-end transaction . . . . . . . . . . . . . . 113
Session allocation . . . . . . . . . . . . . . . . . . . . . . 113
The session identifier . . . . . . . . . . . . . . . . . . . . . 114
Summary of commands for LUTYPE6.1 conversations . . . . . . . . . . 115
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Contents vii
viii CICS Distributed Transaction Programming Guide
Notices
This information was developed for products and services offered in the U.S.A. IBM
may not offer the products, services, or features discussed in this document in other
countries. Consult your local IBM representative for information on the products and
services currently available in your area. Any reference to an IBM product, program,
or service is not intended to state or imply that only that IBM product, program, or
service may be used. Any functionally equivalent product, program, or service that
does not infringe any IBM intellectual property right may be used instead. However,
it is the user’s responsibility to evaluate and verify the operation of any non-IBM
product, program, or service.
IBM may have patents or pending patent applications covering subject matter
described in this document. The furnishing of this document does not give you any
license to these patents. You can send license inquiries, in writing, to:
For license inquiries regarding double-byte (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
The following paragraph does not apply in the United Kingdom or any other
country where such provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS
PUBLICATION “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A
PARTICULAR PURPOSE. Some states do not allow disclaimer of express or
implied warranties in certain transactions, therefore this statement may not apply to
you.
Licensees of this program who wish to have information about it for the purpose of
enabling: (i) the exchange of information between independently created programs
and other programs (including this one) and (ii) the mutual use of the information
which has been exchanged, should contact IBM United Kingdom Laboratories,
MP151, Hursley Park, Winchester, Hampshire, England, SO21 2JN. Such
information may be available, subject to appropriate terms and conditions, including
in some cases, payment of a fee.
Trademarks
The following terms are trademarks of International Business Machines Corporation
in the United States, or other countries, or both:
Other company, product, and service names may be trademarks or service marks
of others.
CICS Transaction Server for OS/390’s support for the CICS Client family of
workstation products is described in the CICS Family: Communicating from CICS
on System/390.
Readers will find it easier to understand the concepts discussed in this book if they
have read Part 1 of the CICS Intercommunication Guide.
Thereafter, you can use the appropriate parts of the book as guidance and
reference material for your particular task.
Subsequent updates will probably be available in softcopy before they are available
in hardcopy. This means that at any time from the availability of a release, softcopy
versions should be regarded as the most up-to-date.
For CICS Transaction Server books, these softcopy updates appear regularly on the
Transaction Processing and Data Collection Kit CD-ROM, SK2T-0730-xx. Each
reissue of the collection kit is indicated by an updated order number suffix (the -xx
part). For example, collection kit SK2T-0730-06 is more up-to-date than
SK2T-0730-05. The collection kit is also clearly dated on the cover.
Updates to the softcopy are clearly marked by revision codes (usually a “#”
character) to the left of the changes.
If you have any questions about the CICS Transaction Server for OS/390 library,
see CICS Transaction Server for OS/390: Planning for Installation which discusses
both hardcopy and softcopy books and the ways that the books can be ordered.
IMS
v CICS/VS to IMS/VS Intersystem Communication Primer, SH19-6247 through
SH19-6254
v IMS/ESA Data Communication Administration Guide, SC26-3060
v IMS/ESA Operations Guide, SC26-8029
Biliography xv
xvi CICS Distributed Transaction Programming Guide
Summary of Changes
| This edition of the CICS Distributed Transaction Programming Guide is based on
| the Distributed Transaction Programming Guide for CICS Transaction Server for
| OS/390 Release 2, SC33-1691-01.
Changes for the CICS Transaction Server for OS/390 Release 2 edition
There were no significant changes for this edition.
Changes for the CICS Transaction Server for OS/390 Release 1 edition
There were no significant changes for this edition.
| In addition, CICS provides the following methods of accessing CICS programs and
| transactions from non-CICS environments:
| v The CICS bridge
| v The external CICS interface (EXCI)
| v Transactional EXCI
| v Support for DCE Remote Procedure Calls
| v Support for ONC Remote Procedure Calls
| v Inter-orb Protocol (IIOP)
| v The Web interface.
| This book discusses only distributed transaction processing. The other basic
| intercommunication facilities are described in the CICS Intercommunication Guide.
| Methods of accessing CICS programs and transactions from non-CICS
| environments are described in the CICS External Interfaces Guide and the CICS
| Internet Guide.
Of the intercommunication facilities offered by CICS, DTP is the most flexible and
powerful, but also the most complex. This chapter introduces you to the basic
concepts involved in creating DTP applications. For a broad discussion of
intercommunication concepts, see the CICS Intercommunication Guide and the
CICS Supplied Transactions manual.
DTP allows two or more partner programs in different systems to interact with each
other for some purpose. DTP enables a CICS transaction to communicate with one
or more transactions running in different systems. A group of such connected
transactions is called a distributed process.
The process can best be shown by discussing the operation of DTP between two
CICS systems, CICSA and CICSB, as shown in Figure 1.
┌────────────────────┐ ┌────────────────────┐
┌────────┐ │CICSA │ │CICSB │
│┌──────┐│ │ ┌────────────────┐ │ │ ┌────────────────┐ │
││ │├─────Ê┤Transaction TRAA├───────Ê┤Transaction TRBB│ │
┌┴┴──────┤│ │ ├─────────┬ ─ ─ ─┤ │ │ ├─────────┬ ─ ─ ─┤ │
│Terminal├┘ │ │Program X│ │ │ │ │Program Y│ │ │
└────────┘ │ └─────────┴──────┘ │ │ └─────────┴──────┘ │
└────────────────────┘ └────────────────────┘
Although the two programs X and Y exist as independent units, it is clear that they
are designed to work as one. Of course, DTP is not limited to pairs of programs.
You can chain many programs together to distribute processing more widely. This is
discussed later in the book.
In the overview of the process given above, the location of program Y has not been
specified. Program X is a CICS program, but program Y need not be, because
CICS can establish sessions with non-CICS, LUTYPE6.1, MRO, or APPC partners.
This is discussed in “Chapter 2. Designing distributed processes” on page 11.
The rest of this book considers the cases of CICS/ESA® DTP with the following
protocols:
v APPC mapped
v MRO
v APPC basic
v LUTYPE6.1.
Conversations
Although several programs can be involved in a single distributed process,
information transfer within the process is always between self-contained
communication pairs. The exchange of information between a pair of programs is
called a conversation. During a conversation, both programs are active; they send
data to and receive data from each other. The conversation is two-sided but at any
moment, each partner in the conversation has more or less control than the other.
According to its level of control (known as its conversation state), a program has
more or less choice in the commands that it can issue.
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” on page 14 and “Maintaining data integrity” on page 8
respectively.) Table 1 on page 6 shows which conversation states are defined for
which protocols and synchronization levels.
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. The state tables in later chapters show how these transitions
take place.
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.
Sessions
A conversation takes place across a CICS resource called a session. One
transaction (known as the front-end transaction) asks CICS to allocate a session,
and then uses this session to request that the remote transaction (known as the
back-end transaction) be initiated. Then the two transactions, which can be
thought of as partners in the conversation, can “talk to” each other.
A session is a logical data path between two logical units. It is a shared resource
and is allocated to a transaction in response to a request from the transaction.
Distributed processes
A transaction can initiate other transactions, and hence, conversations. In a
complex process, a distinct hierarchy emerges, usually with the terminal-initiated
transaction at the top. Figure 2 shows a possible configuration. In this example,
transaction TRAA, in system CICSA, is initiated from a terminal. Transaction TRAA
attaches transaction TRBB to run in system CICSB. Transaction TRBB in turn
attaches transaction TRCC in system CICSC and transaction TRDD in system
CICSD. Both transactions TRCC and TRDD attach the same transaction SUBR in
system CICSE, thus giving rise to two copies of SUBR.
┌────────────────────┐
┌────────┐ │CICSA │
│┌──────┐│ │ ┌────────────────┐ │
││ │├───────Ê┤Transaction TRAA│ │
┌┴┴──────┤│ │ └───────┬────────┘ │
│Terminal├┘ └──────── │ ─────────┘
└────────┘ │
│
┌──────── │ ─────────┐
│CICSB ø │
│ ┌───────┴────────┐ │
│ │Transaction TRBB│ │
│ └───┬────────┬───┘ │
└──── │ ────── │ ────┘
│ │
┌────────┘ └────────┐
│ │
┌───────── │ ────────┐ ┌──────── │ ─────────┐
│CICSC ø │ │CICSD ø │
│ ┌────────┴───────┐ │ │ ┌───────┴────────┐ │
│ │Transaction TRCC│ │ │ │Transaction TRDD│ │
│ └────────┬───────┘ │ │ └───────┬────────┘ │
└───────── │ ────────┘ └──────── │ ─────────┘
│ │
│ │
┌───────── │ ──────────────────────── │ ─────────┐
│CICSE ø ø │
│ ┌────────┴────────┐ ┌───────┴────────┐ │
│ │Transaction SUBR │ │Transaction SUBR│ │
│ └─────────────────┘ └────────────────┘ │
└────────────────────────────────────────────────┘
Notice that, for every transaction, there is only one inbound attach request, but that
there can be a number of outbound attach requests. The session that activates a
transaction is called its principal facility. A session that is allocated by a
transaction to activate another transaction is called its alternate facility. Therefore,
a transaction can have only one principal facility, but several alternate facilities.
Alternatively, the front-end transaction and back-end transaction may switch control
between themselves. This style of processing is called peer-to-peer. As the name
implies, this model describes communication between equals. You are free to select
whichever model you need when designing your application; CICS supports both.
Sometimes you may need to backout changes to resources, even though no error
conditions have arisen. Consider an order entry system. While entering an order for
a customer, an operator is told by the system that the customer’s credit limit would
be exceeded if the order went through. Because there is no use continuing until the
customer is consulted, the operator presses a PF key to abandon the order. The
transaction is programmed to respond by returning the data resources to the state
they were in at the start of the order transaction.
Although CICS can commit and backout changes to local and remote resources for
you, this service must be paid for in performance. If the recovery of resources
throughout a distributed process is not a problem (for example, in an inquiry-only
application), you can use simpler methods of synchronization.
At sync level 1, you can use special commands for communication between the two
conversation partners. One transaction can confirm the continued presence and
readiness of the other. Both transactions are responsible for preserving the data
integrity of recoverable resources by issuing syncpoint requests at the appropriate
times.
At sync level 2, all syncpoint requests are automatically propagated across multiple
systems. CICS implies a syncpoint when it starts a transaction; that is, it initiates
logging of changes to recoverable resources, but no control flows take place. CICS
takes a syncpoint when one of the transactions terminates normally. One abending
transaction causes all to rollback. The transactions themselves can initiate
syncpoint or rollback requests. However, a syncpoint or rollback request is
propagated to another transaction only when the originating transaction is in
conversation with the other transaction, and sync level 2 has been selected.
Bear in mind that syncpoint and rollback are not limited to any one conversation
within a transaction. They are propagated on every conversation currently active at
sync level 2.
It is assumed that you are already familiar with the issues involved in designing
applications in single CICS systems, as described in the CICS Application
Programming Guide.
Stored information should be retrievable by identifiers that are not associated with
the particular session used by the conversation. The back-end transaction cannot
Maintaining connectivity
If you require connectivity to transactions running in a back-level CICS system,
check the appropriate books for that release to ensure that the functions required
are compatible.
Bear in mind that too many conversations within one distributed transaction
complicates error recovery. A complex structure may sometimes be unavoidable,
but usually it means that the design could be improved if some thought is given to
simplifying the structure of the distributed transaction.
A UOW must be recoverable for the whole process of which it forms a part. All
changes made by both partners in every conversation must be backed out if the
UOW does not complete successfully. Syncpoints are not arbitrary divisions, but
must reflect the functions of the application. Units of work must be designed to
preserve consistent resources so that when a transaction fails, all resources are
restored to their correct state.
Before terminating a sync level-2 conversation, make sure that the partner
transaction is able to communicate any errors that it may have found. Not doing so
may jeopardize data integrity.
To determine the conversation state, you can use either the STATE option on a
command or the EXTRACT ATTRIBUTES STATE command. Note, however, that
the STATE option is valid only for MRO and APPC sessions, not for LUTYPE6.1
sessions. For programming information about the state values returned by different
commands, see the CICS Application Programming Reference manual.
“Maintaining data integrity” on page 8 contains guidance on selecting the sync level
for a conversation. “Chapter 11. Syncpointing a distributed process” on page 123
discusses the synchronization commands and their effects.
The following sections discuss how you choose the protocol, the API, and the
conversation type. These sections also tell you where to find the state tables and
command descriptions relevant to the choice you have made.
Choosing between MRO and APPC can be quite simple. The options depend on
the configuration of your CICS complex and on the nature of the conversation
partner. MRO does not support communication with a partner in a non-CICS
system. Further, it supports communication between transactions running in CICS
systems in different MVS images only if the MVS images are in the same MVS
sysplex, and are joined by cross-system coupling facility (XCF) links; the MVS
images must be at IBM MVS/ESA™ release level 5.1, or later. (For full details of
the hardware and software requirements for XCF/MRO, see the CICS
Intercommunication Guide.)
For communication with a partner in another CICS system, where the CICS
systems are either in the same MVS image, or in the same MVS/ESA 5.1 (or later)
sysplex, you can use either the MRO or the APPC protocol. There are good
performance reasons for using MRO. But if there is any possibility that the
distributed transactions will need to communicate with partners in other operating
systems, it is better to use APPC so that the transaction remains unchanged.
APPC application programs will not run under MRO. Even if both partners are in the
same MVS image, CICS will not use MRO facilities but will send conversation data
through the communications controller. That involves some VTAM overhead. So you
must decide whether your application programs are to converse using APPC or
MRO and code them accordingly.
Table 2 on page 16 points out the main differences between the MRO and APPC
protocols.
If you decide to use the APPC protocol, see the next section APPC protocol and
decide on which programming interface and which conversation type to use.
If you decide to use the MRO protocol, see “Part 3. Writing programs for MRO
conversations” on page 53.
If you decide to use the LUTYPE6.1 protocol, see “Part 5. Writing programs for
LUTYPE6.1 conversations” on page 105.
APPC protocol
If you choose to use APPC, you must decide which application programming
interface (API) to use; and then which conversation type (basic or mapped) to use.
See the following sections.
For further information about CPI Communications, see the Common Programming
Interface Communications manual, SC26-4399.
It is possible to mix CPI Communications calls and EXEC CICS commands in the
same program, but not on the same side of the same conversation. It is possible to
implement a distributed transaction where one partner to a conversation uses CPI
Communications calls and the other uses the CICS API. To do this you have to
know how the APIs on both sides map to the APPC architecture. See “Appendix A.
CICS mapping to the APPC architecture” on page 141.
The two conversation types are similar. The main difference lies in the way user
data is formatted for transmission:
v In mapped conversations, the application merely sends the data to the partner.
v In basic conversations, the application has to add a few control bytes to convert
the data into an SNA-defined format called a generalized data stream (GDS).
The CICS API uses the EXEC CICS GDS commands for basic conversations and
terminal control type EXEC CICS commands for mapped conversations.
If you enable persistent session support in the local CICS, DTP applications that
use APPC sessions defined as persistent are affected as follows:
v Remote partner programs can cause excessive queuing delays in the partner
system if they continue to issue commands on persistent APPC sessions after
this CICS has failed. There is no way for the partner to know that a persistent
sessions restart is in progress. However, there are various actions you can take
to reduce the risk of new work building up for a connection to a persisting CICS
Transaction Server for OS/390 Release 3 system.
Actions on the partner system:
– In DTP applications, requests for sessions are instigated by EXEC CICS
ALLOCATE commands. Control the overall number of queued session
requests by using:
- The QUEUELIMIT and MAXQTIME options on the CONNECTION definition
- An XZIQUE global user exit program.
For further information about VTAM persistent session support, see the CICS
Recovery and Restart Guide.
The different APIs are compared in “Part 1. Concepts and design considerations” on
page 1.
Part 2 contains:
v “Chapter 3. APPC mapped conversation flow” on page 23.
This advises you how to use the EXEC CICS API to write distributed transactions
that use APPC mapped conversations.
v “Chapter 4. State transitions in APPC mapped conversations” on page 41.
This discusses the state transitions that occur when transactions use APPC
mapped conversations under the EXEC CICS API. The state transitions are
presented in the form of state tables showing which commands can be issued
while a conversation partner is in any given state. The tables also show how the
conversation state changes as a result of issuing a command.
Conversation initiation
The front-end transaction is responsible for acquiring a session, specifying the
conversation characteristics and requesting the startup of the back-end transaction
in the remote system.
The RESP value returned should be checked to ensure that a session has been
allocated. If the session is successfully allocated, DFHRESP(NORMAL), the
conversation is in allocated state (state 1) and the session identifier (convid) in
EIBRSRCE must be saved immediately.
The convid must be used in subsequent commands for this conversation. Figure 4
on page 24 shows an example of an ALLOCATE command.
Note: If the remote system is using VTAM persistent session support, you may
need to code a timeout value on the ALLOCATE command. See “Using
VTAM persistent session support” on page 18.
* ...
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(4) COMP VALUE +4.
02 WS-SYNC-LVL PIC S9(4) COMP VALUE +2.
* ...
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 RESP code.
END-IF.
* ...
EXEC CICS CONNECT PROCESS CONVID(WS-CONVID)
STATE(WS-STATE) RESP(WS-RESP)
PROCNAME(WS-PROC)
PROCLENGTH(WS-LEN-PROCN)
SYNCLEVEL(WS-SYNC-LVL)
END-EXEC.
IF WS-RESP = DFHRESP(NORMAL)
THEN
* ... No errors. Check EIB flags.
ELSE
* ... Conversation not started. Examine RESP code.
END-IF.
To examine any PIPs received, the back-end transaction uses the EXTRACT
PROCESS command.
PIP data is used only by the two connected transactions and not by the CICS
systems. APPC systems other than CICS may not support PIP, or may support it
differently.
The PIP data must be formatted into one or more subfields according to the
SNA-architected rules. The content of each subfield is defined by the application
developer. You should format PIP data as follows:
┌──┬──┬──────┬──┬──┬──────┬─ ─ ─ ─┬──┬──┬──────┐
│L1│rr│ PIP1 │L2│rr│ PIP2 │ │Ln│rr│ PIPn │
└──┴──┴──────┴──┴──┴──────┴─ ─ ─ ─┴──┴──┴──────┘
where Ln is a halfword binary integer specifying the length of the subfield in bytes,
and rr represents a reserved halfword. The length includes the length field itself and
the length of the reserved field; that is, Ln = (length of PIPn + 4).
CICS inserts information into the reserved fields to make the PIP architecturally
correct. The PIPLENGTH option must specify the total length of the PIP list and
must be between 4 and 32763.
The back-end transaction can also retrieve its transaction name by issuing the
EXTRACT PROCESS command. In the example shown in Figure 5, CICS places
the transaction name in WS-PROC and the length of the name in WS-LEN-PROCN.
With the EXTRACT PROCESS, the back-end transaction can also retrieve the sync
level at which the conversation was started. In the example, CICS places the sync
level in WS-SYNC-LVL.
Both the ASSIGN and the EXTRACT PROCESS commands are discussed here
only to give you some idea of what you can do in the back-end transaction. They
are not essential. The back-end transaction starts in receive state (state 5), and
must issue a RECEIVE command. By doing this, the back-end transaction receives
whatever data the front-end transaction has sent and allows CICS to raise EIB flags
and change the conversation state to reflect any request the front-end transaction
has issued.
* ...
DATA DIVISION.
WORKING-STORAGE SECTION.
* ...
01 FILLER.
02 WS-CONVID PIC X(4).
02 WS-STATE PIC S9(7) COMP.
02 WS-SYSID PIC X(4) VALUE 'SYSB'.
02 WS-PROC PIC X(4) VALUE 'BBBB'.
02 WS-LEN-PROCN PIC S9(4) COMP VALUE +4.
02 WS-SYNC-LVL PIC S9(4) COMP VALUE +2.
* ...
01 FILLER.
02 WS-RECORD PIC X(100).
02 WS-MAX-LEN PIC S9(4) COMP VALUE +100.
02 WS-RCVD-LEN PIC S9(4) COMP VALUE +0.
* ...
PROCEDURE DIVISION.
* ...
EXEC CICS ASSIGN FACILITY(WS-CONVID) END-EXEC.
* ...
* Extract the conversation characteristics.
*
EXEC CICS EXTRACT PROCESS PROCNAME(WS-PROC)
PROCLENGTH(WS-LEN-PROCN)
SYNCLEVEL(WS-SYNC-LVL)
END-EXEC.
* ...
* Receive data from the front-end transaction.
*
EXEC CICS RECEIVE CONVID(WS-CONVID) STATE(WS-STATE)
INTO(WS-RECORD) MAXLENGTH(WS-MAX-LEN)
NOTRUNCATE LENGTH(WS-RCVD-LEN)
END-EXEC.
*
* ... Check outcome of RECEIVE.
* ...
Before sending data, the front-end transaction should find out whether the back-end
transaction has started successfully. One way of doing this is to issue a SEND
CONFIRM command directly after the CONNECT PROCESS command. This
causes the front-end transaction to suspend until the back-end transaction responds
or the failure notification described above is received. SEND CONFIRM is
discussed in “How to synchronize a conversation using CONFIRM commands” on
page 33.
One possibility is to use a RECEIVE command. The state tables show that CICS
supplies the INVITE and WAIT when a SEND is followed immediately by a
RECEIVE.
Another possibility is to use a SEND INVITE command. The state tables show that
after SEND INVITE the conversation switches to pendreceive state (state 3). The
column for state 3 shows that a WAIT CONVID command switches the conversation
to receive state (state 5).
Still another possibility is to specify the INVITE and WAIT options on the SEND
command. The state tables show that after SEND INVITE WAIT, the conversation
switches to receive state (state 5).
* ...
DATA DIVISION.
WORKING-STORAGE SECTION.
* ...
01 FILLER.
02 WS-RESP PIC S9(7) COMP.
02 WS-STATE PIC S9(7) COMP.
* ...
PROCEDURE DIVISION.
* ...
* Check return code from SEND INVITE WAIT
IF WS-RESP = DFHRESP(NORMAL)
THEN
* ... Request successful
IF EIBERR = LOW-VALUES
THEN
* ... No errors, check state
IF WS-STATE = DFHVALUE(RECEIVE)
THEN
* ... SEND OK, continue processing
ELSE
* ... Logic error, should never happen
END-IF
ELSE
* ... Error indicated
EVALUATE WS-STATE
WHEN DFHVALUE(ROLLBACK)
* ... ROLLBACK received
WHEN DFHVALUE(RECEIVE)
* ... ISSUE ERROR received, reason in EIBERRCD
WHEN OTHER
* ... Logic error, should never happen
END-EVALUATE
END-IF
ELSE
* ... Examine RESP code for source of error.
END-IF.
Note: In the same way as it is possible to send the INVITE, LAST, and CONFIRM
commands with data, it is also possible to receive them with data. It is also
possible to receive a syncpoint request with data. However, ISSUE ERROR,
ISSUE ABEND, and conversation failure are never received with data.
If an ISSUE ERROR command is used in receive state (state 5), all incoming data
is purged until an INVITE, SYNCPOINT, or LAST command is received. If LAST is
received, no error indication is sent to the partner transaction, EIBFREE=X'FF' and
the conversation is switched to free state (state 12).
If LAST is not received, the conversation is switched to send state (state 2). It is
normal programming practice to communicate the reason for the ISSUE ERROR to
the partner transaction. The CONVERSE command could be used to send an
appropriate error message and receive a reply.
Because ISSUE ERROR is allowed in both send state (state 2) and receive state
(state 5), it is possible for both communicating transactions to use ISSUE ERROR
at the same time. When this occurs, only one of the ISSUE ERROR commands is
effective. The other is purged with incoming data. However both ISSUE ERROR
commands will appear to have completed successfully and the transaction whose
ISSUE ERROR was purged will pick up EIBERR=X'FF' on a subsequent command.
The following sections describe these commands in more detail. The descriptions
refer to the state tables for sync levels 1 and 2.
Requesting confirmation
The CONFIRM option of the SEND command flushes the conversation send buffer;
that is, it causes a transmission to occur. When the conversation is in send state
(state 2), you can send data with the SEND CONFIRM command. You can also
specify either the INVITE or the LAST option.
The send state (state 2) column of the state table for APPC mapped conversations
at sync level 1 on page 44 shows what happens for the possible combinations of
the CONFIRM, INVITE, and LAST options. After a SEND CONFIRM command,
without the INVITE or LAST options, the conversation remains in send state (state
2). If the INVITE option is used, the conversation switches to receive state (state
5). If the LAST option is used, the conversation switches to free state (state 12).
A similar effect to SEND LAST CONFIRM can by achieved by using the command
sequence:
SEND LAST
SEND CONFIRM
Note from the state tables that the SEND LAST puts the conversation into pendfree
state (state 4), so data cannot be sent with a SEND CONFIRM command used in
this way.
If the partner replies ISSUE ERROR, this is indicated by EIBERR=X'FF' and the
first two bytes of EIBERRCD = X'0889'. When the partner replies ISSUE ERROR in
response to SEND LAST CONFIRM, the LAST option is ignored and the
conversation is not terminated. The conversation state is switched to receive state
(state 5).
If the partner replies ISSUE ABEND, your transaction will be abended AZCH. In
addition, EIBERR and EIBFREE are set, and the first two bytes of
EIBERRCD=X'0864'. The conversation is switched to free state.
From the state tables it can be seen that it is possible to end a conversation by
issuing the FREE command, provided the conversation is in send state (state 2).
This will generate an implicit SEND LAST WAIT command before the FREE is
executed and is therefore not recommended for conversations using sync levels 1
and 2.
The transaction that issues the ISSUE ABEND command is not itself abended. It
must, however, issue a FREE command for the conversation unless it is designed
to terminate immediately.
If an ISSUE ABEND command is issued in receive state (state 5), CICS purges all
incoming data until an INVITE, syncpoint request, or LAST indicator is received. If
LAST is received, no abend indication is sent to the partner transaction.
If an ISSUE ABEND is received, CICS abends the transaction with abend code
AZCH, sets on EIBERR(=X'FF'),EIBFREE(=X'FF'), and places X'0864' in the first
two bytes of EIBERRCD.
3. It is important that the SEND LAST command for sync level 2 is not accompanied by WAIT or CONFIRM because either of these
options will cause the conversation to end before the subsequent syncpoint has propagated to the partner transaction. This may
mean that protected resources of one transaction could be committed while those in the partner transaction could be backed out.
The resulting state errors may also lead to the session being unbound.
Testing for request failure is the same as for other EXEC CICS commands in that
conditions are raised and can be handled using HANDLE CONDITION or RESP.
EIBRCODE will also contain an error code. Note that when an ISSUE ABEND has
been received, and it is to be handled, a HANDLE ABEND should be used rather
than a HANDLE CONDITION.
If the request has not failed, it is then possible to test for indicators received on the
conversation. These are returned to the application in the EIB. The following EIB
fields are relevant to all DTP commands:
EIBERR
when set to X'FF' indicates an error has occurred on the conversation. The
reason is in EIBERRCD. This could be as a result of an ISSUE ERROR, ISSUE
ABEND, or SYNCPOINT ROLLBACK command issued by the partner
transaction. EIBERR can be set as a result of any command that can be issued
while the conversation is in receive state (state 5) or following any command
that causes a transmission to the partner system. It is safest to test EIBERR in
conjunction with EIBFREE and EIBSYNRB after every DTP command.
EIBERRCD
contains the error code associated with EIBERR. If EIBERR is not set, this field
is not used.
EIBFREE
when set to X'FF' indicates that the partner transaction had ended the
conversation. It should be tested along with EIBERR and EIBSYNC to find out
exactly how to end the conversation.
EIBSIG
when set to X'FF' indicates the partner transaction or system has issued an
ISSUE SIGNAL command.
EIBSYNRB
when set to X'FF' indicates the partner transaction or system has issued a
SYNCPOINT ROLLBACK command. (This is relevant only for conversations at
sync level 2.)
In addition, the following EIB fields are relevant only to the RECEIVE and
CONVERSE commands:
EIBCOMPL
when set to X'FF' indicates that all the data sent at one time has been received.
This field is used in conjunction with the RECEIVE NOTRUNCATE command.
EIBCONF
when set to X'FF' indicates that the partner transaction has issued a SEND
CONFIRM command and requires a response.
EIBEOC
when set to X'FF' indicates that an end-of-chain indicator has been received.
This field is normally associated with a successful RECEIVE command.
EIBNODAT
when set to X'FF' indicates that no application data has been received.
EIBRECV
is only used when EIBERR is not set. When EIBRECV is on (X'FF'), another
RECEIVE is required.
EIBSYNC
when set to X'FF' indicates that the partner transaction or system has requested
a syncpoint. (This is relevant only for conversations at sync level 2.)
After analyzing the EIB fields, you can test the conversation state to determine
which DTP commands you can issue next. See “Chapter 4. State transitions in
APPC mapped conversations” on page 41.
For example, if after a SEND INVITE WAIT or a RECEIVE command has been
issued, the conversation is in receive state (state 5), only EIBERR indicates that
the partner transaction has sent an ISSUE ERROR. This is illustrated in Figure 7 on
page 29 and Figure 8 on page 31.
It should be noted that the state tables provided contain not only states and
commands issued, but also relevant EIB field settings. The order in which these EIB
fields are shown provides a sensible sequence of checks for an application.
For programming information about CICS commands, see the CICS Application
Programming Reference manual.
A number at an intersection indicates the state number of the next state. Other
symbols represent other conditions, as follows:
Symbol Meaning
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
ISSUE CONFIRMATION × Ab Ab Ab Ab Ab 5
ISSUE ERROR EIBFREE Ab 12 12 Ab 12 12
ISSUE ERROR × Ab = 2 Ab 2 2
ISSUE ABEND × Ab 12 12 12 12 12
ISSUE SIGNAL12 × Ab = = Ab = =
WAIT CONVID × Ab = 5 12 Ab Ab
FREE × End End9 Ab End Ab Ab
Ab Ab Ab Ab Ab Ab Ab Immediately
Ab Ab Ab Ab Ab Ab Ab Immediately
= = = = = = = Immediately
= = = = = = = Immediately
table continued......
ISSUE CONFIRMATION × Ab Ab Ab Ab Ab 5
ISSUE ERROR EIBFREE Ab 12 12 Ab 12 12
ISSUE ERROR × Ab = 2 Ab 2 2
ISSUE ABEND × Ab 12 12 12 12 12
ISSUE SIGNAL12 × Ab = = Ab = =
WAIT CONVID × Ab = 5 12 Ab Ab
FREE × End End9 Ab End Ab Ab
4. EIBSIG 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 EIB flags. However, used for the purpose
for which it was intended, it usually occurs after a SEND command. Its priority in the order of testing depends on the role you give
it in the application.
5. You can issue the EXTRACT PROCESS command from the back-end transaction only.
6. RECEIVE NOTRUNCATE returns a zero value in EIBCOMPL to indicate that the user buffer was too small to contain all the data
received from the partner transaction. Normally, you would continue to issue RECEIVE NOTRUNCATE commands until the last
section of data is passed to you, which is indicated by EIBCOMPL = X'FF'. If NOTRUNCATE is not specified, and the data area
specified by the RECEIVE command is too small to contain all the data received, CICS truncates the data and sets the LENGERR
condition.
7. Equivalent to SEND INVITE WAIT followed by RECEIVE.
8. Equivalent to SEND INVITE WAIT [FROM] followed by RECEIVE.
9. Equivalent to SEND LAST WAIT followed by FREE.
10. Equivalent to WAIT followed by RECEIVE.
11. Before a session is allocated, there is no conversation, and therefore no conversation state. The EXEC CICS ALLOCATE
command does not appear in the tables. This is because each ALLOCATE gets a session to start a new conversation and does
not affect any conversation that is already in progress. After ALLOCATE is successful, the front-end transaction starts the new
conversation in allocated state.
12. ISSUE SIGNAL sets the partner’s EIBSIG flag.
13. The back-end transaction starts in receive state after the front-end transaction has issued CONNECT PROCESS.
14. No data may be included with SEND CONFIRM.
15. Although CICS allows you to terminate a sync level-2 conversation using the SEND LAST WAIT or SEND LAST CONFIRM
commands, doing this deviates from the APPC architecture and should be avoided. See “CICS deviations from the APPC
architecture” on page 159.
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
= = =16 =16 =16 Ab Ab Immediately
Ab20 Ab20 2 or 518 2 or 518 2 or 518 = Ab20 After response from partner
Ab20 Ab20 5 2 12 = Ab20 After response from partner
2 or 518 2 or 518 2 or 518 2 or 518 2 or 518 = 2 or 518 After rollback across UOW
Ab Ab Ab Ab Ab Ab Ab Immediately
Ab Ab Ab Ab Ab End Ab Immediately
16. Where APPC transaction routing is taking place, the ISSUE SIGNAL command is invalid in this state.
17. 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.
18. The state of each conversation after rollback depends on several factors:
v The system you are communicating with. Some earlier versions of CICS handle rollback differently from CICS Transaction
Server for OS/390 Release 3.
v The conversation state at the beginning of the current distributed unit of work. This state is the one adopted according to the
APPC architecture. CICS Transaction Server for OS/390 Release 3 follows the architecture.
A conversation may be in free state after rollback if it has been terminated in one of these ways:
v Abnormally due to session failure or deallocate abend being received
v Because the partner transaction has issued a SEND LAST WAIT or FREE commands.
After a syncpoint or rollback, it is advisable to determine the conversation state before issuing any further commands against the
conversation.
19. This results, not in an ATCV abend, but in an INVREQ return code.
20. This causes an ASP2 abend, not an ATCV.
21. Although ISSUE PREPARE can return with the conversation in either syncsend state, syncreceive state, or syncfree state, the
only commands allowed on that conversation following an ISSUE PREPARE are SYNCPOINT and SYNCPOINT ROLLBACK. All
other commands abend ATCV.
The first is to use the EXEC CICS EXTRACT ATTRIBUTES STATE command and
the second is to use the STATE parameter on the DTP commands. In both cases
the current state is returned to the application in a CICS value data area (cvda).
Table 20 on page 51 shows how the cvda codes relate to the conversation state.
The table also shows the symbolic names defined for these cvda values.
The different APIs are compared in “Part 1. Concepts and design considerations” on
page 1.
Part 3 contains:
v “Chapter 5. MRO conversation flow” on page 55.
This advises you how to use the EXEC CICS API to write distributed transactions
that use MRO conversations.
v “Chapter 6. State transitions in MRO conversations” on page 67.
This discusses the state transitions that occur when transactions use MRO
conversations under the EXEC CICS API. The state transitions are presented in
the form of a state table that shows which commands can be issued while the
conversation is in any given state. The table shows how the conversation state
changes as a result of issuing a command.
Conversation initiation
The front-end transaction is responsible for acquiring a session, specifying the
conversation characteristics and requesting the startup of the back-end transaction
in the partner system.
The RESP value returned should be checked to ensure that a session has been
allocated. If successfully allocated, DFHRESP(NORMAL), the conversation is in
allocated state (state 1) and the session identifier (convid) from EIBRSRCE must
be saved immediately.
The convid must be used in subsequent commands for this conversation. Figure 9
on page 57 shows a program fragment containing an example of the ALLOCATE
command. You will notice that the PROFILE option has been omitted from the
command.
If the PROFILE option is specified for an MRO link, CICS ignores it at execution
time. So none of the facilities selected through use of a profile (for example,
RTIMEOUT and JOURNALING) are available. The front-end transaction has no
control over its session processing options when an MRO session is being used.
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.
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.
When the back-end transaction receives data, the presence of an attach header is
indicated by either EIBATT or RESP(INBFMH). One of these is normally set after
the back-end transaction issues its first RECEIVE command. The EXTRACT
ATTACH command can be used to access session-related information from the
attach header (for example, the back-end transaction identifier) if required, but it is
not mandatory.
Note: In the same way as it is possible to send the INVITE and LAST indicators
with data, it is also possible to receive them with data. Syncpoint requests
may also be received with data. However, indications of conversation failure
are never received with data.
From the state table it can be seen that it is possible to end a conversation by
issuing the FREE command provided the conversation is in send state (state 2).
This generates an implicit SEND LAST WAIT command before the FREE is
executed and therefore is not recommended.
Testing for request failure is the same as for other EXEC CICS commands in that
conditions are raised and may be handled using HANDLE CONDITION or RESP.
EIBRCODE will also contain an error code.
If the request has not failed, it is possible to test for indicators received on the
conversation. These are returned to the application in the EIB. The following EIB
fields are relevant to all MRO DTP commands. (See the CICS Application
Programming Reference manual for programming information on the contents and
format of EIB fields.)
EIBFREE
when set to X'FF' indicates that the partner transaction has ended the
conversation. It should be tested in conjunction with EIBSYNC to determine
exactly how to end the conversation.
EIBSYNC
when set to X'FF' indicates the partner transaction has requested a syncpoint.
EIBSYNRB
when set to X'FF' indicates the partner transaction has issued a SYNCPOINT
ROLLBACK command.
In addition the following EIB fields are relevant only to the RECEIVE and
CONVERSE commands:
EIBATT
when set to X'FF' indicates that the data received contained an attach header.
The attach header is not passed to the application; however, EIBATT indicates
that an EXTRACT ATTACH command is appropriate.
EIBCOMPL
when set to X'FF' indicates that all the data sent at one time has been received.
This field is used in conjunction with the RECEIVE NOTRUNCATE command.
After the EIB fields have been analyzed, it is possible to test the conversation state
to determine which DTP commands may be issued next. See “Chapter 6. State
transitions in MRO conversations” on page 67.
Note: CICS ignores the profile you specify on the PROFILE option of the
ALLOCATE for an MRO link and instead uses the default profile. This
enables FMHs to be sent and received and EIBATT or EIBFMH to be set
appropriately. The default profile DFHCICSA, used for the session allocated
by the front-end transaction, has INBFMH (ALL) specified. The default
principal facility profile DFHCICST used for the back-end transaction does
not have INBFMH (ALL) specified.
Note that the state table provided in “Chapter 6. State transitions in MRO
conversations” on page 67 contains not only states and commands issued, but also
relevant EIB fields settings. The order in which the EIB fields are shown provides a
sensible sequence for checking them in an application.
For programming information about CICS commands, see the CICS Application
Programming Reference manual.
A number at an intersection indicates the state number of the next state. Other
symbols represent other conditions, as follows:
Symbol Meaning
CONVERSE25 EIB flags and states as for RECEIVE but allowed in send state
29
SYNCPOINT EIBRLDBK = 2 or 528 N/A 2 or 528 Ab22 N/A
SYNCPOINT29 × = = N/A 12 Ab22 N/A
N/A N/A 2 or 528 N/A 2 or 528 = 2 or 528 After rollback across UOW
27. Before a session is allocated, there is no conversation, and therefore no conversation state. The ALLOCATE command does not
appear in the table. This is because each ALLOCATE gets a session to start a new conversation and does not affect any
conversation that is already in progress. After ALLOCATE is successful, the front-end transaction starts the new conversation in
allocated state.
You select the partner transaction program by issuing a SEND command or a CONVERSE command. You have the choice of
identifying the transaction program either in the first four bytes of the user data or in the attach function management header built
by the BUILD ATTACH command.
The back-end transaction starts in receive state.
28. The state of each conversation after rollback depends on several factors:
v The system you are communicating with. Some earlier versions of CICS handle rollback differently from CICS Transaction
Server for OS/390 Release 3.
v The conversation state at the beginning of the current distributed unit of work. This state is the one adopted according to the
APPC architecture. CICS Transaction Server for OS/390 Release 3 follows the architecture.
Always use the EXTRACT ATTRIBUTES STATE command or the STATE option on the EXEC CICS commands to determine the
conversation state.
29. The commands SYNCPOINT and SYNCPOINT ROLLBACK do not relate to any particular conversation, but are propagated on
all the conversations that are currently active for the task, including APPC conversations.
The different APIs are compared in “Part 1. Concepts and design considerations” on
page 1.
Part 4 contains:
v “Chapter 7. APPC basic conversation flow” on page 73.
This describes how to write APPC basic conversations using the EXEC CICS
GDS interface. To use this interface, the application must insert the data to be
sent into GDS (generalized data stream) records and extract it from records
received. This part describes the format of GDS records and a possible strategy
for building them.
Note that CICS applications that use the APPC basic interface can be
written only in assembler language or C/370.
v “Chapter 8. State transitions in APPC basic conversations” on page 95.
This discusses the state transitions that occur when transactions use APPC basic
conversations under the EXEC CICS GDS API. The state transitions are
presented in the form of state tables showing which commands can be issued
while a conversation partner is in any given state. The tables also show how the
conversation state changes as a result of issuing a command.
For further information about the APPC architecture, see the Peer Protocols
manual, SC30-3269 and the LU6.2 Reference: Verb Descriptions manual,
GC30-3084. For information about the mapping between APPC verbs and CICS
commands, see “Appendix A. CICS mapping to the APPC architecture” on
page 141.
Conversation initiation
The front-end transaction is responsible for acquiring a session, specifying the
conversation characteristics, and requesting the startup of the back-end transaction
in the partner system.
RETCODE should be checked to ensure that a session has really been allocated. If
successfully allocated (RETCODE = X'00'), the conversation is in allocated state
(state 1) and the session identifier (convid) is placed in the data area specified on
the CONVID parameter.
The convid must be used in subsequent commands for this conversation. Figure 14
on page 74 shows an example of a GDS ALLOCATE command.
Note: If the remote system is using VTAM persistent session support, you may
need to code a timeout value on the GDS ALLOCATE command. See “Using
VTAM persistent session support” on page 18.
* ...
EXEC CICS GDS ALLOCATE SYSID(WSYSID) CONVID(WCONVID) *
STATE(WSTATE) RETCODE(WRETC)
*
* Check outcome of GDS ALLOCATE
*
NC WRETC,WRETC
BNZ ALLOCERR No session allocated, check RETCODE
* ...
EXEC CICS GDS CONNECT PROCESS CONVID(WCONVID) STATE(WSTATE) *
PROCNAME(WPROC) *
PROCLENGTH(WLENPROC) *
SYNCLEVEL(WSYNCLVL) *
CONVDATA(WCDB) RETCODE(WRETC)
NC WRETC,WRETC
BNZ CONNERR Request failed, analyze RETCODE
* ... No errors, conversation started.
NC CDBERR,CDBERR
BNZ SESSERR Session failed, examine RETCODE.
* ... Start sending data.
* ...
WSTATE DS F
WRETC DS XL6
WCDB DS 0CL24
COPY DFHCDBLK
WCONVID DS CL4
WSYSID DC CL4'SYSB'
WPROC DC CL4'BBBB'
WLENPROC DC F'4'
WSYNCLVL DC F'2'
* ...
To examine any PIPs received, the back-end transaction uses the GDS EXTRACT
PROCESS command.
PIP data is used only by the two connected transactions and not by the CICS
systems. APPC systems other than CICS may not support PIP, or may support it
differently.
The PIP data must be formatted into one or more subfields according to the
SNA-architected rules. The content of each subfield is defined by the application
developer. You should format PIP data as follows:
┌──┬──┬──────┬──┬──┬──────┬─ ─ ─ ─┬──┬──┬──────┐
│L1│rr│ PIP1 │L2│rr│ PIP2 │ │Ln│rr│ PIPn │
└──┴──┴──────┴──┴──┴──────┴─ ─ ─ ─┴──┴──┴──────┘
where Ln is a halfword binary integer specifying the length of the subfield, and rr
represents a reserved halfword. The length includes the length field itself and the
length of the reserved field; that is, Ln = (length of PIPn + 4).
CICS inserts information in the reserved fields so that the PIP is architecturally
correct. The PIPLENGTH option must specify the total length of the PIP list and
must be between 4 and 32763.
* ...
EXEC CICS GDS ASSIGN PRINCONVID(WCONVID) RETCODE(WRETC)
*
* ...
*
EXEC CICS GDS EXTRACT PROCESS CONVID(WCONVID) *
PROCNAME(WPROC) RETCODE(WRETC) *
PROCLENGTH(WLENPROC) *
SYNCLEVEL(WSYNCLVL)
* ...
* Receive first data from front-end transaction.
* ...
*
WSTATE DS F
WRETC DS XL6
WCDB DS 0CL24
COPY DFHCDBLK
WCONVID DS CL4
WPROC DS CL4
WLENPROC DS F
WSYNCLVL DS F
* ...
Before sending data, the front-end transaction should find out whether the back end
transaction has started successfully. One way of doing this is to issue a GDS SEND
CONFIRM command directly after the GDS CONNECT PROCESS. This causes the
front-end transaction to be suspended until the back end transaction has responded
or the back-end system has sent the failure notification described above.
┌──────────────────────Concatenation bit
│ ┌──────────────────LL
│ │ ┌──────Data
ø ø ø
┌┬──────┬──────────────────────── ── ── ────────────────────┐
└┴──────┴───────────────────────── ─── ─ ───────────────────┘
Í─────────────────────Value in LL─────────────────────────Ê
Data formatted into GDS records can be transmitted by the GDS SEND command.
This command is valid only in send state (state 2).
Because a simple GDS SEND keeps the conversation in send state (state 2), you
can issue a number of successive sends. You need not issue a GDS SEND for
every record to be sent; you can send partial or multiple records at a time.
However, make sure that the last logical record is complete when you use the
INVITE, LAST, or CONFIRM options, and before you issue a syncpoint request.
Figure 17 is an example of the use of GDS SEND commands.
┌──────────────────────────────────GDS SEND
│ ┌────────────────────────GDS SEND
│ │ ┌───────────────GDS SEND
│ │ │ ┌──GDS SEND INVITE WAIT
│ │ │ │
│ ø │ ø │ ø │ ø │
├─────────────┬──┴────┴┬───────────┬┴─────────┤
│ Record 1 │Record 2│ Record 3 │ Record 4 │
└─────────────┴────────┴───────────┴──────────┘
This flexibility also allows you to use separate GDS SEND commands for the GDS
header and the application data—a useful technique to avoid shifting data into
storage contiguous with its GDS header. The program fragment in Figure 18 uses
this technique.
STATE(WSTATE) CONVDATA(WCDB)
*
* ... Check outcome of the SEND
* ...
LA R5,L'SENDDATA Length of application data
ST R5,SENDLEN into send length field
EXEC CICS GDS SEND FROM(SENDDATA) FLENGTH(SENDLEN) *
CONVID(WCONVID) RETCODE(WRETC) *
STATE(WSTATE) CONVDATA(WCDB)
*
* ... Check outcome of the SEND
* ...
EXEC CICS GDS SEND INVITE WAIT *
CONVID(WCONVID) RETCODE(WRETC) *
STATE(WSTATE) CONVDATA(WCDB)
*
* ... Check outcome of SEND INVITE WAIT
* ...
*
WSTATE DS F
WRETC DS XL6
WCDB DS 0CL24
COPY DFHCDBLK
WCONVID DS CL4
SENDDATA DS CL100
SENDLEN DS F
SENDHDR DS H
* ...
The records from a simple GDS SEND command are initially stored in a local CICS
buffer which is “flushed” either when this buffer is full or when the transaction
requests transmission. The transaction can request transmission either by using a
GDS WAIT command or by using the WAIT option on the GDS SEND command.
The reason transmission is deferred is to reduce the number of calls to the network.
However, the application should use GDS WAIT if the partner transaction requires
the data to continue processing.
The first factor is obvious: the application cannot receive more than is sent. The
value of MAXFLENGTH is an upper limit; CICS never returns more bytes than this
value specifies. The LLID and BUFFER options enable the application to specify
how CICS is to treat the data. This is described in Receiving data by the record and
“Receiving data by the buffer” on page 81.
In the same way as it is possible to send GDS records with the INVITE, LAST, or
CONFIRM option, it is also possible to receive them together. Syncpoint requests
can also be received with GDS records. However, GDS ISSUE ERROR, GDS
ISSUE ABEND, and indications of conversation failure are received by themselves
—never with GDS records.
STATE(WSTATE) CONVDATA(WCDB)
*
* ... Check outcome of the GDS RECEIVE
* ...
LA R5,L'RECVAREA Length of application buffer
ST R5,RECVMAX as maximum receive length
* Receive application data from partner transaction
EXEC CICS GDS RECEIVE INTO(RECVAREA) MAXFLENGTH(RECVMAX) *
LLID FLENGTH(RECVLEN) *
CONVID(WCONVID) RETCODE(WRETC) *
STATE(WSTATE) CONVDATA(WCDB)
* ...
* ... Check outcome of the GDS RECEIVE
* ... (including CDBCOMPL).
B RECVLOOP Loop while in receive state
* ...
*
WSTATE DS F
WRETC DS XL6
WCDB DS 0CL24
COPY DFHCDBLK
WCONVID DS CL4
RECVAREA DS CL100
RECVMAX DS F
RECVLEN DS F
RECVHDR DS H
* ...
The first RECEIVE command receives the front portion of the first record. The
length received is restricted by the MAXFLENGTH value (MAXFL1). The second
RECEIVE command receives the rest of the first logical record. Even though the
MAXFLENGTH value (MAXFL2) allows more data to be received, this cannot be
done without breaking the LL boundary rule. The third RECEIVE command is for
two bytes of data (the LL field). The fourth RECEIVE command receives the rest of
the second record.
The application can tell if a complete record has been received, because
CDBCOMPL is set (X'FF'). So, in the example given above, CDBCOMPL is set on
after the second and fourth RECEIVE commands. CDBCOMPL is set off (X'00')
after the first and third RECEIVE commands.
Figure 21 on page 82 shows the effect of the BUFFER option on the same four
RECEIVE commands discussed in “Receiving data by the record” on page 80.
If a GDS ISSUE ERROR command is used in receive state (state 5), all incoming
data is purged until an INVITE, SYNCPOINT or LAST is received. If LAST is
received, no error indication is sent to the partner transaction, CDBFREE is set
(X'FF') and the conversation is switched to free state (state 12).
If LAST is not received, the conversation is switched to send state (state 2). It is
normal to communicate the reason for the error to the partner transaction. The GDS
SEND INVITE WAIT command could be used to send an appropriate error
message and then a GDS RECEIVE could be used to receive a reply.
Because GDS ISSUE ERROR is allowed in both send state (state 2) and receive
state (state 5), it is possible for both communicating transactions to use GDS
The following sections describe these commands in more detail. The descriptions
refer to the state tables for sync levels 1 and 2.
Requesting confirmation
The CONFIRM option on the GDS SEND command flushes the conversation send
buffer; that is, it causes a real transmission to occur.
Data can be sent with the GDS SEND CONFIRM command. Either the INVITE or
the LAST option can also be specified.
A similar effect to GDS SEND LAST CONFIRM can by achieved by using the
command sequence:
GDS SEND LAST
GDS SEND CONFIRM
Note from the state tables that the GDS SEND LAST puts the conversation into
pendfree state (state 4), so data cannot be sent with a GDS SEND CONFIRM
command used in this way.
The form of command used depends on how the conversation is to continue if the
required confirmation is received. Whichever is used, the response from GDS
SEND CONFIRM must always be checked. (See “Checking the response to GDS
SEND CONFIRM”.)
If the partner transaction replies GDS ISSUE ERROR, this is indicated by CDBERR
(=X'FF') and the first two bytes of CDBERRCD=X'0889'. When the partner
transaction replies GDS ISSUE ERROR in response to GDS SEND LAST
CONFIRM, the LAST option is ignored and the conversation is not terminated. The
conversation is switched to receive state (state 5).
If the partner transaction replies GDS ISSUE ABEND, both CDBERR and
CDBFREE are both set (X'FF'), and the first two bytes of CDBERRCD contain
X'0864'. The conversation is switched to free state (state 12).
The transaction that issues the GDS ISSUE ABEND command is not itself abended.
It must, however, issue a FREE command for the conversation unless it is designed
to terminate immediately.
If a GDS ISSUE ABEND command is issued in receive state (state 5), CICS
purges all incoming data until an INVITE, syncpoint request, or LAST indicator is
received. If LAST is received, no abend indication is sent to the partner transaction.
If a GDS ISSUE ABEND is received, both CDBERR and CDBFREE set (X'FF'), the
first two bytes of CDBERRCD contain X'0864'. The only command that can be
subsequently issued for the conversation is GDS FREE.
31. It is important that the GDS SEND LAST command for sync level 2 is not accompanied by WAIT or CONFIRM because either of
these options will cause the conversation to end before the subsequent syncpoint has propagated to the partner transaction. This
may mean that protected resources of one transaction could be committed while those in the partner transaction could be backed
out. The resulting state errors may also lead to the session being unbound.
Checking the response from a GDS command can be separated into three stages:
1. Testing for request failure; this involves testing RETCODE.
2. Testing for indicators received on the conversation. These indicators are found
in CONVDATA.
3. Testing the conversation state.
These errors usually reflect failure of the request. Figure 22 on page 88 shows the
possible hexadecimal values for the first three bytes of RETCODE. These values
are structured so that the first byte indicates the general error description and
subsequent bytes provide the detail.
Testing indicators
When RETCODE shows a normal return code from a GDS command, the
CONVDATA area (where applicable) contains information on the indicators received
on the conversation. These indicators can be used to find out why the conversation
state is what it is.
These definitions are provided in copybook DFHCDBLK. There is one copybook for
C/370, which defines a typedef for the structure, and another copybook for
assembler. To provide the flexibility to enable your application to manage more than
one conversation at the same time, the assembler version does not contain a
DSECT statement.
In addition, the following CONVDATA fields are relevant only to GDS RECEIVE
commands:
CDBCOMPL
when set to X'FF' indicates that all the data sent at one time has been received.
This field is used in conjunction with the GDS RECEIVE LLID command.
CDBCONF
when set to X'FF' indicates that the partner transaction has issued a GDS
SEND CONFIRM command and requires a response.
CDBRECV
is only used when CDBERR is not set. When CDRECV is on (X'FF'), another
GDS RECEIVE is required.
CDBSYNC
when set to X'FF' indicates that the partner transaction or system has requested
a syncpoint. (This is relevant only for conversations at sync level 2.)
Table 33 shows how some of these CDB fields interact for RECEIVE commands.
Table 33. Interaction between some CDB fields—RECEIVE commands only
CDB- ERR CDB- CDB- CDB- CDB- Description
FREE RECV SYNC CONF
X'00' X'00' X'00' X'00' X'00' The partner transaction or system has issued GDS
SEND INVITE WAIT. The local program is now in
send state.
After analyzing the CONVDATA fields, you can test the conversation state to find
out which GDS commands you can issue next. See “Chapter 8. State transitions in
APPC basic conversations” on page 95.
For example, if after a GDS SEND INVITE WAIT or a GDS RECEIVE command
has been issued, the conversation is in receive state (state 5), only CDBERR
indicates that the partner transaction has sent a GDS ISSUE ERROR. This is
illustrated in Figure 23 on page 92 and Figure 24 on page 93.
It should be noted that the state tables provided contain not only conversation
states and commands issued, but also relevant CONVDATA field settings. The order
in which these fields are shown provides a sensible sequence of checks for an
application.
Figure 24. Checking the outcome of a GDS SEND INVITE WAIT command
A number at an intersection indicates the next state. Other symbols represent other
conditions, as follows:
Symbol Meaning
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
GDS WAIT × Ab = 5 12 Ab Ab
GDS FREE × End Ab Ab End Ab Ab
Ab Ab Ab Ab Ab Ab Ab Immediately
Ab Ab Ab Ab Ab Ab Ab Immediately
= = = = = = = Immediately
= = = = = = = Immediately
GDS WAIT × Ab = 5 12 Ab Ab
GDS FREE × End Ab Ab End Ab Ab
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. You can issue the GDS EXTRACT PROCESS command from the back-end transaction transaction only.
34. 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.
35. GDS ISSUE SIGNAL sets the partner transaction’s CDBSIG flag.
36. The back-end transaction starts in RECEIVE state after the front-end transaction has issued GDS CONNECT PROCESS.
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” on page 159.
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
2 or 539 2 or 539 2 or 539 2 or 539 2 or 539 Ab 2 or 539 After rollback across UOW
Ab Ab Ab Ab Ab Ab Ab Immediately
Ab Ab Ab Ab Ab End Ab Immediately
39. The state of each conversation after rollback depends on several factors:
v The system you are communicating with. Some earlier versions of CICS handle rollback differently from CICS Transaction
Server for OS/390 Release 3.
v The conversation state at the beginning of the current distributed unit of work This state is the one adopted according to the
APPC architecture. CICS Transaction Server for OS/390 Release 3 follows the architecture.
A conversation may be in free state after rollback if the it has been terminated in one of these ways:
v Abnormally due to session failure or deallocate abend being received
v Because the partner transaction has issued a GDS SEND LAST WAIT or FREE command.
After a syncpoint or rollback, it is advisable to determine the conversation state before issuing any further commands against the
conversation.
40. 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.
The different APIs are compared in “Part 1. Concepts and design considerations” on
page 1.
Part 5 contains:
v “Chapter 9. LUTYPE6.1 conversation flow” on page 107.
This uses CICS-to-IMS communication as the basis for discussing LUTYPE6.1
DTP programming.
v “Chapter 10. State transitions in LUTYPE6.1 conversations” on page 117. This
discusses the state transitions that occur when transactions use LUTYPE6.1
conversations under the EXEC CICS API. State transitions are presented in the
form of a state table showing which commands can be issued while the
conversation is in any given state. The state table also shows how the
conversation state changes as a result of issuing a command.
Conversation initiation
The front-end transaction is responsible for acquiring a session, specifying the
conversation characteristics, and requesting the startup of the back-end transaction
in the partner system.
The RESP value should be checked to ensure that a session has been allocated. If
successful, the RESP value is DFHRESP(NORMAL), the conversation is in
allocated state (state 1) and the session identifier (convid) from EIBRSRCE must
be saved immediately. The convid must be used in subsequent commands for this
conversation.
If the front-end transaction is started by ATI in the local system, and is required to
hold a conversation with an LUTYPE6.1 session as its principal facility, the session
has already been allocated when the transaction starts. You can omit the SESSION
option from commands relating to the principal facility. If, however, you want to
name the session explicitly in these commands, you should obtain its name from
EIBTRMID.
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, you must give a name 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 name should also be specified.
Another possibility is to specify INVITE and WAIT on the SEND command. As the
state table shows, SEND INVITE WAIT switches the conversation to receive state
(state 5).
The transaction whose side of the conversation is in receive state cannot change
to send state, but can request a change of direction by using the ISSUE SIGNAL
command. This causes the SIGNAL condition to be raised in the partner transaction
the next time it issues a SEND, RECEIVE, or CONVERSE command. The
application is responsible for determining the purpose of the SIGNAL condition and
responding appropriately.
From the state table it can be seen that it is possible to end a conversation by
issuing the FREE command provided the conversation is in send state (state 2).
This will generate an implicit SEND LAST WAIT command before the FREE is
executed and therefore not recommended.
Testing for request failure is the same as for other EXEC CICS commands in that
conditions are raised and may be handled using HANDLE CONDITION or RESP.
EIBRCODE will also contain an error code.
If the request has not failed, it is then possible to test for indicators received on the
conversation. These are returned to the application in the EIB. The following EIB
fields are relevant to all DTP commands. (See the CICS Application Programming
Reference manual for programming information on the contents and format of EIB
fields.)
EIBFREE
when set to X'FF' indicates that the partner transaction has ended the
conversation. It should be tested in conjunction with EIBSYNC to determine
exactly how to end the conversation.
In addition, there is a group of EIB fields that are relevant only to the RECEIVE and
CONVERSE commands. These are:
EIBCOMPL
when set to X'FF' indicates that all the data sent at one time has been received.
This field is used in conjunction with the RECEIVE NOTRUNCATE command.
EIBRECV
when set to X'FF' indicates the partner transaction did not use the INVITE
option on its last SEND command.
EIBATT
when set to X'FF' indicates that the data received contained an attach header.
The attach header is not passed to the application; however, EIBATT indicates
that an EXTRACT ATTACH command is appropriate.
EIBFMH
when set to X'FF' indicates that the data passed to the application contains a
concentrated FMH. This happens only when the partner CICS transaction builds
an FMH in the data and the FMH option on the SEND command is specified.
The front-end transaction is responsible for acquiring a session to the remote IMS™
system and initiating the partner transaction.
Thereafter, the two transactions become equals. However, the front-end transaction
is usually designed as the client, or driving, transaction.
Session allocation
You acquire an LUTYPE6.1 session to a remote IMS system by means of the
ALLOCATE command, which has the following format:
ALLOCATE {SYSID(name)|SESSION(name)}
[PROFILE(name)]
[NOQUEUE]
You can use the SESSION option to request the use of a specific session to the
remote IMS system, or you can use the SYSID option to name the partner system
and allow CICS to select an available session. The use of the SESSION option is
not normally recommended, because it can result in an application program queuing
on a specific session when others are available. In most cases, therefore, you use
the SYSID option to name the system with which the session is required.
If CICS cannot find the named system, or all sessions to that system are out of
service, it raises the SYSIDERR condition. If CICS cannot find the named session,
or that session is out of service, it raises the SESSIONERR condition.
The PROFILE option allows you to select a specified communication profile for an
LUTYPE6.1 session. The profile, which is set up during resource definition, contains
a set of terminal control processing options that are to be used for the session.
If you omit the PROFILE option, CICS uses the default profile DFHCICSA. This
profile specifies INBFMH(ALL), which means that incoming function management
headers are passed to your program and cause the INBFMH condition to be raised.
The NOQUEUE option allows you to specify explicitly that you do not want your
request for a session to be queued if a session is not available immediately. A
session is “not immediately available” in any of the following situations:
v All the sessions to the specified system are in use.
v The only available sessions are not bound (in which case CICS would have to
bind a session).
v The only available sessions are contention losers (in which case CICS would
have to bid to begin a bracket).
A number at an intersection indicates the state number of the next state. Other
symbols represent other conditions, as follows:
Symbol Meaning
CONVERSE42 EIB flags and states as for RECEIVE but allowed in send state
SYNCPOINT46 × = = 5 12 Ab N/A
41. RECEIVE NOTRUNCATE returns a zero value in EIBCOMPL to indicate that the user buffer was too small to contain all the data
received from the partner transaction. Normally, you would continue to issue RECEIVE NOTRUNCATE commands until the last
section of data is passed to you, which is indicated by EIBCOMPL = X'FF'. If NOTRUNCATE is not specified, and the data area
specified by the RECEIVE command is too small to contain all the data received, CICS truncates the data and sets the
LENGERR condition.
42. Equivalent to:
SEND INVITE WAIT [FROM]
RECEIVE
44. Before a session is allocated, there is no conversation, and therefore no conversation state. The EXEC CICS ALLOCATE
command does not appear in the table. This is because each ALLOCATE gets a session to start a new conversation and does
not affect any conversation that is already in progress. After ALLOCATE is successful, the front-end transaction starts the new
conversation in allocated state.
You select the partner transaction program by issuing a SEND command or a CONVERSE command. You have the choice of
identifying the transaction program either in the first four bytes of the user data or in the attach function management header built
by the BUILD ATTACH command.
The back-end transaction starts in RECEIVE state.
45. ISSUE SIGNAL sets the partner’s EIBSIG flag.
46. The SYNCPOINT command does not relate to any particular conversation. It is propagated on all the conversations that are
currently active for the task, including APPC and MRO conversations. All these conversations must be in send state or pendfree
state.
47. The SAA equivalents for this syncpointing command (SRRCMIT and SRRBACK) are described in the SAA Common
Programming Interface Resource Recovery Reference manual.
A syncpoint agent is in receive state on its conversation with the syncpoint initiator
and becomes aware of the syncpoint request by testing EIBSYNC (CDBSYNC in
the APPC basic interface) after issuing a RECEIVE command. If it decides to
respond positively by issuing SYNCPOINT, it must be in an appropriate state on all
the conversations with its own agents, for which it has become syncpoint initiator. If
an agent transaction responds negatively to a syncpoint request by issuing
SYNCPOINT ROLLBACK, the initiator sees EIBRLDBK set (X'FF'), which must be
tested on return from the SYNCPOINT command. (This is also true for APPC basic
conversations.)
Your transaction design should ensure that all participating transactions are in the
correct conversation state before a SYNCPOINT command is issued.
When a syncpoint agent receives the syncpoint request, it is given the opportunity
to respond positively (to commit recoverable resources) with a SYNCPOINT
48. The SAA equivalents for this syncpointing command (SRRCMIT and SRRBACK) are described in the SAA Common
Programming Interface Resource Recovery Reference manual.
The rules for determining the state after SYNCPOINT ROLLBACK depend on the
CICS release of the partner system. If the partner system is a release earlier than
CICS/ESA 3.2.1, the rollback initiator completes backout processing in send state
(state 2), and the partner completes in receive state (state 5). If the partner system
is CICS/ESA 3.2.1 or later, the conversation state of each partner is restored to the
state at the beginning of the distributed unit of work.
To avoid potential state problems, you can check the conversation state by using
the STATE option on the command following SYNCPOINT ROLLBACK. However, to
avoid the possibility of an abend, you are recommended to follow each
SYNCPOINT ROLLBACK command with an EXTRACT ATTRIBUTES STATE
command instead.
The conversation state does not always reflect the requirement to back out.
However, CICS is aware of this requirement and converts the next SYNCPOINT
request to a SYNCPOINT ROLLBACK request. If no SYNCPOINT or SYNCPOINT
ROLLBACK request is issued before the end of the task, the task is abended
(ASPN), and all recoverable resources are backed out.
Transaction A Transaction B
┌──────────────────────┐ ┌──────────────────────┐
│ ... │ │ ... │
│ (state: send) │ │ │
│ SEND CONVID(AB) │ │ │
│ (state: send) │ │ (state: receive) │
│ SYNCPOINT ├─────────────Ê RECEIVE CONVID(AB) │
│ (state: send) Í──────┐ │ (state: syncreceive │
│ │ │ │ +EIBSYNC, EIBRECV) │
│ │ └──────┤ SYNCPOINT │
│ │ │ (state: receive) │
└──────────────────────┘ └──────────────────────┘
Transaction A Transaction B
┌──────────────────────┐ ┌──────────────────────┐
│ ... │ │ ... │
│ (state: send) │ │ │
│ SEND INVITE │ │ │
│ CONVID(AB) │ │ │
│ (state: pendreceive) │ │ (state: receive) │
│ SYNCPOINT ├─────────────Ê RECEIVE CONVID(AB) │
│ (state: receive) Í──────┐ │ (state: syncsend │
│ │ │ │ +EIBSYNC) │
│ │ └──────┤ SYNCPOINT │
│ │ │ (state: send) │
└──────────────────────┘ └──────────────────────┘
Transaction A Transaction B
┌──────────────────────┐ ┌──────────────────────┐
│ ... │ │ ... │
│ (state: send) │ │ │
│ SEND LAST CONVID(AB) │ │ │
│ (state: pendfree) │ │ (state: receive) │
│ SYNCPOINT ├─────────────Ê RECEIVE CONVID(AB) │
│ (state: free) Í──────┐ │ (state: syncfree │
│ │ │ │ +EIBSYNC, EIBFREE) │
│ │ └──────┤ SYNCPOINT │
│ │ │ (state: free) │
└──────────────────────┘ └──────────────────────┘
Transaction A Transaction B
┌──────────────────────┐ ┌──────────────────────┐
│ ... │ │ ... │
│ (state: send) │ │ │
│ ISSUE PREPARE │ │ (state: receive) │
│ CONVID(AB) ├─────────────Ê RECEIVE CONVID(AB) │
│ Í──────────┐ │ (state: syncreceive │
│ (state: syncsend) │ │ │ +EIBSYNC, EIBRECV) │
│ SYNCPOINT ├───────┐ └──┤ SYNCPOINT │
│ (state: send) Í────┐ └─────Ê │
│ │ └────────┤ (state: receive) │
└──────────────────────┘ └──────────────────────┘
Transaction A Transaction B
┌──────────────────────┐ ┌──────────────────────┐
│ ... │ │ ... │
│ (state: send) │ │ (state: receive) │
│ SYNCPOINT ROLLBACK ├─────────────Ê RECEIVE CONVID(AB) │
│ Í──────┐ │ (state: rollback │
│ (state: same as when │ │ │ +EIBERR, EIBSYNRB) │
│ unit of work began) │ │ │ │
│ │ └──────┤ SYNCPOINT ROLLBACK │
│ │ │ (state: same as when │
│ │ │ unit of work began) │
└──────────────────────┘ └──────────────────────┘
Transaction A Transaction B
┌──────────────────────┐ ┌──────────────────────┐
│ ... │ │ ... │
│ (state: send) │ │ (state: receive) │
│ ISSUE PREPARE │ ┌──────Ê RECEIVE CONVID(AB) │
│ CONVID(AB) ├──────┘ │ (state: syncreceive │
│ (state: rollback Í──────────┐ │ +EIBSYNC, EIBRECV) │
│ +EIBERR, EIBSYNRB) │ │ │ │
│ SYNCPOINT ROLLBACK ├───────┐ └──┤ SYNCPOINT ROLLBACK │
│ (state: same as when │ └─────Ê (state: same as when │
│ unit of work began) │ │ unit of work began) │
└──────────────────────┘ └──────────────────────┘
Note that if transaction A were running on a CICS release earlier than 3.2, the
results would be different. (See the Intercommunication Guide for the relevant
release.)
Transaction A Transaction B
┌──────────────────────┐ ┌──────────────────────┐
│ ... │ │ ... │
│ (state: send) │ │ (state: receive) │
│ ISSUE PREPARE ├─────────────Ê RECEIVE CONVID(AB) │
│ CONVID(AB) │ │ (state: syncreceive │
│ │ │ +EIBSYNC, EIBRECV) │
│ │ │ ISSUE ERROR │
│ │ │ CONVID (AB) │
│ │ │ (state: send) │
│ (state: receive Í─────────────┤ WAIT CONVID(AB) │
│ +EIBERR) │ │ (state: send) │
│ │ │ │
└──────────────────────┘ └──────────────────────┘
Transaction A Transaction B
┌──────────────────────┐ ┌──────────────────────┐
│ ... │ │ ... │
│ (state: send) │ │ (state: receive) │
│ ISSUE PREPARE │ ┌──────Ê RECEIVE CONVID(AB) │
│ CONVID(AB) ├──────┘ │ (state: syncreceive │
│ (state: free Í──────┐ │ +EIBSYNC, EIBRECV) │
│ + EIBERR, EIBFREE) │ └──────┤ ISSUE ABEND │
│ FREE CONVID(AB) │ │ CONVID(AB) │
│ │ │ (state: free) │
│ SYNCPOINT ROLLBACK │ │ FREE CONVID(AB) │
│ │ │ │
│ │ │ SYNCPOINT ROLLBACK │
│ │ │ │
└──────────────────────┘ └──────────────────────┘
Transaction A Transaction B
┌──────────────────────┐ ┌──────────────────────┐
│ ... │ │ ... │
│ (state: send) │ │ (state: receive) │
│ SYNCPOINT ├─────────────Ê RECEIVE CONVID(AB) │
│ │ │ (state: syncreceive │
│ │ │ +EIBSYNC, EIBRECV) │
│ Í─────────────┤ SYNCPOINT │
│ │ │ (state: receive) │
│ (abend: ASP3) Í────│││││ │ │
│ │ │││││────Ê RECEIVE CONVID(AB) │
│ │ │││││ │ (state: free │
│ │ │││││ │ +EIBERR, EIBFREE) │
│ │ │││││ │ FREE CONVID(AB) │
│ │ │││││ │ │
│ │ │││││ │ SYNCPOINT ROLLBACK │
└──────────────────────┘ session └──────────────────────┘
failure
Figure 38. Session failure during SYNCPOINT in response to ISSUE PREPARE on an APPC
mapped conversation
Transaction A Transaction B
┌──────────────────────┐ ┌──────────────────────┐
│ ... │ │ ... │
│ (state: send) │ │ (state: receive) │
│ SYNCPOINT ROLLBACK ├─────────────Ê RECEIVE CONVID(AB) │
│ │ │ (state: rollback │
│ │ │ +EIBERR, EIBSYNRB) │
│ │ │││││Í───┤ SYNCPOINT ROLLBACK │
│ (state: free) Í────│││││ │ │
│ │ │││││────Ê (state: free) │
│ │ │││││ │ │
│ │ │││││ │ │
└──────────────────────┘ session └──────────────────────┘
failure
Transaction A Transaction B
(initiator for (agent of A; Transaction C
B & D) initiator for C & E) (agent of B)
┌─────────────────┐ ┌────────────────────┐ ┌────────────────────┐
│ (states: │ │ │ │ (state: receive) │
│ on AB - send │ │ (states: │ ┌────Ê RECEIVE │
│ on AD - send) │ │ on AB - receive │ │ │ (state: │
│ SYNCPOINT ├────┐ │ on BC - send │ │ │ syncreceive) │
│ │ │ │ on BE - send) │ │ ┌─┤ SYNCPOINT │
│ (states: │ ├─Ê RECEIVE │ │ │ │ (state: receive) │
│ on AB - send Í───┐│ │ (states: │ │ │ └────────────────────┘
│ on AD - send) Í─┐ ││ │ on AB - syncreceive│ │ │
│ │ │ ││ │ on BC - send │ │ │ Transaction E
│ │ │ ││ │ on BE - send) │ │ │ (agent of B)
│ │ │ └┼─┤ SYNCPOINT ├─┤ │ ┌────────────────────┐
│ │ │ │ │ (states: │ │ │ │ (state: receive │
│ │ │ │ │ on AB - receive │ └──┼─Ê RECEIVE │
│ │ │ │ │ on BC - send Í────┘ │ (state syncreceive)│
│ │ │ │ │ on BE - send) Í──────┤ SYNCPOINT │
│ │ │ │ │ │ │ (state: receive) │
│ │ │ │ └────────────────────┘ └────────────────────┘
│ │ │ │
│ │ │ │ Transaction D
│ │ │ │ (last agent of A;
│ │ │ │ initiator for F)
│ │ │ │ ┌────────────────────┐
│ │ │ │ │ (states: │
│ │ │ │ │ on AD - receive │ Transaction F
│ │ │ │ │ on DF - send) │ (only agent of D)
│ │ │ └─Ê RECEIVE │ ┌────────────────────┐
│ │ │ │ (states: │ │ │
│ │ │ │ on AD - syncreceive│ │ (state: receive) │
│ │ │ │ on DF - send) │ ┌───Ê RECEIVE │
│ │ └────┤ SYNCPOINT ├──┘ │ (state: │
│ │ │ (states: │ │ syncreceive) │
│ │ │ on AD - receive │ ┌──┤ SYNCPOINT │
│ │ │ on DF - send) Í───┘ │ (state: receive) │
└─────────────────┘ └────────────────────┘ └────────────────────┘
Figure 40. A distributed syncpoint with all partners running on CICS Transaction Server for
OS/390 Release 3
The previous discussion of the SYNCPOINT command assumed that all the agent
transactions were ready to take a syncpoint by issuing SYNCPOINT when their
conversation entered syncreceive state (state 9).
If, however, an agent has detected an error, it can reject the syncpoint request with
one of the following commands:
v SYNCPOINT ROLLBACK (preferred response)
v ISSUE ERROR
v ISSUE ABEND
As in Figure 40 on page 133, transaction A (while in send state, state 2) issues the
SYNCPOINT command, and CICS initiates a chain of events. Here, however,
transaction E has detected an error that makes it unable to commit, and it issues
SYNCPOINT ROLLBACK when it detects that the conversation on its principal
facility is in syncreceive state (state 9, EIBSYNC is also set). This causes any
changes that transaction E has made to be backed out, and initiates a distributed
rollback.
This situation could occur for situations other than DTP and is discussed in the
“Recovery and restart” section of the CICS Intercommunication Guide.
System 1 System 2
┌──────────────────────┐ ┌──────────────────────┐
│ ... │ commit │ ... │
│ SYNCPOINT ├─────────────Ê RECEIVE │
│ │ │ (EIBSYNC set) │
│ │ committed │ │
│ Í─────────────┤ SYNCPOINT │
│ │ │ │
│ │ │ │
└──────────────────────┘ └──────────────────────┘
When the syncpoint agent has a conversation with a third transaction, Figure 43
shows the flows that occur. Here is what happens:
1. The syncpoint initiator sends a “commit” request to its agent.
2. The agent becomes the initiator on the conversation to its agent, and sends a
“commit” request.
3. The second agent commits first and responds with “committed”.
4. The first agent commits and sends “committed” to the initiator.
5. The initiator commits.
System 1 System 2
┌───────────┐ 1) prepare ┌───────────────┐
│ SYNCPOINT ├──────────────Ê RECEIVE │
│ │ │ (EIBSYNC set) │
│ │ 2) commit │ │
│ Í──────────────┤ SYNCPOINT │
│ │ │ │
│ │ 5) committed │ │
│ ├──────────────Ê │
│ │ 6) forget │ │
│ Í──────────────┤ │
│ │ └───────────────┘
│ │
│ │ System 3
│ │ 3) commit ┌───────────────┐
│ ├──────────────Ê RECEIVE │
│ │ │ (EIBSYNC set) │
│ │ 4) committed │ │
│ Í──────────────┤ SYNCPOINT │
│ │ │ │
└───────────┘ └───────────────┘
Figure 44. Syncpoint flows in concurrent conversations with one initiator. The initiator uses
only SYNCPOINT.
If the syncpoint initiator decides to prepare the conversation with system 2 explicitly
before issuing a syncpoint, the flows involved are shown in Figure 45 on page 138.
You will notice that, although the application program in system 1 issues extra
commands, the flows across the links are exactly the same as those in the previous
example. Using the ISSUE PREPARE command gives the application the
opportunity to “change its mind” and rollback, depending on the response to ISSUE
PREPARE.
Figure 45. Syncpoint flows in concurrent conversations with one initiator. The initiator uses
ISSUE PREPARE before SYNCPOINT.
For further information on the flows in a distributed process, see the SNA
Reference: Peer Protocols book.
For information on which APPC option sets are supported by CICS and which are
not, or on how CICS implements the APPC control operator verbs, see the CICS
Intercommunication Guide.
┌────────────────────────────────────────────────────────────────────────┐
│ ALLOCATE EXEC CICS GDS ALLOCATE │
│ + EXEC CICS GDS CONNECT PROCESS │
├───────────────────────────────────────┬────────────────────────────────┤
│ │ │
│ LU_NAME(vble) │ SYSID on ALLOCATE │
│ MODE_NAME(vble) │ MODENAME on ALLOCATE │
│ MODE_NAME('SNASVCMG') │ MODENAME on ALLOCATE │
│ TPN(vble) │ PROCNAME on CONNECT PROCESS │
│ │ (with PROCLENGTH) │
│ TYPE(BASIC_CONVERSATION) │ Supported by GDS │
│ TYPE(MAPPED_CONVERSATION) │ Not supported │
│ RETURN_CONTROL(WHEN_SESSION_ALLOCATED)│ Default on ALLOCATE │
│ RETURN_CONTROL │ │
│ (WHEN_CONWINNER_ALLOCATED)│ Not supported │
│ RETURN_CONTROL │ │
│ (WHEN_CONVERSATION_GROUP_ALLOCATED)│ Supported │
│ RETURN_CONTROL(IMMEDIATE) │ NOQUEUE/NOSUSPEND on ALLOCATE │
│ SYNC_LEVEL │ SYNCLEVEL on CONNECT PROCESS │
│ │ 0 ─ None │
│ │ 1 ─ Confirm │
│ │ 2 ─ Syncpoint │
│ SECURITY(NONE) │ Not supported │
│ SECURITY(SAME) │ Default on ALLOCATE │
│ SECURITY(PGM(USED_ID(vble) │ Not supported │
│ (PASSWORD(vble))) │ Not supported │
│ PIP(NO) │ Supported by PIPLENGTH(0) │
│ PIP(YES(vble1,vble2 ... vblen)) │ Supported by PIPLIST+PIPLENGTH │
│ RESOURCE │ Returned by GDS ASSIGN │
│ RETURN_CODE │ Supported │
│ │ │
└───────────────────────────────────────┴────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ BACKOUT EXEC CICS SYNCPOINT ROLLBACK │
├───────────────────────────────────────┬────────────────────────────────┤
│ │ │
│ RETURN_CODE │ Supported │
│ │ │
└───────────────────────────────────────┴────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ CONFIRM EXEC CICS GDS CONFIRM │
├───────────────────────────────────────┬────────────────────────────────┤
│ │ │
│ RESOURCE │ CONVID │
│ RETURN_CODE │ Supported │
│ REQUEST_TO_SEND_RECEIVED │ Returned in CDBSIG │
│ │ │
└───────────────────────────────────────┴────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ DEALLOCATE EXEC CICS GDS SEND LAST │
│ + EXEC CICS SYNCPOINT │
│ + EXEC CICS GDS FREE │
├─────────────────────────────────────┬──────────────────────────────────┤
│ │ │
│ TYPE(SYNC_LEVEL) None │ EXEC CICS GDS SEND LAST WAIT │
│ │+ EXEC CICS GDS FREE │
│ │ │
│ TYPE(SYNC_LEVEL) Confirm │ EXEC CICS GDS SEND LAST CONFIRM │
│ │+ EXEC CICS GDS FREE │
│ │ │
│ TYPE(SYNC_LEVEL) Syncpt │ EXEC CICS GDS SEND LAST │
│ │+ EXEC CICS SYNCPOINT │
│ │+ EXEC CICS GDS FREE │
│ │ │
│ TYPE(FLUSH) │ EXEC CICS GDS SEND LAST WAIT │
│ │+ EXEC CICS GDS FREE │
│ │ │
│ TYPE(CONFIRM) │ EXEC CICS GDS SEND LAST CONFIRM │
│ │+ EXEC CICS GDS FREE │
│ │ │
│ TYPE(ABEND_PROG) │ │
│ Depends on setting of CDBFREE │ │
│ by previous command: │ │
│ │ │
│ CDBFREE = X'00 │ EXEC CICS GDS ISSUE ABEND │
│ │+ EXEC CICS GDS FREE │
│ │ │
│ CDBFREE = X'FF │ EXEC CICS GDS FREE │
│ │ │
│ TYPE(ABEND_SVC) │ Not supported at API │ Option │
│ TYPE(ABEND_TIMER) │ Not supported at API │ Set 11 │
│ │ │
│ TYPE(LOCAL) │ EXEC CICS GDS FREE │
│ │ │
│ LOG_DATA(vble) │ Not available at API. CICS │
│ │ inserts the appropriate values. │
│ │ │
│ RETURN_CODE │ Supported │
│ │ │
└─────────────────────────────────────┴──────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ FLUSH EXEC CICS GDS WAIT │
└────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ GET_TYPE EXEC CICS GDS ASSIGN │
│ (+ return code test) │
├────────────────────────────────────┬───────────────────────────────────┤
│ │ │
│ RESOURCE │ PRINCONVID │
│ TYPE(vble) │ RETCODE │
│ │ clear = GDS (BASIC) │
│ │ 03 04 = wrong conversation │
│ │ level │
└────────────────────────────────────┴───────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ POST_ON_RECEIPT Not supported │
└────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ PREPARE_FOR_SYNCPT EXEC CICS GDS ISSUE PREPARE │
├────────────────────────────────────┬───────────────────────────────────┤
│ │ │
│ RESOURCE │ CONVID │
│ RETURN_CODE │ Supported │
│ │ │
└────────────────────────────────────┴───────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ SEND_DATA EXEC CICS GDS SEND │
├───────────────────────────────────────┬────────────────────────────────┤
│ │ │
│ RESOURCE │ CONVID field │
│ DATA │ FROM option │
│ LENGTH │ FLENGTH option │
│ RETURN_CODE │ Supported │
│ REQUEST_TO_SEND_RECEIVED │ Returned in CDBSIG │
│ ENCRYPT │ Not supported │
│ │ │
└───────────────────────────────────────┴────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ SEND_ERROR EXEC CICS GDS ISSUE ERROR │
├───────────────────────────────────────┬────────────────────────────────┤
│ │ │
│ RESOURCE │ CONVID field │
│ TYPE(PROG) │ Default │
│ TYPE(SVC) │ Not supported │
│ LOG_DATA │ Not supported │
│ RETURN_CODE │ Supported │
│ REQUEST_TO_SEND_RECEIVED │ Returned in CDBSIG │
│ │ │
└───────────────────────────────────────┴────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ SYNCPT EXEC CICS SYNCPOINT │
├───────────────────────────────────────┬────────────────────────────────┤
│ │ │
│ RETURN_CODE │ Zero ─ Control returned to │
│ │ program. │
│ │ Non-zero ─ CICS takes action; │
│ │ to backout the UOW (and │
│ │ abend the task or set │
│ │ EIBRLDBK). │
├───────────────────────────────────────┴────────────────────────────────┤
│ Note: │
│ │
│ EXEC CICS SYNCPOINT is not a GDS command. │
│ │
│ For certain specialized applications, the PREPARE flow (the first flow │
│ in syncpoint exchanges) may be sent for a particular conversation by │
│ using the command: │
│ │
│ EXEC CICS GDS ISSUE PREPARE │
│ │
│ This enables any outstanding messages in the network (for example, SEND│
│ ERROR) to be received before proceeding, or deciding not to proceed, │
│ with the full syncpoint. │
│ │
└────────────────────────────────────────────────────────────────────────┘
┌───────────────────────────────────────┬────────────────────────────────┐
│ WAIT │ Not supported │
└───────────────────────────────────────┴────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ MC_ALLOCATE EXEC CICS ALLOCATE │
│ + EXEC CICS CONNECT PROCESS │
├───────────────────────────────────────┬────────────────────────────────┤
│ │ │
│ LU_NAME(vble) │ SYSID on ALLOCATE │
│ MODE_NAME(vble) │ MODENAME on ALLOCATE │
│ TPN(vble) │ PROCNAME on CONNECT PROCESS │
│ │ (with PROCLENGTH) │
│ RETURN_CONTROL │ │
│ (WHEN_SESSION_ALLOCATED) │ Default on ALLOCATE │
│ RETURN_CONTROL │ │
│ (WHEN_CONWINNER_ALLOCATED) │ Supported │
│ RETURN_CONTROL(WHEN_CONVERSATION │ │
│ _GROUP_ALLOCATED) │ Not supported │
│ RETURN_CONTROL(IMMEDIATE) │ NOQUEUE/NOSUSPEND on ALLOCATE │
│ SYNC_LEVEL │ SYNC_LEVEL on CONNECT PROCESS │
│ │ 0 ─ None │
│ │ 1 ─ Confirm │
│ │ 2 ─ Syncpoint │
│ CONVERSATION_GROUP_ID │ Not supported │
│ SECURITY(NONE) │ Not supported │
│ SECURITY(SAME) │ Default on ALLOCATE │
│ SECURITY(PGM(USED_ID(vble) │ Not supported │
│ (PASSWORD(vble))) │ Not supported │
│ PIP(NO) │ Supported by PIPLENGTH(0) │
│ PIP(YES(vble1,vble2 ... vblen)) │ Supported by PIPLIST+PIPLENGTH │
│ RESOURCE │ Returned in CONVID field │
│ RETURN_CODE │ Supported │
│ │ │
└───────────────────────────────────────┴────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ BACKOUT EXEC CICS SYNCPOINT ROLLBACK │
├───────────────────────────────────────┬────────────────────────────────┤
│ │ │
│ RETURN_CODE │ Supported │
│ │ │
└───────────────────────────────────────┴────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ MC_CONFIRM EXEC CICS SEND CONFIRM │
├───────────────────────────────────────┬────────────────────────────────┤
│ │ │
│ RESOURCE │ CONVID │
│ RETURN_CODE │ Supported │
│ REQUEST_TO_SEND_RECEIVED │ Returned in EIBSIG │
│ │ │
└───────────────────────────────────────┴────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ MC_DEALLOCATE EXEC CICS SEND LAST │
│ + EXEC CICS SYNCPOINT │
│ + EXEC CICS FREE │
├────────────────────────────────────┬───────────────────────────────────┤
│ │ │
│ RESOURCE │ CONVID │
│ │ │
│ TYPE(SYNC_LEVEL) None │ EXEC CICS SEND LAST WAIT │
│ │ + EXEC CICS FREE │
│ │ │
│ TYPE(SYNC_LEVEL) Confirm │ EXEC CICS SEND LAST CONFIRM │
│ │ + EXEC CICS FREE │
│ │ │
│ TYPE(SYNC_LEVEL) Syncpt │ EXEC CICS SEND LAST │
│ │ + EXEC CICS SYNCPOINT │
│ │ + EXEC CICS FREE │
│ │ │
│ TYPE(FLUSH) │ EXEC CICS SEND LAST WAIT │
│ │ + EXEC CICS FREE │
│ │ │
│ TYPE(CONFIRM) │ EXEC CICS SEND LAST CONFIRM │
│ │ + EXEC CICS FREE │
│ │ │
│ TYPE(ABEND_PROG) │ │
│ Depends on setting of EIBFREE │ │
│ command: │ │
│ │ │
│ EIBFREE = X'00' │ EXEC CICS ISSUE ABEND │
│ │ + EXEC CICS FREE │
│ │ │
│ EIBFREE = X'FF' │ EXEC CICS FREE │
│ │ │
│ TYPE(LOCAL) │ EXEC CICS FREE │
│ │ │
│ RETURN_CODE │ Supported │
│ │ │
└────────────────────────────────────┴───────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ MC_FLUSH EXEC CICS WAIT │
│ or EXEC CICS SEND WAIT │
├────────────────────────────────────┬───────────────────────────────────┤
│ │ │
│ RESOURCE │ CONVID │
│ RETURN_CODE │ Supported │
│ │ │
└────────────────────────────────────┴───────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ GET_TYPE (Examine EIBRSRCE) │
├────────────────────────────────────┬───────────────────────────────────┤
│ │ │
│ RESOURCE │ EIBRSRCE │
│ TYPE(vble) │ EIBRSRCE set ─ mapped │
│ │ EIBRSRCE not set ─ not mapped │
└────────────────────────────────────┴───────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ MC_POST_ON_RECEIPT Not supported │
└────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────┬───────────────────────────────────┐
│ MC_PREPARE_FOR_SYNCPT │ ISSUE PREPARE │
├────────────────────────────────────┼───────────────────────────────────┤
│ RESOURCE │ CONVID │
│ RETURN_CODE │ Supported │
│ │ │
└────────────────────────────────────┴───────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ MC_SEND_DATA EXEC CICS SEND │
├────────────────────────────────────┬───────────────────────────────────┤
│ │ │
│ RESOURCE │ CONVID field │
│ DATA │ FROM option │
│ LENGTH │ LENGTH option │
│ FMH_DATA(NO) │ Default │
│ FMH_DATA(YES) │ See note │
│ MAP_NAME(NO) │ Not supported │
│ MAP_NAME(YES) │ Not supported │
│ ENCRYPT(NO) │ Not supported │
│ ENCRYPT(YES) │ Not supported │
│ RETURN_CODE │ Supported │
│ REQUEST_TO_SEND_RECEIVED │ Returned in EIBSIG │
├────────────────────────────────────┴───────────────────────────────────┤
│ Note: │
│ FMH_DATA(YES) permits the sending of LU6.1 FMHs within an APPC │
│ conversation (for example, when running a CICS program which was │
│ originally written for use on LU6.1). An LU6.1 FMH may be built │
│ either by using the EXEC CICS BUILD ATTACH command, prior to issuing │
│ the EXEC CICS SEND command, or by building the FMH within the program,│
│ putting it the output area, and specifying the FMH option on the SEND │
│ command. Either of these two actions is equivalent to specifying │
│ FMH_DATA(YES). │
└────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ MC_SEND_ERROR EXEC CICS ISSUE ERROR │
├────────────────────────────────────┬───────────────────────────────────┤
│ │ │
│ RESOURCE │ CONVID field │
│ RETURN_CODE │ Supported │
│ REQUEST_TO_SEND_RECEIVED │ Returned in EIBSIG │
│ │ │
└────────────────────────────────────┴───────────────────────────────────┘
┌────────────────────────────────────┬───────────────────────────────────┐
│ MC_TEST │ Check EIB flags │
├────────────────────────────────────┼───────────────────────────────────┤
│ RESOURCE │ EIBRSRCE │
│ TEST(POSTED) │ Check EIB flags │
│ TEST(REQUEST_TO_SEND_RECEIVED) │ EIBSIG │
│ RETURN_CODE │ Not supported │
│ │ │
└────────────────────────────────────┴───────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────┐
│ WAIT Not supported │
└────────────────────────────────────────────────────────────────────────┘
┌───────────────────────────────────┬────────────────────────────────────┐
│ APPC RETURN_CODE │ CICS return codes │
├───────────────────────────────────┼────────────────────────────────────┤
│ OK │ EIBERR zero + INVREQ not raised │
├───────────────────────────────────┼────────────────────────────────────┤
│ ALLOCATION_ERROR │ │
│ │ │
│ Local allocation failures: │ CICS is unable to allocate a │
│ │ session for an ALLOCATE command. │
│ │ │
│ ALLOCATION_FAILURE_NO_RETRY │ SYSIDERR raised │
│ │ The second and subsequent bytes │
│ │ of EIBRCODE give further │
│ │ information. │
│ ALLOCATION_FAILURE_RETRY │ SYSBUSY raised if there is a │
│ │ HANDLE for it. Otherwise, │
│ │ CICS queues the request until │
│ │ a session is available. │
│ │ See also the UNSUCCESSFUL return │
│ │ code, which relates to the │
│ │ NOQUEUE option on the CICS │
│ │ ALLOCATE command. │
│ Remote allocation failures: │ These will be returned to the │
│ │ program after the CONNECT PROCESS │
│ │ command has been issued, and the │
│ │ partner system has been unable to │
│ │ start the requested task. They │
│ │ may be returned on any subsequent │
│ │ command that relates to the │
│ │ session in use. │
│ CONVERSATION_TYPE_MISMATCH │ TERMERR (EIBERRCD = 10086034) │
│ PIP_NOT_ALLOWED │ TERMERR (EIBERRCD = 10086031) │
│ PIP_NOT_SPECIFIED_CORRECTLY │ TERMERR (EIBERRCD = 10086032) │
│ SECURITY_NOT_VALID │ TERMERR (EIBERRCD = 080F6051) │
│ SYNC_LEVEL_NOT_SUPPORTED_BY_PGM│ TERMERR (EIBERRCD = 10086041) │
│ SYNC_LEVEL_NOT_SUPPORTED_BY_LU │ INVREQ (EIBRCODE = E000000C) │
│ │ Note: CICS remembers SYNC_LEVEL │
│ │ negotiated at Bind time and does │
│ │ not permit a request to be sent │
│ │ for a Sync Level not supported │
│ │ by the remote LU. │
│ TPN_NOT_RECOGNIZED │ TERMERR (EIBERRCD = 10086021) │
│ TRANS_PGM_NOT_AVAIL_NO_RETRY │ TERMERR (EIBERRCD = 084C0000) │
│ TRANS_PGM_NOT_AVAIL_RETRY │ TERMERR (EIBERRCD = 084B6031) │
├───────────────────────────────────┼────────────────────────────────────┤
│ BACKED_OUT │ EIBSYNRB (EIBERRCD = 08240000) │
├───────────────────────────────────┼────────────────────────────────────┤
│ DEALLOCATE_ABEND │ The transaction is abended with │
│ │ code AZCH (EIBERRCD = 08640000) │
├───────────────────────────────────┼────────────────────────────────────┤
│ DEALLOCATE_NORMAL │ EIBFREE + ¬EIBERR │
├───────────────────────────────────┼────────────────────────────────────┤
│ FMH_DATA_NOT_SUPPORTED │ TERMERR (EIBERRCD = 08890100) │
├───────────────────────────────────┼────────────────────────────────────┤
│ MAP_EXECUTION_FAILURE │ Not applicable. Map requests │
│ MAP_NOT_FOUND │ are not sent because the option │
│ MAPPING_NOT_SUPPORTED │ is not supported. │
└───────────────────────────────────┴────────────────────────────────────┘
When a session is being allocated, the back-end CICS system checks the incoming
bind request for valid combinations of CNOS (change number of sessions) and
parallel-sessions indicators. If CICS finds that parallel-sessions is specified but
CNOS is not, it sends a negative response to the bind request.
CICS allows a sync level-2 conversation to be terminated using the SEND LAST
WAIT or SEND LAST CONFIRM commands. However, doing this is a deviation
from the APPC architecture and should be avoided. Figure 46 on page 160
illustrates the problems that can be caused by not syncpointing a sync level-2
conversation.
Because transaction AAAA ends the conversation using the SEND LAST WAIT
command, transaction BBBB cannot inform it that an error has occurred. The
ISSUE ABEND command causes the backout-required condition to be raised in
transaction BBBB; so a SYNCPOINT ROLLBACK is needed. Transaction AAAA
commits changes to its resources and data integrity is lost.
The resulting state errors may also lead to the session being unbound.
Migration mode
In migration mode, the front-end and back-end transactions use LUTYPE6.1
commands just as if the session was an LUTYPE6.1 session. CICS takes data from
the transaction in the normal way, and formats it as an APPC mapped data stream
for transmission over the link. At the receiving side, CICS analyses the APPC
mapped data stream and presents the LUTYPE6.1 data and function management
headers to the receiving transaction.
In general, you will not have to modify existing CICS-to-CICS ISC applications to
enable them to run in migration mode on APPC links. A notable exception is the use
of the ALLOCATE SESSION command. If your installation previously had
individually defined ISC sessions, and your application used the ALLOCATE
SESSION command to acquire a specific session, you must change this command
to ALLOCATE SYSID.
The ISSUE SIGNAL command is valid for both LU types, but the WAIT SIGNAL
command is available only for LUTYPE6.1.
Table 47 on page 164 compares the commands that you can use for:
v LUTYPE6.1 applications on LUTYPE6.1 links
v LUTYPE6.1 applications on APPC links (migration mode)
v APPC applications on APPC links.
As Table 47 on page 164 shows, migration mode allows you to start adding new
function to an application (for example, using ISSUE ERROR or ISSUE ABEND)
without converting it entirely to APPC. You can also implement different sync levels
by modifying the application to use the CONNECT PROCESS command.
Applications not modified to use CONNECT PROCESS will use sync level 2. The
migration of an application towards the “pure” APPC level can thus be made
stepwise.
To aid migration, the SESSION and CONVID options can be used interchangeably.
The commands you can issue, coupled with the EIB 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 EIB flag) and a
column (state) represents the state transition, if any, that occurs when a particular
command returning a particular EIB flag is issued in a particular state. A number at
an intersection indicates the state number of the next state. Other symbols
represent other conditions, as follows:
Symbol Meaning
N/A Cannot occur.
× The EIB flag is any one that has not been covered in earlier rows, or it is
irrelevant (but see the note on EIBSIG if you want to use ISSUE SIGNAL).
Ab The command is not valid in this state. Issuing a command in a state in
which it is not valid usually causes an ATCV abend.
= Remains in current state.
End End of conversation.
BUILD ATTACH × = = = = = =
EXTRACT ATTACH × Ab62 Ab62 Ab62 Ab62 = Ab62
EXTRACT PROCESS50 × Ab = = = = =
EXTRACT ATTRIBUTES × = = = = = =
= = = = = = = Immediately
Ab62 Ab62 Ab62 Ab62 Ab62 Ab62 Ab62 Immediately
= = = = = = = Immediately
= = = = = = = Immediately
ISSUE CONFIRMATION × Ab Ab Ab Ab Ab 5
ISSUE ERROR EIBFREE Ab 12 12 Ab 12 12
ISSUE ERROR × Ab = 2 Ab 2 2
ISSUE ABEND × Ab 12 12 12 12 12
ISSUE SIGNAL57 × Ab = = Ab = =
WAIT × Ab = 5 12 Ab Ab
FREE × End End54 Ab End Ab Ab
49. EIBSIG 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 EIB flags. However, used for the
purpose for which it was intended, it usually occurs after a SEND command. Its priority in the order of testing depends on the role
you give it in the application.
50. You can issue the EXTRACT PROCESS command from the back-end transaction only.
51. RECEIVE NOTRUNCATE returns a zero value in EIBCOMPL to indicate that the user buffer was too small to contain all the data
received from the partner transaction. Normally, you would continue to issue RECEIVE NOTRUNCATE commands until the last
section of data is passed to you, which is indicated by EIBCOMPL = X'FF'. If NOTRUNCATE is not specified, and the data area
specified by the RECEIVE command is too small to contain all the data received, CICS truncates the data and sets the
LENGERR condition.
52. Equivalent to SEND INVITE WAIT followed by RECEIVE.
53. Equivalent to SEND INVITE WAIT [FROM] followed by RECEIVE.
54. Equivalent to SEND LAST WAIT followed by FREE.
55. Equivalent to WAIT followed by RECEIVE.
56. Before a session is allocated, there is no conversation, and therefore no conversation state. The EXEC CICS ALLOCATE
command does not appear in the tables. This is because each ALLOCATE gets a session to start a new conversation and does
not affect any conversation that is already in progress. After ALLOCATE is successful, the front-end transaction starts the new
conversation in allocated state.
57. ISSUE SIGNAL sets the partner’s EIBSIG flag.
58. The back-end transaction starts in receive state.
59. No data may be included with SEND CONFIRM.
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
Ab62 Ab62 Ab62 Ab62 Ab62 Ab62 Ab62 After response from partner
Ab62 Ab62 Ab62 Ab62 Ab62 Ab62 Ab62 After error detected
Ab62 Ab62 Ab62 Ab62 Ab62 Ab62 Ab62 After error detected
Ab62 Ab62 Ab62 Ab62 Ab62 Ab62 Ab62 After response from partner
2 or 561 2 or 561 2 or 561 2 or 561 2 or 561 = 2 or 561 After rollback across UOW
Ab Ab Ab Ab Ab Ab Ab Immediately
Ab Ab Ab Ab Ab End Ab Immediately
60. 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. For the SYNCPOINT command, all these
conversations must be in send state.
61. The state of each conversation after rollback depends on several factors:
v The system you are communicating with. Some earlier versions of CICS handle rollback differently from CICS Transaction
Server for OS/390 Release 3.
v The conversation state at the last syncpoint, or at the beginning of the conversation if there was no previous sync point. This
state is the one adopted according to the APPC architecture. CICS Transaction Server for OS/390 Release 3 follows the
architecture.
62. This results, not in an ATCV abend, but in an INVREQ return code.
63. This causes an ASP2 abend, not an ATCV.
64. Although ISSUE PREPARE can return with the conversation in either syncsend state, syncreceive state, or syncfree state, the
only commands allowed on that conversation following an ISSUE PREPARE are SYNCPOINT and SYNCPOINT ROLLBACK. All
other commands abend ATCV.
Figure 47. How the same command sequence operates differently in APPC mapped and
MRO conversations
The WAIT option can, of course, be added to the SEND command to cause
immediate transmission on APPC links; for example:
SEND CONVID(REM1)
FROM(data2)
LENGTH(251)
INVITE
WAIT
RECEIVE SESSION(REM1)
There are no significant differences between the MRO and APPC mapped
implementations of this command sequence. However, with MRO, a SEND
command with the WAIT option causes CICS to suspend the transaction until the
partner system has received the data.
A further implementation difference arises between APPC mapped and MRO for
command sequences that contain an implicit change of direction. For MRO, a
RECEIVE command must not be issued unless the conversation is in receive state
(state 5).
If the conversation is not to be involved in the syncpoint (for example, because the
partner transaction does not access any recoverable resources), the transaction
must issue a SEND LAST WAIT command, or a FREE command, to force the
transmission before using a command that causes a syncpoint.
If the conversation is not to be involved in the syncpoint (for example, because the
partner transaction does not access any recoverable resources) you must specify
the WAIT option explicitly on the SEND LAST command to force the LAST indicator
to be sent with the data. Alternatively, you could follow the SEND LAST command
by a FREE command.
Except for some commands that can cause transmissions “against the flow” (such
as ISSUE SIGNAL), the conversation flow and indicators set are dictated by the
transaction currently in send state (state 2).
The FMH5, also known as the attach FMH, is sent with BB and contains the
information required to initiate the back-end transaction.
The FMH7 is issued by the ISSUE ERROR, ISSUE ABEND, and SYNCPOINT
ROLLBACK commands. In addition, if the back-end system rejects the FMH5,
an FMH7 is sent to the front-end transaction. The FMH7 contains a 4-byte
code, called the sense code, which describes the error. This code is set in
EIBERRCD (or CDBERRCD for basic conversations). The FMH7 may be
followed by log data. This log data is included in message DFHZN2701 on the
sending system and DFHZC3433 on the receiving system.
Change direction
The change direction (CD) indicator, found in the RH, switches the issuing
transaction from send state (state 2) to receive state (state 5). CD is
generated explicitly by either of the following:
v A SEND command with the INVITE option
v A CONVERSE command.
Optimization of ISC transmission does not affect the number of data flows that the
application programming interface sees.
For more information on the APPC protocol, see the SNA LU6.2 Reference: Peer
Protocols book, SC31-6808.
DTP. Distributed transaction processing. logical unit (LU). A port through which a user gains
access to the services of a network.
dynamic transaction backout. The process of
canceling changes made to stored data by a transaction LU. Logical unit.
following the failure of that transaction for whatever
reason. LU-LU session. A session between two logical units in
an SNA network.
EIB. EXEC interface block.
modegroup. A VTAM LOGMODE entry which can
FMH. Function management header. specify (among other things) the class of service
required for a group of APPC sessions.
front-end transaction. In synchronous
transaction-to-transaction communication, the modename. The name of a modeset.
transaction that acquires the session to another system
and initiates a transaction on that system. Contrast with modeset. A group of APPC sessions specified in
back-end transaction. CICS.
interregion communication (IRC). The method by network configuration. In SNA, the group of links,
which CICS implements multiregion operation (MRO). nodes, machine features, devices, and programs that
make up a data processing system, a network, or a
communication system.
principal facility. The terminal or logical unit that is sysplex. A systems complex, consisting of multiple
connected to a transaction at its initiation. Contrast with MVS images coupled together by hardware elements
alternate facility. and software services. When multiple MVS images are
coupled using XCF, which provides the services to form
program initialization parameters (PIP). Specially a sysplex, they can be viewed as a single entity.
formatted data passed to a back-end transaction with
the CONNECT PROCESS command. system. In CICS, an assembly of hardware and
software capable of providing the facilities of CICS for a
queue. A line or list formed by items in a system particular installation.
waiting for service; for example, tasks to be performed
or messages to be transmitted in a message-switching Systems Application Architecture (SAA). A set of
system. common standards and procedures for working with
IBM systems and data.
RACF. The Resource Access Control Facility program
product. An external security management facility. Systems Network Architecture (SNA). The
description of the logical structure, formats, protocols,
region. A section of the dynamic area that is allocated and operational sequences for transmitting information
to a job step or system task. In this manual, the term is units through, and controlling the configuration and
used to cover partitions and address spaces in addition operation of, networks. The structure of SNA allows the
to regions. end users to be independent of, and unaffected by, the
specific facilities used for information exchange.
remote resource. In CICS intercommunication, a
resource that is owned by a remote system. task. (1) A unit of work for the processor; therefore the
basic multiprogramming unit under the control program.
remote system. In CICS intercommunication, a (CICS runs as a task under VSE, OS/VS, MVS, or
system that the local CICS system accesses via MVS/ESA.) (2) Under CICS, the execution of a
intersystem communication or multiregion operation. transaction for a particular user. Contrast with
transaction.
resource. Any facility of the computing system or
operating system required by a job or task, and TCAM. Telecommunications Access Method.
including main storage, input/output devices, the
processing unit, data sets, and control or processing TCT. Terminal control table.
programs.
temporary storage control. The CICS element that
rollback. A programmed return to a prior checkpoint. provides temporary data storage facilities.
In CICS, the cancelation by an application program of
the changes it has made to all recoverable resources temporary storage table. A table describing
during the current unit of work. temporary storage queues and queue prefixes for which
CICS is to provide recovery.
RU. Request/response unit. In SNA, the basic unit of
information entering or leaving the transmission terminal. In CICS, a device equipped with a keyboard
subsystem. It may contain data, acknowledgements, and some kind of display, capable of sending and
control commands, or responses to commands. receiving information over a communication channel.
SAA. Systems Application Architecture. terminal control. The CICS element that controls all
CICS terminal activity.
security. Prevention of access to or use of data or
programs without authorization. terminal control table (TCT). A table describing a
configuration of terminals, logical units, or other CICS
session. In CICS intersystem communication, an SNA systems in a CICS network with which the CICS system
LU-LU session. can communicate.
Glossary 177
transaction. A transaction can be regarded as a unit
of processing (consisting of one or more application
programs) initiated by a single request, often from a
terminal. A transaction may require the initiation of one
or more tasks for its execution. Contrast with task.
Index 181
front-end transaction 6, 14
APPC basic conversations 73
L
LAST option
APPC mapped conversations 23
APPC sessions
LUTYPE6.1 conversations 107, 163
with syncpointing 172
LUTYPE6.1 sessions (CICS-to-IMS) 113
MRO sessions 172
MRO conversations 55
with syncpointing 172
function management header (FMH) 108, 173
LLID option
concatenated 64, 112
GDS RECEIVE command 80
function shipping 3
LUTYPE6.1 conversations
ALLOCATE command 107, 112, 115, 168
attaching partner transactions 107
G back-end transaction 107, 163
GDS ALLOCATE command 88, 93 BUILD ATTACH command 108
APPC basic conversations 73 CICS-to-CICS application programming 117
PARTNER option 75 CONVERSE command 109, 112, 115
GDS ASSIGN command 75 CONVID option 107, 108
GDS CONNECT PROCESS command 74, 93 ending one 111
PARTNER option 75 EXTRACT ATTACH command 108, 112, 115
PIPLENGTH option 75 FREE command 111, 112, 115
PIPLIST option 75 front-end transaction 107, 163
GDS EXTRACT PROCESS command 75, 93 RECEIVE command 115
GDS FREE command 84, 94 SEND command 108, 115
GDS ISSUE ABEND command 82
GDS ISSUE CONFIRMATION command 84
GDS ISSUE ERROR command 82
GDS ISSUE PREPARE command 124
M
mapping to APPC architecture 141
GDS ISSUE SIGNAL command 82
basic (unmapped) conversations 142
GDS RECEIVE command 79, 90
mapped conversations 151
BUFFER option 81
migration
LLID option 80
LUTYPE6.1 programs on APPC links 163
GDS SEND command 77
migration mode 163
GDS WAIT command 74, 78
generalized data stream (GDS) model
GDS for APPC 77 client/server 8
peer-to peer 8
MRO conversations
H ALLOCATE command 55, 64, 65, 69
ASSIGN command 58
header, function management 108, 112, 173
attaching partner transactions 56
back-end transaction 55
BUILD ATTACH command 56, 65
I CONVERSE command 62, 63, 65
IMS 105, 107 ending one 62
integrity of data 8 EXTRACT ATTACH command 57, 63, 65
INVITE option FREE command 62, 63, 65
GDS SEND command 78 front-end transaction 55
SEND command (APPC mapped) 28 RECEIVE command 63
SEND command (LUTYPE6.1) 109 Multi-Region Operation (MRO)
SEND command (MRO) 59
CICS-to-CICS application programming 55, 67, 107
ISSUE ABEND command
APPC basic conversations 82
APPC mapped conversations 32
ISSUE CONFIRMATION command
N
APPC basic conversations 84 NOQUEUE option
APPC mapped conversations 33 ALLOCATE command
ISSUE ERROR command LUTYPE6.1 sessions (CICS-to-IMS) 113
APPC basic conversations 82
APPC mapped conversations 32
ISSUE PREPARE command 124 P
ISSUE SIGNAL command PARTNER option
APPC basic conversations 82 ALLOCATE command 23
LUTYPE6.1 sessions (CICS-to-IMS) 115 CONNECT PROCESS command 24
Index 183
W
WAIT command
APPC basic conversations 74, 78
APPC mapped conversations 24, 27
LUTYPE6.1 conversations 109, 115
WAIT option
GDS SEND command 78
LUTYPE6.1 conversations 111
SEND command
MRO conversations 62
SEND command (LUTYPE6.1) 109
SEND command (MRO) 59
WAIT option (APPC mapped)
SEND command 27
WAIT SIGNAL command 109
Feel free to comment on what you regard as specific errors or omissions, and on
the accuracy, organization, subject matter, or completeness of this book.
Please limit your comments to the information in this book and the way in which the
information is presented.
When you send comments to IBM, you grant IBM a nonexclusive right to use or
distribute your comments in any way it believes appropriate, without incurring any
obligation to you.
You can send your comments to IBM in any of the following ways:
v By mail, to this address:
Information Development Department (MP095)
IBM United Kingdom Laboratories
Hursley Park
WINCHESTER,
Hampshire
United Kingdom
v By fax:
– From outside the U.K., after your international access code use
44–1962–870229
– From within the U.K., use 01962–870229
v Electronically, use the appropriate network ID:
– IBM Mail Exchange: GBIBM2Q9 at IBMMAIL
– IBMLink™: HURSLEY(IDRCF)
– Internet: idrcf@[Link]
SC33-1691-02