──┬─ START ────┬─<file title>─┬──────────────────────────────────┬─────► └─ STARTJOB ─┘ └─ ( ──<start parameter list>── ) ─┘ ──┬─────────────────────────────┬─┬──────────────────┬─────────────────► └─ [ ──<task identifier>── ] ─┘ ├───────┬─ SYNTAX ─┘ └─ FOR ─┘ ──┬───────────────────────────────────────────────┬────────────────────┤ └─ ; ── STARTTIME ── = ─┬─<starttime spec>──────┤ └─ # ──<string primary>─┘
──┬─<named parameter list>────────────────────────────────────┬────────┤ └─<positional parameter list>─┬─────────────────────────────┤ └─ , ──<named parameter list>─┘
┌◄──────────────────────────── , ────────────────────────────┐ ──┴─┬─<real formal parameter>── := ──<real expression>───────┬─┴───────┤ ├─<integer formal parameter>── := ──<integer expression>─┤ ├─<Boolean formal parameter>── := ──<Boolean expression>─┤ └──<string formal parameter>── := ──<string expression>──┘
┌◄─────────── , ───────────┐ ──┴─┬──────────────────────┬─┴─────────────────────────────────────────┤ ├─<real expression>────┤ ├─<integer expression>─┤ ├─<Boolean expression>─┤ └─<String expression>──┘
Explanation
The START statement initiates a WFL job stored in a disk file. The file title specified is the title of the disk file containing the job that is to be initiated.
The started job inherits many of the attributes of the original job, including the values of the USERCODE and FAMILY task attributes.
The START statement first initiates a synchronous task to compile the job. The job is then inserted in a job queue and executes independently of the job that initiated it; it is not considered a task of the originating job.
When FOR SYNTAX is specified, it indicates that the job is to be compiled for syntax checking only and is not to be executed. In this case, it is not necessary to include a start parameter list in the START statement, even if the job being initiated includes a job parameter list. However, WFL does check that the parameters are of the correct type (real, Boolean, and so on) if they are supplied.
The START statement cannot include a STARTTIME specification if the job is to be started at another host through Host Services. Including a STARTTIME specification in the START statement results in an error for the started job and is detected before the job is transferred to the other host.
The STARTTIME = starttime spec form delays execution of the job until the specified time and date. However, job compilation occurs immediately, and the originating job then resumes execution at the next statement without waiting for the started job to begin.
The STARTTIME = starttime spec form in the START statement overrides any STARTTIME specification in the job attribute list of the job being started. Refer to STARTTIME Specification for the syntax of a STARTTIME specification.
The STARTTIME specification is the only job attribute that can be specified in the START statement. However, it is possible to pass job attribute values to the started job through the start parameter list if the started job was designed to accept such values.
Parameters
A start parameter list can be included in the START statement if the job being initiated includes a job parameter list. Actual parameters can be passed as positional parameters by listing them in positional order, or as named parameters by explicitly naming the corresponding formal parameters in the job parameter list. Named parameters can be given in any order.
An actual parameter need not be passed if the corresponding formal parameter specifies the keyword OPTIONAL. If an actual parameter is not passed, the default value will be assigned as follows:
Type |
Default Value |
---|---|
Boolean |
FALSE |
Integer |
0 |
Real |
0 |
String |
“ ” (two double quotation marks) |
A default value can also be assigned by using the DEFAULT clause for the corresponding formal parameter in the job being started.
When a positional parameter list is used, optional parameters can be omitted by specifying consecutive commas (,) or by specifying fewer actual parameters than formal parameters. When fewer parameters are passed than are expected by the job, all the remaining parameters in the job parameter list must be specified as optional.
Named parameters can be used in combination with positional parameters. The positional parameters are listed first, in their normal position, followed by the named parameters. Once a named parameter is used, the rest of the parameters must be named parameters.
Examples
The following is an example of a simple START statement:
START (SINGA)OBJECT/FIZZCOMP ON GCPACK;
The following examples show various START statements that can be used to start a job with a parameter list. The job being started has the following job heading:
?BEGIN JOB JOB/1(STRING CODEFILE, INTEGER JOBQUEUE OPTIONAL DEFAULT=3, BOOLEAN BIND OPTIONAL);
Using only positional parameters:
START JOB/1("OBJECT/P", 4, TRUE) START JOB/1("OBJECT/P") START JOB/1("OBJECT/P", , TRUE)
Using only named parameters:
START JOB/1(BIND := TRUE, CODEFILE := "OBJECT/P") START JOB/1(JOBQUEUE := 4, CODEFILE := "OBJECT/P", BIND := FALSE)
Using both positional and named parameters:
START JOB/1("OBJECT/P", BIND := FALSE) START JOB/1("OBJECT/P", BIND := FALSE, JOBQUEUE := 0)
The task identifier associates a task variable with the compilation of the specified job. (This task variable is not associated with the execution of the job.) The task state expression can then be used to inquire whether the compile was successful, as in the following job excerpt:
START TEST/WFLJOB [T]; IF T ISNT COMPILEDOK THEN ABORT "TEST/WFLJOB HAS SYNTAX ERRORS";
The following job compiles the job EX/1 and then runs the program OBJECT/BLAH. Execution of EX/1 begins 30 minutes after it is compiled, regardless of whether the job SR has already completed.
?BEGIN JOB SR; START EX/1; STARTTIME = + 00:30; RUN OBJECT/BLAH; ?END JOB.
In the following example, the value of the <starttime spec> is supplied through a string primary. The START statement schedules the job EX/2 to begin execution after 8:00 a.m. the day after the job EXAMPLE is started.
?BEGIN JOB EXAMPLE; INTEGER I := 8; START EX/2; STARTTIME = # (STRING(I,2) & ":00 ON +1"); ?END JOB.
The following job schedules the job EX/3 to begin execution after 2:00 a.m. each of the next five days after the job EXAMPLE is started:
?BEGIN JOB EXAMPLE; INTEGER I; I:=1; WHILE I LEQ 5 DO BEGIN START EX/3; STARTTIME = # ("2:00 ON +" & STRING(I,*)); I:=I+1; END; ?END JOB.
The following job uses the first two parameters passed to it to assign values to CLASS and CHARGECODE in the job attribute list. The third parameter is used to pass a file title for use in file equation.
?BEGIN JOB EXAMPLE (INTEGER CLASSP, STRING CHARGEP, STRING FILEP); CLASS = CLASSP; CHARGECODE=#CHARGEP; COMPILE OBJECT/#FILEP WITH ALGOL LIBRARY GO; COMPILER FILE CARD(KIND=DISK, TITLE=#FILEP); ?END JOB.
The following job starts the previous job six times with different parameter values:
?BEGIN JOB STARTERINTEGER I; I:=0; WHILE I LEQ 5 DO BEGIN START TEST/EXAMPLE(30,"CHARGE" & STRING(I,*), "TEST" & STRING(I,*)); I:=I+1; END; ?END JOB.