The #RETURN statement performs the following functions:
Note: For more information about #STAE exits, see #STAE later in this chapter.
Following a #RETURN request, control returns to the program at the next higher level in the task. If the issuing program is the highest level program, control returns to the system. Any #RETURN statement can include a NXTTASK option to specify the next task to be initiated by the system. However, the position of the issuing program in the task governs whether the specified task will, in fact, receive control.
When the system receives control from the highest level program that issued a #RETURN NXTTASK request, the specified task is executed immediately if the specified task code has been assigned the NOINPUT attribute during system generation. If the task code has been assigned the INPUT attribute, the task executes only when the terminal operator enters the requested data.
You can define tasks that relinquish control to the system while awaiting completion of an event. This way, resources for the issuing task are freed during the time it takes for a particular event to finish and the next task to start.
The DC/UCF system gives control to the next task when a specific event control block (ECB) is posted, indicating that the event is completed.
When initiated, the next task is associated with the same logical terminal (LTERM) as the task that issued the #RETURN. An example of the flow of control between tasks is illustrated in the following figure.

|
Copyright © 2014 CA.
All rights reserved.
|
|