Create a subprocess.
Qualifiers Defaults /INPUT=in-file-spec None /LOGICAL_NAMES /LOGICAL_NAMES /OUTPUT=out-file-spec None /PROCESS=name None /SYMBOLS /SYMBOLS /WAIT /WAIT
commandOptional parameter specifying the DCL command string for the subprocess to execute. After the command completes, the subprocess terminates and control is returned to the parent process.
The SPAWN command may be used to either issue a single DCL command from within PMDF MAIL or to leave PMDF MAIL temporarily, do other work (e.g., type out a file, generate a directory listing, etc.), and then return to PMDF MAIL.
By default, the context of the current process is copied to the subprocess. This behavior may be controlled with the /LOGICAL_NAMES and /SYMBOLS qualifiers.
/INPUT=in-file-specSpecifies an input command file from which the subprocess is to draw command input. Once command processing is completed, the subprocess terminates. When you specify both a command string and input file, then the command string is first processed and then the commands from the input file.
/NOLOGICAL_NAMESThe /LOGICAL_NAMES qualifier specifies that the logical names of the parent process are to be copied to the subprocess. This is the default behavior. Specify /NOLOGICAL_NAMES to prevent the subprocess from inheriting the logical name definitions of its parent.
/OUTPUT=out-file-specSpecifies the output file to which the output of the subprocess is to be directed. If the /OUTPUT qualifier is omitted, then subprocess output is directed to the current SYS$OUTPUT device (generally, your terminal).
/PROCESS=nameSpecifies the process name to associate with the subprocess. If not specified, a default name of the form USERNAME_n, where "USERNAME" is your username, is used.
/NOSYMBOLSThe /SYMBOLS qualifier specifies that the DCL symbol definitions of the parent process are to be copied to the subprocess. This is the default behavior. Specify /NOSYMBOLS to prevent the subprocess from inheriting the symbol definitions of its parent.
/NOWAITBy default, your current (parent) process will wait until the subprocess has finished its processing and terminated. This default behavior is explicitly selected with the /WAIT qualifier. The /NOWAIT qualifier allows you to continue working from your current process while the subprocess is running. When you specify /NOWAIT, you should also specify the /OUTPUT qualifier so as to prevent the subprocess output from appearing on your terminal screen.
EMAIL> SPAWN DIRECTORY/SIZE=ALL A.TXT Directory D1:[BOB] A.TXT;10 125/126 A.TXT;9 124/126 A.TXT;8 124/126 Total of 3 files, 373/378. EMAIL> SPAWN PURGE/LOG A.TXT %PURGE-I-FILPURG, D1:[BOB]A.TXT;9 deleted (126 blocks) %PURGE-I-FILPURG, D1:[BOB]A.TXT;8 deleted (126 blocks) %PURGE-I-TOTAL, 2 files deleted (252 blocks) EMAIL>
In this example, the SPAWN command is used to obtain a directory listing of the files A.TXT, and then to purge back old versions of that file. The ability to do this is useful when you find that you have insufficient disk quota to create and edit a mail message you wish to send.
EMAIL> SPAWN . . . $ LOGOUT Process BOB_1 logged out at 23-FEB-2002 12:12:51.42 You have 3 new messages. EMAIL>
In this example a SPAWN command with no command string is issued. This places you into the subprocess where you can issue DCL commands and perform other processing. When you are done with the subprocess and ready to return to PMDF MAIL, use the LOGOUT or EOJ command.
EMAIL> SPAWN DOCUMENT REPLY.SDML LETTER MAIL . . [... output from DOCUMENT ...] . EMAIL>
Here, the SPAWN command is used to invoke DOCUMENT to process a file. While DOCUMENT is running, you cannot enter other PMDF MAIL commands. After DOCUMENT is finished, the EMAIL> prompt again appears at which point you may resume entering PMDF MAIL commands.
EMAIL> SPAWN/NOWAIT/OUTPUT=REPLY.LOG DOCUMENT REPLY.SDML LETTER MAIL EMAIL>
In this example, the /NOWAIT and /OUTPUT qualifiers are used in conjunction with the SPAWN command. This allows you to continue to enter commands while the subprocess is running. The subprocess output is written to the file REPLY.LOG which you can type out or view with an editor at your leisure.