Format
SPAWN [ qualifier ] ... [ command-string ]
1 – Parameters
1.1 – command-string
Specifies an OpenVMS DCL command you want to perform in the
context of the subprocess the SPAWN command creates. After the
subprocess executes this command string, DCL returns control to
your CDO process. A command string cannot exceed 132 characters.
2 – Qualifiers
2.1 /INPUT=file-spec
Specifies an OpenVMS file containing one or more DCL commands
that DCL executes in the spawned subprocess. Once DCL finishes
processing your input file, DCL terminates the subprocess and
returns you to the CDO prompt.
2.2 /OUTPUT=file-spec
Requests that the output from the subprocess be written to the
OpenVMS file you specify.
2.3 /WAIT
Format options:
/WAIT (default)
/NOWAIT
Specifies whether the system waits until DCL completes a
subprocess before allowing more commands to be issued in the
parent process (the process in which you are running CDO).
The /WAIT qualifier does not return you to the parent process
until the command string you specify completes execution, or you
log out of the created subprocess. You can also use the ATTACH
command to return to the parent process.
The /NOWAIT qualifier allows you to issue new commands while a
subprocess is running. Use the /NOWAIT qualifier interactively.
This directs output from the subprocess to a file so only one
process at a time uses your terminal. Otherwise, the only way to
distinguish one process from another is by the prompt. The CDO
prompt indicates the parent process; the DCL prompt (normally a
dollar sign) indicates the subprocess.
If you specify the /NOWAIT qualifier and your input device is
a terminal, control characters such as Ctrl/T or Ctrl/Y affect
all subprocesses sharing the input device. For example, Ctrl/Y
interrupts all such subprocesses.
3 – Description
The SPAWN command creates a subprocess of the current CDO
process.
4 – Examples
1.CDO> SPAWN SHOW TIME
17-FEB-1997 16:28:29
CDO>
In this example, the SPAWN command creates a subprocess to
execute the DCL command SHOW TIME. After the SHOW TIME command
completes executing, DCL returns control to the parent CDO
process.
2.CDO> SPAWN
$ LOGOUT
CDO>
In this example, the SPAWN command creates a subprocess at the
DCL prompt. To return to the CDO process, type LOGOUT at the
DCL prompt.
3.CDO> SPAWN RUN SQL$
SQL>
In this example, the SPAWN command creates a subprocess to run
interactive SQL.