System Debug commands can be executed from a file with the USE command.
Syntax |
 |
USE
USE [filename] [count]
USENEXT count
USE [CLOSE][ALL | @]
|
USE, entered alone, displays the current open command file(s) and
the current line position within the file (current-record/total records).
USE filename opens the specified file, executes all commands
from that file, and then closes the file. An optional count parameter is used to read a particular number of lines from the file before returning to interactive user input. If count is less than the total number of lines in the file, the file remains open and pending.
USENEXT count reads the next count lines from the most
recently opened file, and once again returns to interactive input.
Up to five command files can be opened at one time; command files are
maintained in a stack, and each has its own remaining count.
USE CLOSE closes (saves) the most recently (still opened) command file. Since files are automatically closed when completed, this is necessary only for partially executed command files.
USE CLOSE ALL or CLOSE @ closes (saves) all (still opened) command files.
Command lines executed from USE files are not displayed, unless the user has explicitly set the environment variable ECHO_USE. (Refer to the ENV ECHO_USE command.)
Parameters |
 |
- filename
The file name of the command file that is to be opened and executed.
Command files must be ASCII files. If omitted, the status of all open command files is displayed.
- count
The number of lines to be executed from the command file. If omitted,
all lines in the file are executed, and the file is closed.
- USENEXT count
Executes the next count lines from the most recently opened
command file.
- USE CLOSE
Closes the most recently (still opened) command file.
The keyword CLOSE can be entered in uppercase or lowercase.
- USE CLOSE ALL , USE CLOSE @
Closes all (still opened) command files. The keywords CLOSE and ALL can be entered in uppercase or lowercase.
Examples |
 |
Opens the file macros, executes all commands from the file, and then closes the file (as is).
Opens the file macros and executes the first 10 lines from the file,
then returns to normal interactive input.
Use the next five lines from the current USE file.
%cmdebug > use
USE file "macros" OPEN: 15/76
|
Displays the current status of open command files. The file macros is opened and positioned at line 15 out of 76 lines.
Closes the current open USE file. Note that other nested USE files
may still be left open.