z/OS Communications Server: SNA Programmer's LU 6.2 Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Entering RECEIVE state

z/OS Communications Server: SNA Programmer's LU 6.2 Guide
SC27-3669-00

VTAM® allows only one side of a half-duplex conversation to receive information at any given time. When an application program receives information, the conversation must be in RECEIVE state. The conversation partner can receive error indications, confirmation responses, or requests from its partner to become the receiver.

The local transaction program enters SEND state after a successful allocation request is completed. The partner transaction program receives the FMH-5 and its side of the conversation enters RECEIVE state. After the conversation is started, the transaction program in SEND state can put the conversation in RECEIVE state when it is ready to receive data by issuing one of the following macroinstructions:
  • APPCCMD CONTROL=PREPRCV
  • APPCCMD CONTROL=RECEIVE, QUALIFY=SPEC

In general, the transaction program that has a conversation in SEND state can place the conversation in RECEIVE state at any time. The partner transaction program must examine the What-Received field or the CONSTATE field (RPL6CCST) on its RECEIVE requests to determine if the sending transaction program has placed this side of the conversation in RECEIVE state.

An exception exists to the rule that the sending transaction program determines when it places the conversation in RECEIVE state. If a receiving application program detects an error, it can issue an APPCCMD CONTROL=SEND, QUALIFY=ERROR macroinstruction. The original sending transaction program receives a return code indicating that an error was reported and that the application has been placed in RECEIVE state.

A special consideration exists when the application program wants to enter RECEIVE state and the application program is in SEND state or PEND_SEND state. Because the application is finishing its role as the sender, it must complete any logical records it has started to send. If the latest logical record being sent is not finished, the macroinstruction completes unsuccessfully with an error code of LOGICAL_RECORD_BOUNDARY_ERROR. The conversation remains in SEND state, at which time the application program has three choices:
  • Send more data to complete the logical record.
  • Use the APPCCMD CONTROL=SEND, QUALIFY=ERROR macroinstruction to indicate that an error occurred.
  • Use one of the abnormal termination APPCCMD CONTROL=DEALLOC|DEALLOCQ macroinstructions or the APPCCMD CONTROL=REJECT macroinstruction to end the conversation.

The APPCCMD CONTROL=PREPRCV macroinstruction combines the functions of sending new data and a confirmation request. For example, if an application program is to finish sending a logical record, get confirmation, and begin receiving, it could issue an APPCCMD CONTROL=PREPRCV, QUALIFY=DATACON macroinstruction. The application program cannot request confirmation if it places the conversation in RECEIVE state using the APPCCMD CONTROL=RECEIVE macroinstruction.

For a general discussion of sending data, see Sending information.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014