1. Home
  2. GenBatch Program

GenBatch Program

The GenBatch program is designed for running Genstat batch jobs, taking input from a program file and generating output to a text file. It is similar in function to the Submit File menu, but does not require the Genstat Windows interface to be running. Instead, it is designed to be used from the command line in a DOS box (Command Prompt) and is also suitable for invocation from other programs. See the notes below regarding setting up your environment so that you can access GenBatch.

Command line parameters

In addition to the Windows-specific parameters described below, all the command line parameters familiar to users of the DOS version of Genstat can be used with GenBatch. These are as follows:

IN, OUT Primary input and output files
IN2, OUT2, IN3, OUT3, IN4, OUT4, OUT5 Secondary input and output files
BS1, BS2, BS3, BS4, BS5, BS6 Backingstore binary files
UF1, UF2, UF3, UF4 Unformatted binary files
PL1, PL2, PL3 Personal procedure libraries
S Initial data space allocation (for all modes)
SR Initial real data space allocation: for numerical structures
SI Initial integer data space allocation: for factors
SC Initial character data space allocation: for text structures
D Default graphics device
GR Default graphics file
P Priority of process. A number between 1 (very low) and 5 (very high). Note that setting this to very high (5) may interfere with other operations on the PC. Default is 1 (Low)

For example: GenBatch A.GEN A.OUT IN2=A.DAT

If not specified, the initial data space settings are taken from the current Genstat settings, and are the values given in the Tools | Options | Data Space tab. If a particular batch run requires especially large (or small) amounts of data space this can be overridden by setting one or more of SR, SI or SC as required. These parameters specify the initial allocation for each mode of data. The S parameter sets a value for all three. See Options – Data Space for further details.

Note: You cannot produce an ‘interactive’ run of the Genstat Server by omitting the input and output file parameters.

Output file format parameter

The output files can be written to different formats including plain text, rich text format (RTF), HTML and LaTex. By default, the output is written in plain text, however, you specify another output file format by appending the following characters to the output file name:

/r Rich Text Format (RTF)
/l LaTex

Clipboard parameter

GenBatch can be used in conjunction with other programs, exchanging data via the clipboard. The command line parameter /C will cause GenBatch to read its input from the Clipboard, and on termination replace the Clipboard contents with the Genstat output. The Genstat command line will be interpreted as usual, except that the first two parameters (primary input and output) should not be used. For example,

    GenBatch /C in2=data.dat

will run the program in the Clipboard, opening data.dat on channel 2. Any parameters preceding /C will be ignored.

The lower case equivalent /c may also be used.

Directory parameter

The working directory for Genstat can be specified using the /D command-line parameter. This can be specified anywhere on the command line, but should follow /C if that is also used. For example:

      GenBatch ape.gen ape.out /d=C:primates

Any files that are specified on the command line will be assumed to be in the directory specified with /D, unless full pathnames are given. Filenames specified within Genstat programs, in OPEN statements, will be interpreted similarly. The %CD directive can be used to change the working directory at any point in the program.

Exit codes

0 Success
1 Warnings
2 Faults
3 Initialisation failure


There are two ways of accessing the GenBatch program, either using the full pathname (e.g. C:Program FilesGen17edBinGenBatch.exe), or by adding the Genstat Bin directory to the PATH variable, in which case the command name GenBatch will be recognised.

Either method can be used, both when you wish to run GenBatch from the command line or from another program using the CreateProcess function or equivalent.

Note that GenBatch.exe will not run if it is copied to another directory as it depends on many other files that form Genstat. Also, that it requires a valid license key.

Updated on March 12, 2019

Was this article helpful?