NBSpool for MPE Reference Guide

Chapter 5
5-14
This section is a step by step explanation of the previous example:
1) The
XEQ loop contains a WHILE block that will run with a
60
second delay between executions.
2) The
WHILE command selects $STSLISTs that are in the READY state at a priority of
8
. This should
match exactly all newly completed
$STDLIST spoolfiles.
3) For each spoolfile that the
WHILE command selects, it will execute the following commands (up
to the next
END command). The NBSPOOL pseudo-variable !CURRENT is set to the spoolfile
number of the first matching spoolfile, and the commands are executed. Then it is set to the
number of the next selected spoolfile and the commands are executed again, until each spoolfile
has been processed.
4) Within the
WHILE block, the !CURRENT selection criteria is used to ensure that only the current
spoolfile will be operated on.
5) In this example
WHILE block, the first command is an ALTER command that will change the
priority on the current spoolfile to
1
if any of the strings "CIERR", "FSERR" or "ABORT" are
included. If the spoolfile does not contain any of these strings, the
ALTER command will not
select it and the priority will be left alone. Because the
WHILE command was to select spoolfiles
at priority
8
, after executing this command, the spoolfile will either be a priority
1
(if it contains
one of the error strings) or at priority
8
(if it does not contain an error). This priority can be used
as selection criteria for determining whether or not errors exist. The spoolfile will be scanned
once for errors, rather than on each command which would be inefficient.
6) The next three commands have the selection criteria
!CURRENT,%1, the current spoolfile only if
it is at priority
1
(contains an error). First, VSAVE puts it into a special VISTA Plus folder for
$STDLISTs with errors. Then, we put a banner on it and finally alter its priority so that it will
print. If the spoolfile did not contain one of the error strings, these commands will not do
anything because the
%1
in the selection criteria will not match the spoolfile.
7) If no errors are found in the spoolfile, the final command's selection criteria of
!CURRENT,%8
will match the spoolfile and VSAVE the file into a VISTA Plus folder for ordinary error free
$STDLISTs, and purge it.