1. Home
  2. JOB directive

JOB directive

Starts a Genstat job.


INPRINT = string tokens Printing of input as in PRINT option of INPUT (statements, macros, procedures, unchanged); default unch
OUTPRINT = string tokens Additions to output as in PRINT option of OUTPUT (dots, page, unchanged); default unch
DIAGNOSTIC = string tokens Defines the least serious class of Genstat diagnostic which should still be generated (messages, warnings, faults, extra, unchanged); default unch
ERRORS = scalar Limit on number of error diagnostics that may occur before the job is abandoned; default * i.e. no change
PROMPT = text Characters to be printed for the input prompt
WORDLENGTH = string token Length of word (8 or 32 characters) to check in identifiers, directives, options, parameters and procedures (long, short); default * i.e. no change


    text Name to identify the job


The JOB and ENDJOB directives can be used to partition a Genstat program into separate jobs. A job is a self-contained subsection of a program. All data structures and procedures are lost at the end of each job. Any setting defined by a UNITS statement is deleted, as are the special structures set up by analyses like regression and analysis of variance. The graphics environment is also reset to the initial default. Thus, in many ways, it is as though Genstat was starting again for each new job. However, any files that have been attached to Genstat retain their current status from job to job. So, for example, Genstat will continue to add output to the end of an output file, or will continue reading from the current point of an input file.

The JOB directive is used to start a new job. It has a parameter which can be set to a text to identify the job (for example in the message at the end of the job), and options to control some aspects of the Genstat “environment”. However, Genstat will automatically start a job at the beginning of a program, or after an ENDJOB statement, so you do not need to give a JOB statement unless you wish to define an identifying text or to modify the environment.

JOB also has options that allow you to modify some aspects of the Genstat environment. The default settings of the options will leave these aspects unchanged so, if any aspect is modified, it will remain in that form (unless modified again) in any subsequent job. All these aspects have initial defaults, described below, that apply at the outset of a program. However, it is possible to arrange for Genstat to run commands from a start-up file before it executes the first statement of a program, so the initial environment can differ from machine to machine.

The INPRINT option specifies which pieces of input from the current input channel will be recorded in the current output file. (The current input channel may be a file or, in an interactive run, it may also be the keyboard.) The settings correspond to three types of input:

    statements statements that are typed explicitly on the keyboard or which occur explicitly in an input file,
    macros statements or parts of statements that have been supplied in macros, using the ## notation (1.9.2), and
    procedures statements occurring within procedures.

The initial default is to record only statements for input from a file, or to record nothing if input is from the keyboard. The recording of input can be modified also by the INPRINT option of the SET directive, or by the PRINT option of INPUT.

The OUTPRINT option controls the way in which the output from many Genstat directives will start: page ensures that output to a file will start at the head of a page, and dots produces a line of dots beginning with the line number of the statement that has generated the analysis. The initial default is to give a new page and a line of dots if output is to a file, but neither if output is to the screen. This can be modified also by the OUTPRINT option of the SET directive, or by the PRINT option of OUTPUT.

The DIAGNOSTICS option controls the reporting of errors and possible mistakes. In order of increasing seriousness there three classes of diagnostic: messages, warnings and faults. Messages are comments that are made to draw your attention to things that might need closer investigation, like large residuals in an analysis of variance or a regression. Warnings are definite errors, but ones that are not sufficiently serious to prevent Genstat from continuing; an example would be an attempt to print a data structure with no values. Faults are the most serious type of error. A fault in a batch run will cause Genstat to stop executing the current job. However, Genstat will continue to read and interpret the statements so that it can find the start of the next job (if any); at the same time it will report any further errors that it finds, up to the number specified by the ERRORS option.

The setting of DIAGNOSTICS indicates the level of stringency to be adopted. Thus, if DIAGNOSTICS=warnings, Genstat will report faults and warnings (but not messages), while DIAGNOSTICS=messages ensures that all three classes are reported. The setting extra is similar to messages but will also generate a dump of system information after any fault. You can prevent the output of any diagnostics by putting DIAGNOSTICS=*. The initial default is to set DIAGNOSTICS=messages.

The WORDLENGTH parameter controls the number of characters that are stored and checked in identifiers and names of directives, procedures, options, parameters and functions. In releases prior to 4.2 this was always eight, but from 4.2 onwards you can choose between eight (WORDLENGTH=short) and 32 (WORDLENGTH=long). The initial default is long.


Parameter: unnamed.

See also

Directives: ENDJOB, STOP.

Commands for: Program control.


" Example 1:5-1-2 "
JOB 'Example of ENDJOB message'
PRINT 'This job just prints this message.'
Updated on March 7, 2019

Was this article helpful?