The following example illustrates some WFL capabilities for task initiation and control:
?BEGIN JOB AUTOPB/HELP(STRING SOURCE, STRING PATCH);
JOBSUMMARY = SUPPRESSED;
DISPLAYONLYTOMCS = TRUE;
CLASS = 15;
TASK T;
STRING RUN1, HELPTITLE;
HELPTITLE:= (PATCH & “/LEVEL1/HELPBOOK”);
RUN1:= (“SOURCE=“ & SOURCE
& “,PATCH=“ & PATCH
& “,OUT=“ & PATCH & “/LEVEL1/ED”
& “,HELP=“ & HELPTITLE
& “,MESSAGEFILE=“ & PATCH & “/LEVEL1/MESSAGES”);
DISPLAY “RUNNING AUTOPB WITH “ & RUN1;
RUN OBJECT/AUTOPB ON DOCMAST(RUN1) [T];
FILE TEACHUTILNAME=*SYSTEM/HELP/UTILITY ON DOCMAST;
IF T(TASKVALUE) NEQ 1
THEN BEGIN
DISPLAY “HELPBOOK NOT CREATED; PRINTING ERRORS FILE”;
RUN *OBJECT/AUTOLP ON DOCMAST;
TASKVALUE = 1;
FILE SOURCE = #PATCH/LEVEL1/MESSAGES;
END;
?END JOBThe main point of this job is to run a program called AUTOPB. The AUTOPB program accepts two input files, SOURCE and PATCH, and produces three output files, OUT, HELP, and MESSAGEFILE.
The job accepts two string parameters that provide the titles of the SOURCE and PATCH files. Using these, the job constructs an elaborate string parameter to pass to AUTOPB. This string parameter defines the titles for all the input and output files.
AUTOPB sets its own TASKVALUE to 1 unless it finds errors in the input files. The job inspects the TASKVALUE after AUTOPB terminates and prints out the MESSAGEFILE if there are errors.

