Section 14
Section 14
8)
To a large extent the batch mode of running SATURN programs has been
superseded by the introduction of the SATWIN front end which operates under
WINDOWS. However SATWIN itself uses .bat files (although essentially invisible
to the casual user) and there are facilities within SATWIN (see 3.6) for essentially
do-it-yourself .bat file creation. It also makes use of the same “command line”
conventions as the .bat files and, in effect, SATWIN generates the command line
for you. Thus, like the study of Latin, there are still advantages in knowing
something about .bat files!
On all computers there are a number of ways in which the same job may be run
with varying amounts of „job control language‟ (JCL) being required of the user.
For example under DOS (or its equivalent “Command Prompt” under Windows)
the user can initiate a job by typing in a “command line” such as:
from the terminal, where „network‟ and „trips‟ specify particular network and trip
matrix files which need not be further specified. Alternatively, under “pure”
Windows, one might select SATEASY as an icon or from a SATWIN list and then
select the files interactively. In the first case a „control procedure‟ or bat file
„SATEASY.bat‟ has been set up in order to remove most of the hard work.
For every program in the Suite there is an equivalent .bat file with the same
“name” as the .exe file (so that the SATEASY.bat procedure runs the
$SATEASY.exe program) and which requires a Command Line containing a
particular sequence of keywords and/or file names. The .bat files exist under both
DOS and/or Windows, although their functionality may differ within different
operating environments.
The main function of the bat file is to form a “bridge” between the user and the
program exe file such that file names etc get passed back and forwards between
the two. Previously under 16-bit “pure” dos this involved, to a greater or lesser
extent, logical checks and steps within the .bat file; with 32-bit programs and/or
Windows the emphasis has changed and the .bat file simply transfers the
command line into the program and the logic all takes place within the program.
This may make it more difficult for “users” to set up their own “clever” bat files to
control SATURN programs. But not impossible; see 14.11.
Command line parameters or “tokens” (e.g. “network” and “trips” in the above
example) may be divided into mandatory and optional with the mandatory
parameters coming first in a fixed order followed by the optional parameters in any
order. For example to run SATEASY there are two mandatory parameters as in:
A “help” facility is provided whereby if you type in simply the name of the
procedure without any further parameters, a brief description of the format of the
procedure appears on the screen. For example, typing simply “SATSIM” would
give condensed instructions as to how to use SATSIM.bat.
Finally users should note that the .bat files supplied with SATURN are not “tablets
carved in stone” and may, unlike the .exe files, be modified by the users
themselves. Indeed, given the inherent flexibility of the SATURN programs, users
are positively encouraged to explore alternative and innovative ways of linking the
programs together, for which alternative .bat files can be extremely useful. Some
suggestions are given in 14.11.
In order to run a program, e.g. SATALL, all the individual input and output files
need to be specified. This may be done in three ways:
specifies input files net.ufn and trips.ufm plus output files net.ufs and net.lpt
through the command line.
However the trip matrix name could also have been defined in the original data file
net.dat under &PARAM (see 6.3.4) via FILTIJ = „trips.ufm‟ and passed to SATALL
via net.ufn - (option ii above), in which case the command line:
SATALL net
Interactive file specification is used as and when files not already defined under i)
or ii) are needed. Generally speaking this is most common with the purely
interactive programs such as PIX whereas the non-interactive programs such as
SATNET or SATALL should only use methods i) and ii).
Command line filename definitions may include the extension but it is not
essential; it may also be implied either by its position in the command line or by
keywords immediately before or after. For example:
PIX livnet.ufs
PIX livnet
will also input livnet.ufs where the extension .ufs is implied by default.
Alternatively either:
or P1X livnet.uft
both define an input file “livnet.uft”. In the former case UFT is an example of a
keyword which appears after the filename it amplifies; in the latter case the
extension is explicit.
Equally
implies an input file tij.ufm under the REDMEN option where here the keyword
REDMEN appears before the filename it describes.
Note that the “names” used in the command line may be based on either
“filenames” or “pathnames”. Thus either:
SATNET net
or
SATNET C:/JOB/DAT/net
could both be used to specify the file C:/JOB/DAT/net.dat, where the first definition
relies on the current home directory and/or “append” search definitions to locate
the file. SATURN uf* files store both a “filename” and a “pathname” to help locate
the required files at later stages.
If, for example, the user wishes to examine 2 or more input files under P1X the
command:
would imply the two input files net1.ufs and net2.ufs since net2 is neither a
standard extension nor keyword and .ufs is the default extension. Equally:
An alternative more complicated (and somewhat out of date) general method used
by several bat files to specify multiple files on command lines is via a 3-part
specification such as:
S 9 NET1
Thus the initial letter - S, A, T or M - specifies the extension and must be one of
those 4, the second parameter is the channel number (with certain values being
invalid) while the third parameter gives the filename.
Typing the program name followed immediately by the single parameter I runs
that program under the “file interactive mode” whereby the program itself requests
the names of all files, both input and output, to be entered via the
terminal/keyboard. For example:
SATLOOK I
Similarly the essentially “batch-style” programs SATCH and SATME2 may be run
in a form of “file interactive mode” via “SATCH I” or “SATME2 I” but equally this
usage is not recommended.
This section describes how to run the iterative SATURN model illustrated in
Figure 3.1 using the „SATURN‟ control procedures. Thus there are two essential
input files to be prepared by the user: (1) A network “DAT” file; and (2) A “UFM”
file describing the trip matrix to be assigned. Outputs include both binary UF* files
and ascii line printer files.
In order to run SATURN the user must issue a command of the form:
SATURN network
or, if the trip matrix filename trips.ufm is not defined in the network .dat file
(which it should be!):
This does not of course imply that the network file must have the name
„network.DAT‟ - the user can choose any filename for the input file, but it must
have the extension DAT. Similarly all other files have a user-supplied filename
but fixed extensions as defined above.
The basic SATURN procedure may be extended to cope with various options by
specifying certain keywords, specifically PASSQ, UPDATE, PLOD and RESTART,
plus (optionally) file names. These are described below.
N.B. These particular options cannot only be run using special bat files; they may
also be activated by setting parameters plus file names in the original .dat file. In
fact this is probably a more convenient method to follow, given that if you need to
edit a .dat file to specify PASSQ=T you might just as well specify the extra
filename as well.
executes a normal SATURN run, starting with the network „net2.DAT‟, but any
queues detected by previously running SATURN on „net1‟ are passed to „net2‟. In
other words „net2‟ represents the time period immediately following that simulated
by „net1‟.
The alternative method to invoke PASSQ using just input to the net2 .dat file
would involve the following namelist specification:
&OPTION
PASSQ = T
PQFILE = „net1.ufs‟
…
&END
as per normal.
Note that if, belt‟n‟braces, the PASSQ file is defined both under &OPTION and on
the command line then the file on the command line is always used.
executes a normal SATURN run but with the data input file „net2.DAT‟ being an
improved version (and presumably representing the same time period) as a
previous run based on net1.
Alternatively the update file may be specified using the UPFILE parameter under
&PARAM as per PASSQ in 14.4.1 above. Note that if, belt‟n‟braces, the UPDATE
file is defined both under &OPTION and on the command line then the file on the
command line is always used.
Note as well that a network can “update itself”; i.e., the command:
Would use the file net.ufs as the update file input to SATNET in order to
supplement the data in file net.dat. Ultimately, post SATALL, the original file
net.ufs would be over-written by the new version. This option enables the user to
edit the file net.dat without having to create a new filename for the file.
executes the normal iterative sequence of assignment and simulation but, instead
of starting with the default flow-delay curves from a .ufn network file as input from
the network build program SATNET, the procedure starts with flow-delay curves
from the file network.ufs which had previously been processed by SATALL. At
the end of the program the file network.ufs will have been over-written.
The RESTART option is useful either for continuing a SATURN run to obtain
improved convergence or, much more frequently, to re-run an existing network
with a new trip matrix, e.g., as obtained from the update program SATME2.
N.B. Previously the RESTART option could also be used with a batch file
“SATURN8.BAT” which was equivalent to SATURN.BAT but, instead of using
SATALL, used an explicit loop over the programs SATSIM and SATEASY. Its
use is no longer recommended.
executes a normal SATURN run with the data input file, „net2.DAT‟, but with the
total assigned flows from a SATURN output file „net1.UFS‟ being pre-loaded as
fixed flows onto net2.
Note that the extension of net1 above may be explicitly included in the command
line, e.g.:
Alternatively, if an extension which is not .ufs or .ufa is used, e.g., if the input
command line were:
Then the fixed flows would be read from a text file flows.dat; see 15.5.4.
As above the &OPTION namelist record in net2.DAT should define PLOD = T but,
if not and if a PLOD file is defined in the command line, PLOD is automatically set
to T. In either case the pre-load file “net1.UFS”, “flows.dat” etc. must exist.
Alternatively the pre-loaded file may be defined via the parameter PLDFIL (6.1) in
net2.dat, in which case the PLOD specification above is unnecessary in the
command line.
Note that, unlike PASSQ and UPDATE above, if a pre-load file is defined both
within &OPTION and on the Command Line then the file set under &OPTION is
used.
14.5 “LOG”, “KEY” and “VDU” Files: Running Interactive Programs “Off-
line”
Log Files
All interactive programs automatically create a “log file” which contains a complete
record of all user inputs. “Inputs” include not only keyboard responses, filenames
etc. but also mouse operations. The “format” of the file distinguishes between the
different input styles; see 14.5.2 and 14.5.3 for details.
Log files have standard filenames based on the program names such as
PIXn.LOG, SATDBn.LOG, etc. where the ”generation number” n is appended
each time a program is run (within that particular subdirectory). This feature is
provided to deal with multi-tasking but - N.B.!! - it requires frequent file cleaning on
the part of the user. The maximum generation number is 99.
Key Files
The main use of the LOG files is to create “KEY files” which are used to re-run
interactive programs such as SATDB, MX or P1X in an “off-line” or “quasi-batch”
mode whereby the normal commands which are supplied by the user via the
keyboard and/or mouse are instead taken (in sequence) from a “dummy terminal”
or “key” file. Thus the second key-based run of SATDB would follow exactly the
same series of instructions as the first, the difference being that the sequence of
commands is read from successive records in the key file rather than being
directly generated by the user. This means that, for example, having performed a
particular operation interactively on file-1 it is possible to automatically repeat the
identical operations on file-2 without having to laboriously repeat the same
sequence of keyboard operations.
More precise details as to how log/key files are constituted and applied are given
in sections 14.5.2 to 14.5.10.
A similar facility to KEY files is also available under command line options as
described in 14.7. Note however that KEY files are, from the point of view of a
SATURN user as opposed to the SATURN developers, far more flexible.
VDU Files
In addition there is a further option available in conjunction with the KEY option
whereby the terminal output from an interactive program may be directed either to
a terminal screen or to a dummy “VDU” file. The latter is probably a “purer” form
of off-line or batch processing; the former is more useful in a sort of demonstration
mode where a program may be run apparently on-line but with the viewer only
having to hit the <return> key and/or click the mouse at each pause rather than
having to decide on the input.
(N,B. A very useful alternative to clicking the mouse in order to advance at each
stage of a graphical routine is to use Alt-F4!)
In order to run, say, SATDB with a key file the standard command line should
(normally) contain the “keyword” KEY followed by a filename whose (implied)
extension is .key. Thus:
runs SATDB on an input file LIVNET.UFS with terminal commands taken from a
file JAN16.KEY which has been copied (/renamed) from a .LOG file from a
previous, purely interactive run of SATDB.
The extension “.KEY” is implied and, prior to Version 10.9.21, was obligatory.
However, post November 2010, key files may either have an extension .key or
.log and may be set with or without the keyword KEY.
Thus a LOG file may be used directly as a KEY file without being renamed with its
extension changed. For example:
would run SATDB with its terminal commands taken from a file satdb16.log,
presumably output as a LOG file from a previous run of SATDB.
Alternatively (post 10.9.22), the “pre-word” KEY is not an absolute necessity but
may be implied by the extension of a filename given on the command line such
that:
or
runs SATDB on an input file LIVNET.UFS with terminal commands taken from
JAN16.KEY or satdb16.log respectively.
runs SATDB on LIVNET.UFS with terminal input from JAN16.KEY and terminal
output to FRED.VDU. Nothing therefore appears on the screen.
Alternatively (post 10.9.22) the keyword VDU may be dropped by simply entering
a filename with an extension .VDU as in:
It is also possible to combine the KEY and VDU functions into a single command
line keyword KEYVDU such that:
is equivalent to:
This is particularly useful when there are a large number of entries on the
command line since it saves, in effect, two words.
For programs such as SATLOOK, SATDB, etc. which are based purely on
keyboard (text) inputs (see 19.2) the key file contains a listing of those keyboard
inputs; more complicated structures, including inputs via the mouse, are dealt with
in 14.5.3
For example, the following key file “FUEL.KEY” creates, using SATDB, a data
array which is a linear combination of link time and distance representing fuel
consumption, and then creates a new “extended” UF file in which fuel
consumption is stored in DA array 4603. (N.B. the weighting parameters are
totally arbitrary!)
Note the use of comment lines commencing with a „*‟ (see 14.5.7).
0
4
1893
4013
0
8
1
* Linear combination of distance (X1) and time (X2)
0.01*X1 + 0.0023*X2
FUEL CONSUMPTION IN MILLILITRES
4603
0
16
0
0
2
0
0
Y
Note that once an appropriate “KEY file” has been set up it may be used as part of
a standard “macro” to automatically repeat the same function but with different
network files. For example, you may automatically extend any .ufs network file
using FUEL.KEY with a standard procedural call such as:
which will extend NET.UFS to include fuel consumption in file NETX.UFS. The
terminal output responses would be stored in SCRATCH.VDU. (Although you
probably never need to look at this file; it is only there to make the procedure fully
“batch”.)
The procedure could be further implemented within a DOS batch (.bat) file called
by, e.g.:
which, at its very simplest, might consist of the single line file DBFUEL.BAT
Key files may contain “choices” which have been originally input in a variety of
different “formats” (as described in Section 19) including:
“pure” mouse input (i.e., point and click on a particular point on the screen);
etc. etc.
All of these appear within the log/key files in differing formats, the exact details of
which need not concern the casual user. Their primary purpose is to indicate to
the program which is “reading” the key file the precise form of the input command.
Note, however, that .log files generally do not include any inputs made within
“external Windows” operations. For example, within P1X network editing it is
possible at certain stages to request “screen editing” to edit segments of text. The
request to enter Screen Editing would be recorded in the .log file but any changes
made to the text under screen edit itself are Windows operations and will not be
recorded in the .log file. Similarly if you ask to print a file any options selected
within the standard Windows Print window are not recorded in the .log file. It is
therefore recommended that such Windows-based operations should be avoided
if the intention is to re-use the inputs as a key file. See Section 14.5.9 for further
information.
An example of a log file generated by a run of P1X which uses several different
forms of inputs, as well as comments, is given below:
Thus the first choice made by the user was the line “Display menu” in the P1X
banner. 1056 and 90 indicate the precise pixel coordinates of the mouse when the
left hand button was clicked, 68 represents the ascii value of the character D (the
single highlighted character in that line), 0 gives a “status” (which is a bit too
complicated to explain and you don‟t really need to know about it!) while “Display
menu” was the text in the selected banner line. Of these the only vital piece of
information is the ascii code 68 which is used by the program to “branch”
correctly.
Thus if you were to use this command line to run a job on a different computer
with a different screen resolution the pixel coordinates of the Display menu line
might be quite different – the critical thing is that a banner line with a highlighted
character whose ascii code was 68 (i.e., D) was selected.
The line “5 - Demand Flow Downstream” simply indicates that the 5th line from a
window containing various options was selected and that the text in that line was
as indicated. Again the vital piece of information is the 5.
The two lines following &Box indicate the precise pixel coordinates used to define
the position of the box (i.e., format (e) above). Problems may occur here if the job
is re-run on a machine with a different screen resolution and/or a different window
since, in that case, the pixel position (376,440) may point to a different position in
the network as displayed. They may however be used relatively reliably by using
full screen windows to create the log/key file and re-running on an identical
machine.
Note further down that, following the entry “SATDB Opts” where the input mode
becomes keyboard-based, the key file resembles that described in 14.5.2.
However, when within SATDB the user chose option 15, display to the terminal,
the commands “down” and “quit” were entered via the menu bar.
Running jobs with key files such as the one above is identical to running jobs with
“simple” key files as regards keyboard inputs (i.e., just hit <return>) but when a
mouse input is required the user must either click the left hand mouse button to
continue or, if a small window appears with the next instruction displayed, close
that window. On the other hand, if the VDU option is invoked, then the job will run
automatically without any user intervention.
(N,B. A very useful alternative to clicking the mouse in order to close the window
at each stage of a graphical routine is to use Alt-F4!)Creating standard “batch-
style” macros such as DBFUEL described in 14.5.2 becomes more difficult,
though not impossible, with mouse-based inputs. Thus a key file based on
SATDB is likely to be more reliable than one based on P1X.
As a variation on the use of the KEY facility described above to run interactive
programs whereby the user needs to hit <return> in order to advance the program
from one (dummy) input command to the next, it is possible to run the same
programs under an “auto-timer” option such that the program pauses for a fixed
number of seconds each time an input is required before reading the input and
carrying on. Thus the program runs on the screen “unattended” so that this facility
is essentially intended to run demonstrations of SATURN programs.
1) Type in the appropriate command line with a KEY file but ...
2) without any VDU request (otherwise the program will run in a “background”
mode) and ...
Thus the demonstration KEY file listed in 14.5.2 would need to start:
AUTO 10
0
4
1893
etc.
It is possible to transfer from the “batch mode” using a KEY file to “interactive
mode” by including a “break command” within the KEY file. Thus you may
continue a previous run, for example using the first run (i.e. the KEY file) to set up
various standard default options in a similar fashion to a preferences file (15.2).
2) By the single character “b” or “B” in the first line in a KEY file which contains
the response “Y” to the question do you wish to terminate.
To use a key file “setup.key” such as the above to “initiate” a run of, say, SATDB
one could use a command line such as:
It is possible to change the length of the „automatic pause‟ under the KEY option
by including one or more further „AUTO‟ records within the KEY file. For example
the following file starts with an automatic delay of 10 seconds but switches to 5
seconds after the input „4033‟:
AUTO 10
0
4
1893
4003
AUTO 5
0
...
Note that a record of the form „AUTO 0‟ or simply „AUTO‟ cancels the automatic
delay and returns you to the normal KEY mode whereby the program pauses with
each input until a key is depressed.
In addition it is also possible to revert from the automatic to the normal KEY mode
by depressing the key „Q‟ (or „q‟). This can be done „on the spur of the moment‟
from the terminal as opposed to inserting an „AUTO 0‟ record in the KEY file which
must be done in advance.
Finally it is possible to change from the VDU mode (terminal output to a fil) to the
normal terminal output to the screen mode by including a record VDU‟ in the KEY
file; e.g.:
0
4
1893
4013
0
VDU
8
1
0.01*X1 + 0.0023*X2
FUEL CONSUMPTION IN MILLILITRES
4603
0
16
...
Thus in the above example the „terminal‟ output would be initially directed to a file,
and thus be „invisible‟ to the user, but would revert to the terminal part way
through. Use this option to skip over the „boring‟ parts of a demonstration run.
Equally you can switch from terminal output back to file output by a VDU record
which is therefore a „toggle‟ between the two modes. Note however that this
facility can only be used if you start with a VDU external file.
Comment records are indicated in KEY files by records with a „*‟ in the first column
as illustrated below. When these are met by programs taking their input from a
key file they are copied verbatim to the screen until a “non-comment” record is
read.
.......
1
*
* Linear combination of distance (X1) and time (X2)
*
0.01*X1 + 0.0023*X2
FUEL CONSUMPTION IN MILLILITRES
4603
0
.........
Comments may either be inserted in a key file AFTER it has been produced by an
interactive run (i.e., into the LOG file) or else they may be directly included in the
log file by typing in records commencing with a „*‟. Thus in the above example the
line „0.01*X1 ...‟ is an equation which is required by the previous menu response
of 1; if the user had typed: *<enter>, * Linear .. <enter>, *<enter>, 0.01 .. <enter>
the log file would have appeared as above.
Comments are very useful for indicating the reason for the line following and are
often used within key files which are used as tutorials to demonstrate particular
features of SATURN programs since they appear directly on the screen. They are
also very useful in key files which are used within standard “macros”, just in case
later versions of SATURN have a different sequence of input commands (they
always do!) and old key files no longer work.
A simple key-file option is provided under program bat files for PIX, SATDB,
SATLOOK, SATED and MX to repeat the immediately preceding run of that
program via a special keyword “AGAIN”. Thus the sequence:
SATDB net1
runs SATDB on net2.ufs using the same sequence of commands as for net1. It
does this by copying the .log file from the first run into a temporary .key file (the
actual filename used is again.key but the user need not take any notice of this)
and using this as a normal “KEY file” in the second run. It is therefore equivalent
to:
SATDB net1
User inputs within SATURN may be sub-divided into “internally controlled” and
“externally controlled” operations, whereby externally controlled inputs occur, for
example, when a Windows edit box or a screen edit window (see 19.9) is created
and control is effectively passed to a Windows operation in order to change the
values set for certain variables and/or text.
The problem that externally controlled processes create for LOG files is that it is
no longer possible for SATURN programs to “know” exactly which keyboard and
mouse inputs have been invoked by the user and therefore it is not possible to
record the exact sequence within a LOG file as with “internally controlled” inputs.
On the other hand, and in principle, it is possible to compare the data that was
passed to the external process and returned in order “to infer” the inputs. Thus,
when possible, SATURN creates an entry in a log file containing the text “ Edit
Box:” in columns 1 to 10 followed by a stream of data values detailing the outputs.
For example, if an edit box is created to set values for 5 separate variables (e.g.,
saturation flow, lane choices etc. for a turn under node editing) then the returned
values of those 5 variables may be listed in the LOG file.
When a KEY file process encounters an Edit Box record it may then read the
following inputs and proceed accordingly.
Note that this option is not generally available with screen editing operations
where the data passed is generally much longer than can be stored on a single
record.
Programs which are run using KEY files (and equally the original interactive
program run that created the LOG/KEY file) very often open files interactively and
this may create certain problems as described next. N.B. These problems have
been largely eliminated from release 10.6.16 onwards.
For example, if the original program creates an output file “jim.dat” whose name is
set interactively (i.e., via a Windows dialog box) then the name of that file will
appear as a separate line within the LOG – and therefore the KEY – file. If jim.dat
were an existing file in the first place then the user would have been prompted
with the query “Do you wish to over-write jim.dat?”, to which the answer would
have been presumably Yes and the next line in the LOG/KEY file would be Y to
record that response. Thus the appropriate segment of the .log file might have
read:
0
jim.dat
y
0
On the other hand if the file jim.dat did not exist then the query to over-write would
not have existed and the LOG/KEY file would read:
0
jim.dat
0
Let us call the two alternative versions A and B respectively.
The first potential problem occurs if, at the time that the KEY file procedure is run,
the file jim.dat does not exist and version A above is being used in the key file. In
this situation the query about over-writing would not be relevant, the line
containing Y would not be needed and the “correct” version of the key file would
be B.
The second problem occurs in the reverse situation: jim.dat exists but Version B
(without the Y line) is incorrectly used as the KEY file. (Indeed it is this situation
which occurs most frequently when a new output file jim.dat is created in the initial
run and still exists when the KEY file run is executed, )
In older versions of SATURN the end effect was the same in both cases: the
program crashed.
2) (N.B. The latter case above assumes that the desired response is always Y,
over-write the file, although clearly a N reply (do not over-write, choose
another file) is also possible. However, it is somewhat “sloppy procedure” to
have a key file which defines the “wrong” file as implied by an N. Hence the
assumption is always that if a Y/N line is not provided then the desired
answer should be Y.)
The first is to ensure that the “status” of all files prior to a KEY run is identical
to that prior to the original run. This could involve deleting any existing files
which are due to be created as new files.
Within certain programs and their associated bat files it is possible to include
namelist parameter definitions as the final entries on the command line. For
example:
runs SATALL on the file net.ufn but over-rides the existing value of GONZO to
1.2. The effect is the same as:
&PARAM
GONZO = 1.2
&END
However for one-off parameter changes it is much easier to include the change on
the command line than to create a new control file.
Note that due to a quirk of DOS it is not possible to include equal signs on the
command lines; “GONZO = 1.2” is treated as “GONZO 1.2 1.2”. However since
namelist input does not require “=” (see Appendix A) this is not a problem.
The facility is at the moment provided only for the following programs and only for
namelist &PARAM although it may well be extended later:
It cannot be used with “composite” bat files such as SATURN which call a further
series of individual bat files, and it cannot be used with interactive programs such
as PIX or SATDB.
The end result is very similar to using a key file, the main difference being that the
sequence of choices is not user-set but fixed. This is useful for certain “standard”
options such as matrix building. It has the further advantage that it does not use
key files which may become invalid with newer versions of SATURN.
The facility may be further extended and simplified (from the user‟s point of view)
by creating standard “Batch Procedures” so that, for example, to dump a matrix
.UFM file TIJ.UFM into a CSV ascii formatted file (see 10.20.15) the user could
either type in directly:
UFM2CSV TIJ
where DUMP5 above is a special keyword which implies “dump into CSV format”.
The batch file UFM2CSV.BAT simply re-creates the previous command line in
order to run the program MX to carry out the same function.
would open a text (ascii) file list.xcl and concatenate its contents to the right of
“mat1”. Thus, if list.xcl contained a single line:
Alternatively a .XCL file may contain several lines (records) so that, for example,
the file list.xcl illustrated above might also be written:
Mat2
Mat3
OUT matnew
There is no limit to the number of words which may be contained within a .XCL file
nor, therefore, to the number of words on the combined Command Line.
Currently the .XCL option is only available with MX (where it is most likely to be
needed) but, in principle, it could be used with any SATURN batch file. Requests
to DVV for alternative applications.
Note that whenever XCL + filename are read on a command line then the
processing transfers to the new file immediately; i.e., any further tokens on the
original command line are ignored. Therefore any additional tokens should be
included within the continuation record(s).
However, one of the problems with terminal windows is that they tend to “grab
focus”. Thus if, say, a user has set up a batch file to run a long sequence of
SATURN programs “in the background” and they wish to do something in Word
while the SATURN programs are running, each time a new program starts and a
new terminal window is created the user will have to minimise that window before
they can continue with Word. Not fatal but mildly annoying!
Note that this problem does not occur when interactive programs such as
SATLOOK are run with KEY + VDU modes in force since, in that case, no
terminal windows are set up.
If a command line contains the keyword “QUICK” this signifies that the program is
to be run with the minimum number of iterations, loops, etc. etc. so that it runs
with minimal cpu time. For example (and indeed this is virtually the only example),
if a SATALL command line contains QUICK then MASL is set to 1, NITA and
NITA_M to 3, NITA_S to 2 and NITS and NITS_M to 5.
The basic objective of using QUICK is to test whether or not complicated batch
files which call a large number of programs and need to pass files between them
have been correctly set up before leaving them to run, say, over the weekend.
Batch files – or .bat files to use their standard extension – are files which
individual SATURN users may create to run one or more SATURN .exe files
and/or other procedures. As such they may save considerable time and effort, in
particular for standard operations which are repeated multiple times, e.g. with
different networks and/or matrices each time. This is available through the DOS
Command Shell in SATWIN (see Section 3.6 et al)
Under 16-bit .bat files operated within the standard dos operating system; with 32-
bit they operate under Command Prompt. The latter appears to lack some of the
functionality of dos but, for simple operations, it is difficult to spot the differences.
As an example, to update a trip matrix file using SATME2 may require running
three programs in succession by commands such as:
where SATALL, SATPIJA and SATME2 are themselves .bat files which call the
equivalent .exe files.
The above three commands may themselves be subsumed into a single .bat file,
say UPME2 .bat, which could be written as:
CALL SATALL %1 %2
CALL SAPIJA %2 %3
CALL SATME2 %4 %3 PRIOR
so that typing:
would have the same effect as the original three commands. Note the use of %1,
%2 etc within the bat file to represent the successive arguments on the command
line; at execution net1 would be substituted for %1 in the call to SATALL etc
Note that .bat files may themselves call other .bat files (but see below for
problems under 32-bit windows) which themselves call other .bat files to produce
a hierarchical structure.
Calls to standard dos functions may also be included, for example one file may be
copied into another so that UPME2 above might include a final line.
in order to save the “latest” trip matrix file with a standard name. Equally
temporary files may be deleted etc.
.Bat files may also include certain error checks and internal logic. For example
one may check whether or not an essential input file exists and take the
appropriate action if not, or the “convergence status” of a particular operation
monitored in order to terminate at the required level. Dos manuals may be
consulted for further information.
Within Windows, and Command Prompt, one particular problem arises which is
that Windows does not (apparently) wait for one program to terminate before
starting the next. Thus, in the above example, SATPIJA may begin before
SATALL has finished and therefore before the necessary file net1.ufs has been
created. A solution to this problem involves 2 “tricks”,
Start/W $SATALL %1 %2
Start/W $SATPIJA %2 %3
Start/W $SATME2 %4 %3 PRIOR %2
Empirically this guarantees that SATPIJA will only be initiated once SATALL has
terminated and all necessary files are available. For an example please look at
SATURN.bat.
There may of course be other “tricks” available within Windows to accomplish the
same ends. We only report what works for us!