NBSpool for MPE Reference Guide
Chapter 5
5-12
WHILE Command
Like the XEQ command, the WHILE command allows the user to repeatedly execute a set of
commands. Unlike
XEQ, the WHILE command executes the series of commands once per spool file
qualifying. Once all spool files are processed, the command terminates.
Note. Do not attempt to execute the
XEQ command from the WHILE command.
The subset is evaluated at the time the WHILE command is entered. Any spool files qualifying at that
time will be used. Any files created after the
WHILE command is entered will be ignored, whether
they meet the subset or not.
Note. The
WHILE command only operates on READY spool files. If a file is texted by the
user, it will not be included in the
WHILE command.
To make this command work, two special NBSpool variables are available during the execution of
the
WHILE command:
Variable Description
!CURRENT
Specifies the current spool file ID being processed. This value changes
each time through the
WHILE loop.
!NEW
If an NBSpool command causes a new spool file to be created, this variable
will be set to the new spool file’s ID. The value will remain available until
either another command which creates spool files is executed or when the
end of the current list of commands is reached.
These values are available anywhere in an NBSpool command line and act like actual MPE
variables. However, no MPE variables are set. Type
HELP VARIABLES for more information on these
variables.
The
WHILE command also supports the ERROR and END commands, and they have the same
function as in the
XEQ command. Turn to the “XEQ” section in this chapter for more information.
WHILE Syntax
O> WHILE subset [;FILE=filename]
[;SHOW]