Was this helpful?
Terminal Monitor Commands
The Terminal Monitor commands are the commands that you use to manipulate the contents of the query buffer or your environment. Unlike the QUEL statements that you type into the Terminal Monitor, these commands are executed as soon as you press the Return key.
You must precede all of the Terminal Monitor commands with a backslash (\). If you want to enter a backslash literally, you must precede it with another backslash and enclose the pair in quotes. For example, the following statement inserts a backslash into the test table:
append to testtable (name="James T. Smith\\n")\g
Some Terminal Monitor commands accept a file name as an argument. These commands must appear alone on a single line; the Terminal Monitor interprets all characters appearing on the line after such commands as a file name. Those Terminal Monitor commands that do not accept arguments can be stacked on a single line. For example,
returns the date and time before and after execution of the current query buffer.
The following table lists the Terminal Monitor commands:
\r or \reset
Erases the entire query (reset the query buffer). The former contents of the buffer are lost and cannot be retrieved.
\p or \print
Prints the current query. The contents of the buffer are printed on the user's terminal.
\l or \list
Prints the current query as it appears after macro processing. All side effects of macro processing (such as macro definition) occurs. \list clears the query buffer; use \eval to process macros without clearing the query buffer.
\eval or \v
Processes macros in the query buffer and replaces the query buffer with the result. Similar to \list, but the result is placed in the query buffer instead of being displayed on the terminal.
\e or \ed or \edit or \editor [filename]
Invokes a text editor (designated by the startup file). Use the appropriate editor command to return to the Terminal Monitor. If no file name is given, the current contents of the query buffer are sent to the editor, and upon return, the query buffer is replaced with the edited query. If a file name is given, the query buffer is written to that file. On exit from the editor, the file contains the edited query, but the query buffer remains unchanged.
\g or \go
Processes the current query. The contents of the buffer are transmitted to the DBMS Server and run.
\a or \append
Appends to the query buffer. Typing \append after completion of a query overrides the auto-clear feature and guarantees that the query buffer is not reset until it is executed again.
\time or \date
Prints out the current time and date
\s or \sh or \shell
Escapes to the operating system.
UNIX: Type Ctrl-D to return to the Terminal Monitor.
VMS: Type logout to return to the Terminal Monitor.
\q or \quit
Exits the Terminal Monitor
\cd or \chdir dir_name
Changes the working directory of the monitor to the specified directory
\i or \include or \read filename
Reads the named file into the query buffer. Backslash characters in the file are processed as they are read.
\w or \write filename
Writes the contents of the query buffer to the specified file
Transfers control within an \include file. see Branching.
\script [filename]
Writes or stops writing the subsequent QUEL statements and their results to the specified file. If no file name is supplied with the \script command, output is logged to a file called "script.ing" in the current directory.
The \script command toggles between logging and not logging your session to a file. If you supply a filename on the \script command that terminates logging to a file, the filename is ignored. You can use this command to save result tables from QUEL statements for output. The \script command in no way impedes the terminal output of your session.
\bell and \nobell
Tells the Terminal Monitor to include (\bell) or not to include (\nobell) a bell (Ctrl-G) with the continue or go prompt. The default is \nobell.
Sets a label for \branch
\macro and \nomacro
Enables or disables macro definition. The default is \nomacro
\continue and \nocontinue
Tells the Terminal Monitor to continue statement processing on error or not to continue (nocontinue). In either case, the error message is displayed. You can abbreviate the command to \co (\continue) or \noco (\nocontinue).
The default action is to continue. You can use this command to change that behavior. You can also change the default by setting II_TM_ON_ERROR. For information about II_TM_ON_ERROR, see the System Administrator Guide.
Last modified date: 06/08/2023