The following example waits on any outstanding asynchronous SQL request to complete and returns control to the program when any one completes, returning the value for the completed asynchronous statement identifier to :requid_var and the value for the ID of the session in which the request ran to completion to :sessid_var.
WAIT COMPLETION INTO :reqid_var, :sessid_var