$Principal

$P[RINCIPAL] contains the name of the principal (initial $IO) device. GT.M establishes $PRINCIPAL as a fully expanded VMS device specification.

Input and output for a process may come from separate devices. VMS designates these devices with the process-permanent logical names SYS$INPUT and SYS$OUTPUT. However, the GT.M I/O model allows only one device to be USEd (or active) at a time. When an image starts, GT.M implicitly OPENs the devices identified by SYS$INPUT and SYS$OUTPUTstandard input and standard output device(s) and assigns the device(s) to $PRINCIPAL. For USE deviceparameters, it is the standard input that determines the device type.

For an image invoked interactively, $PRINCIPAL is the user's terminal. For a batch job, $PRINCIPAL is the command file for input and the log file for output. For an image invoked from a terminal by means of a command file, $PRINCIPAL is the command file for input and the terminal for output, unless the command file redefines the logical names SYS$INPUT and/or SYS$OUTPUT. Generally an interactive command file contains the following command immediately before it starts a GT.M image.

Example:

    $ DEFINE SYS$INPUT 'F$TRNLNM("SYS$COMMAND")'
    

This redirects the input for the process to come from the terminal. GT.M ignores a CLOSE command specifying the principal device.

GT.M does not permit a SET command to modify $PRINCIPAL.