Programmatic Tasking

You can perform tasking functions using any of the following programming languages: ALGOL, C, COBOL74, COBOL85, and WFL. This guide provides details about the tasking capabilities of ALGOL, WFL, and both versions of COBOL.

Each of these languages provides you with the following types of tasking capabilities:

  • Statements that allow you to initiate any object code file by name. Examples are the CALL, PROCESS, and RUN statements in ALGOL and COBOL.

  • Constructs for reading and assigning the task attributes of a process before the process is initiated, while it is running, and after it completes execution.

The tasking capabilities of each of these languages are described in Tasking from Programming Languages.

At this point you might be aware of the potential for some ambiguity in the use of task attributes within programs. For example, every process has a USERCODE task attribute. If you write a program that makes an assignment to the USERCODE task attribute, how does the system know which process the USERCODE should be applied to?

The answer is that ALGOL, COBOL, and WFL all provide a special type of variable called a task variable. A task variable is also known as a control point in COBOL. You can declare one or more task variables in a program, each with a distinct name. When you use a process initiation statement, you include a reference to a task variable in that statement. The task variable thereafter becomes associated with the new process.

Statements that use task attributes always specify a task variable name as well as a task attribute name. In this way, it is always clear which process is being referred to.

When one process initiates another process, many of the task attributes of the initiating process are transferred to the new process. This transference is called inheritance. Details about the task attributes that are inherited, and under what circumstances they are inherited, are given in this guide.