How a synchronous operation works
In a synchronous program, operations are performed serially. A request for synchronous operation (for example, SIMLOGON, SEND, or RECEIVE OPTCD=SYN) means that VTAM® does not return control to the next sequential instruction in the application program task or SRB (under MVS™) from which the macroinstruction was issued until after the requested operation is completed. See Serialization of execution for information about running several parts of an application concurrently. Figure 1 illustrates a synchronous operation.
In general, avoid issuing a synchronous request in a task because it suspends all execution under the task until that request completes. Also avoid issuing a synchronous request within an exit routine identified in an ACB exit list. For more information on ACB EXLST exit routines, see Using exit routines.
Designing an application program to use synchronous requests while running under an SRB is more reasonable because the number of system resources forced to wait for the completion of the operation is more limited. Refer to Synchronous versus asynchronous operations for further information. The differences between the TCB and SRB modes of execution are described in detail in Execution of exit routines.
When a synchronous operation is completed, the application program must determine whether the operation was successful or unsuccessful. The application program does this by testing values in registers 15 and 0 and by examining fields in the RPL used for the operation. For more information on testing return codes from RPL-based macroinstructions, see Handling errors and special conditions, and Return codes and sense fields for RPL-based macroinstructions.