The ZSYSTEM command creates a subprocess of the current process in a fashion analogous to the DCL SPAWN command.
The format of the ZSYSTEM command is:
ZSY[STEM][:tvexpr] [expr[:tvexpr][,...]]
The optional truth-valued expression immediately following the command is a command postconditional that controls whether or not GT.M executes the command.
The optional expression specifies the command passed to the Command Language Interpreter (CLI), usually DCL; after processing the command, CLI returns control to GT.M.
If ZSYSTEM has no argument or expr="", the CLI prompts for input until provided with an exit command; at least two (2) spaces must follow a ZSYSTEM command with no argument to separate it from the next command on the line.
The optional truth-valued expression following the argument expression specifies the argument postconditional and controls whether ZSYSTEM processes that argument.
An indirection operator and an expression atom evaluating to a list of one or more ZSYSTEM arguments form a legal argument for a ZSYSTEM.
The ZSYSTEM command creates a new process and passes its argument to a Command Language Interpreter (CLI), usually DCL for execution. The new process executes in the same directory as the initiating process . The new process has the same operating system environment, such as logical names and input/output devices, as the initiating process. The initiating process pauses until the new process completes before continuing execution. The return status of the spawned process is reflected in $ZSYSTEM.
Note that, like any other VMS-spawned process, a process created by ZSYSTEM acquires the privileges currently held by its parent process at the time of its creation.
If a ZSYSTEM command has multiple arguments, it starts a new process for each argument, one at a time. ZSYSTEM waits for one process to complete before starting the next one.
A ZSYSTEM with a null argument causes CLI to prompt on SYS$OUTPUT, and accept commands from SYS$INPUT, until it receives a DCL LOGOUT command or other input terminator. For an interactive process, both SYS$OUTPUT and SYS$INPUT generally translate to the user's terminal. A ZSYSTEM with no arguments is equivalent to a ZSYSTEM with a single null string argument.
If a command postconditional is false, GT.M does not process the ZSYSTEM command. If an argument postconditional is false, GT.M does not process that argument.
Issuing a ZSYSTEM command inside a transaction destroys the Isolation of that transaction. Because of the way that GT.M implements transaction processing, a ZSYSTEM within a transaction may suffer an indefinite number of restarts ("live lock").
The flags arguments used by GT.M to call the OpenVMS function LIB$SPAWN to implement the ZSYSTEM command can be set in GTM$DEFAULTS.MAR with a GTM$USER_SPAWN_FLAG == n line, where the bits in n specify various properties as below. Since the exact values are subject to change by Hewlett-Packard, please validate your choice using the OpenVMS RTL Library Manual and the include files in SYS$LIBRARY. In order to prevent unauthorized subversion of OpenVMS security, the default value (0), will be used unless both GTMSHR.EXE and the application image are installed with the CMEXEC privilege.
NOWAIT: 1
NOCLISYM: 2
NOLOGNAM: 4
NOKEYPAD: 8
NOTIFY: 16
NOCONTROL: 32
TRUSTED: 64
AUTHPRIV: 128
SUBSYSTEM: 256