- Change Options to 'Y'.
- Change the Wait For Response value to the appropriate value:
- 'Y', if DBCHCL is not to return control until it can initiate or complete.
- 'N', if DBCHCL is to return control as soon as the function’s request has been sent to the database, in which case the application program must use some other method to detect when the function’s response arrives.
If Wait For Response is set to 'N' and one of the two situations described above occurs, the following return codes are given:EM_NOTIDLE (208) or EM_NODATA (211),
- The first way to decide when it is reasonable to try again is to call DBCHWAT. When control is returned from DBCHWAT, try again. This method ties up less system resources while waiting.
Several tries may be necessary. Occasionally CLI may finish one operation it is doing and go on to another immediately. In that case, DBCHWAT will return control when one operation is over, but the application program’s next call to DBCHCL “does not go through” because CLI has already started another operation. Allow for the possibility of multiple tries.
- The second way to decide when it is reasonable to try again is to try again immediately, and keep trying until “the call gets through.”
- If one above situations occurs and Wait For Response is set to 'N', the original call to DBCHCL did not “take” at all. CLI is reporting “I was not able to do that; try again later.”
- Neither the Abort function nor the Disconnect function is affected by the setting of Wait For Response.
The Fetch, Rewind, End Request, and Abort functions read and use the value of Wait For Response, but do not store it.
By using Wait for Response during CLI logoff processing, applications can prevent CLI from waiting “forever” if the gateway does not respond to the logoff request.