z/OS MVS Programming: Writing Transaction Programs for APPC/MVS
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Sending Error Notification

z/OS MVS Programming: Writing Transaction Programs for APPC/MVS
SA23-1397-00

Figure 1. Example of Send_Error in Receive State
   ┌─────────┐                                 ┌─────────┐
   │ PROGRAM │                                 │ PROGRAM │
   │         │←───────────────────────────────→│         │
   │    A    │                                 │    B    │
   └─────────┘                                 └─────────┘
    (RUNNING)                                   (RUNNING)
(IN CONVERSATION)                            (IN CONVERSATION)

Call ATBSEND  1                                2  Call ATBRCVW
 RC=OK
                                                      .
                                                      .

Call ATBSEND  3  ──────────────────────→  4   RC=OK
 RC=OK                                           DATA_RECEIVED=
                                                   DATA_COMPLETE

              6  ←──────────────────────  5  Call ATBSERR (Send_Error)
                                                      .
Call ATBSEND  7  ───────────────────────────→         .
  .                                                   .
 RC=          10  ←─────────────────────  8  RC=OK
 (Program_Error_Purging)

Call ATBRCVW  11                          9  Call ATBSEND
                                                      .
                                                      .
                                                      .

A transaction program can send an error notification to its partner to report that an error occurred and to cause buffer data to be purged.

In Figure 1, program A has already allocated the conversation and is in Send state, with program B in Receive state.
  1. Program A calls the Send_Data service, causing the LU to place the data (a logical record) in its buffer. Nothing is sent.
  2. Program B calls the Receive_and_Wait service, suspending processing until it receives data.
  3. Program A calls Send_Data again, causing the LU to place more data (another logical record) in its buffer. The LU now has enough data to send, based on session characteristics, so it sends the data.
  4. The LU returns control to program B, indicating that the program has received a complete record.
  5. Program B encounters an error in the data or in its processing and calls the Send_Error service. The Send_Error service causes program B's LU to purge information it has received but not yet sent, and to send a negative response. Program B's processing is suspended awaiting Send control.
  6. Program A's LU receives the negative response, purging any remaining buffered data from program A.
  7. Program A, unaware of the error yet, calls Send_data, which fails. The LU does not accept the data. Instead, the LU sends Send control to program B, suspending program A.
  8. The LU for program B receives the Send control, sends the error notification, and returns control to program B.
  9. Program B calls the Send_Data service, possibly to transfer more error-recovery information.
  10. Program A's LU returns control to it, along with the error notification (return code program_error_purging).
  11. Now in Receive state, program A calls Receive_and_Wait.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014