The DETACH statement should be used to free the system resources associated with a thread that was attached with the THREAD option.
>>-DETACH--THREAD--(task-reference)--;-------------------------><
Normally, this statement would be executed immediately after the WAIT statement for the terminating thread.