A complete WFL job is considered a block, and each subroutine declared in the job is a block as well. The WFL job can enter or initiate subroutines. WFL automatically protects against critical block exits by performing an implicit wait at the end of the block that contains a task initiation statement. Control does not exit this block until all tasks initiated in that block have terminated.
WFL includes CASE, DO UNTIL, GO, IF, and WHILE DO statements that you can use to direct the flow of control in a job. By using these statements together with task attribute interrogations, a WFL job can provide conditional control over tasks. For example, the job can initiate the SYSTEM/PATCH utility as a task. When SYSTEM/PATCH terminates, the job can interrogate the task attributes of the SYSTEM/PATCH task. If the attribute values indicate that SYSTEM/PATCH ran without errors, the job can compile the merged source program. If the compilation is free of errors, the job can run SYSTEM/XREFANALYZER to produce an analysis of cross-references in the program.

