Transfers control from your current process (which then
hibernates) to the specified process in your job.
The ATTACH and SPAWN commands cannot be used if your terminal has
an associated mailbox.
Format
ATTACH [process-name]
1 – Parameter
process-name
Specifies the name of a parent process or a spawned subprocess
to which control passes. The process must already exist, be part
of your current job tree, and share the same input stream as
your current process. However, the process cannot be your current
process or a subprocess created with the /NOWAIT qualifier.
Process names can contain from 1 to 15 alphanumeric characters.
If a connection to the specified process cannot be made, an error
message is displayed.
2 – Qualifier
2.1 /PARENT
Enables you to attach to the parent process. If no parent process
exists, you receive an error message.
3 – Description
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.
4 – Example
$ SPAWN
%DCL-S-SPAWNED, process SYSTEM_1 spawned
%DCL-S-ATTACHED, terminal now attached to process SYSTEM_1
$ RUN SYS$SYSTEM:SYSMAN
SYSMAN> ATTACH SYSTEM
%DCL-S-RETURNED, control returned to process SYSTEM
$
In this example, the SPAWN command creates a subprocess
(SYSTEM_1). After you invoke SYSMAN and enter the ATTACH
command, you transfer the terminal's control back to the parent
process (SYSTEM).