The ATTACH command connects your input stream to another process.
You can use the ATTACH command to change control from one
subprocess to another subprocess or to the parent process.
When you enter the ATTACH command, the parent process goes into
hibernation and your input stream connects to the specified
destination process. You can use the ATTACH command to connect
to a subprocess that is part of a current job (left hibernating
as a result of the SPAWN/WAIT command or another ATTACH command)
as long as the connection is valid. No connection can be made to
the current process, to a process that is not part of the current
job, or to a process that does not exist. If you attempt any of
these connections, you receive an error message.
You can also use the ATTACH command in conjunction with the
SPAWN/WAIT command to return to a parent process without
terminating the created subprocess. See the description of the
SPAWN command for more details.