Purpose
The OUTPUT command is used to display or to change the output destination. OUTPUT creates a new log file, overwrites an existing log file, appends an existing log file, and displays output to the screen.
Syntax
{ OUTPUT | OUT }
[ [ ECHO ] { TO | OVER | INTO } { file | STDOUT | ME } ] ;
- OUTPUT
- OUT
- If OUTPUT or OUT is specified by itself, the current output destination is displayed.
- ECHO
- If specified, output is written to both the console and file.
- TO
- Specifies that a new file should be created. If the file already exists, then an error is returned.
- INTO
- Appends output to an existing file.
- OVER
- Overwrites an existing file with new output.
- file
- The fully qualified or a relative path filename.
- STDOUT
- Default file to which output is written.
- ME
- Synonym for STDOUT.
OUTPUT/OUT Commands
Specifying OUTPUT/OUT by itself displays the current output destination. By default, the output destination is the console (STDOUT), so you must explicitly specify the OUTPUT command to create a log file.
By sending output to both the console and log file, the ECHO option allows users to monitor progress of the CHECK command on the console and generates a log file for reference purposes. This is especially helpful if the CHECK command runs for a long time or generates a great deal of output. Use the ECHO option to see table failures in the log file or to review output for a particular table.
Because the log file provides a complete record of the CHECK command run, it can be helpful to browse through the log file using a text editor.
The log file remains open until the CheckTable session is closed or until the next OUTPUT command is issued. Command output is written to the log file as long as the file is open. The log file can contain multiple command outputs, so a copy of the command line is written to the log file to distinguish one output from another.
If output is redirected to a file, some commands may still output to the console. This occurs for commands that are more user-interactive and need to display output to the user. Commands like HELP, STATUS, OUTPUT, and interactive help (F7) fall into this category. The STATUS and interactive help commands will only display output to the console. The HELP and OUTPUT commands will display output to both the console and log file.
CheckTable does not manage the log files. The files remain until deleted by the user.
Usage Notes
The CheckTable log file is located on the node that runs the control AMP. To determine which node is running the control AMP, use the STATUS command of the Vproc Manager utility. The control AMP is designated under the Logical Configuration with an asterisk. For more information, see CheckTable (checktable).
If a file system error occurs during a log file write operation, an error message is written on the console and log file processing is halted. The current output destination reverts automatically back to the default (STDOUT).
When running multiple instances of the CheckTable utility on the same system, do not use a single log file for both CheckTable instances.
Example: Displaying current output destination
To display the current output destination:
OUTPUT;Example: Redirecting output to a file
To redirect output to a new file using a relative path filename:
OUT TO checklog;Example: Echoing output to the console and a file
To echo output to the console and overwrite a file using a fully qualified filename:
OUTPUT ECHO OVER /var/tmp/checklog;Example: Redirecting output and appending to a file
To redirect output and append to an existing log file:
OUT INTO checklog;Example: Specifying an irregular output file name
To specify an irregular file name:
OUT TO 'check log';Example: Resetting output destination to console screen
To reset output back to the console:
OUT TO STDOUT;