Several task attributes and a special WFL expression are available for determining how a task terminated. The relevant WFL expression is the task state inquiry. This expression can be used to determine whether termination was normal or abnormal. For example, the following WFL statement causes a specified action to be taken if the task terminated abnormally:
IF TSK ISNT COMPLETEDOK THEN
Another way to determine whether a task terminated normally is to inspect the HISTORYTYPE task attribute. A HISTORYTYPE value of NORMALEOTV indicates that the termination was normal. A value of DSEDV indicates that termination was abnormal. Most of the other values indicate that the process has not yet terminated and give an indication of its current state.
If termination was abnormal, the HISTORYCAUSE task attribute can be interrogated to determine the general type of abnormal termination that occurred. For example, a value of OPERATORCAUSEV indicates that an operator command discontinued the process and a value of DCERRV means that the process was discontinued because of a data comm error.
A more detailed account of why a task terminated abnormally is stored in the HISTORYREASON task attribute. For example, suppose the HISTORYCAUSE value is RESOURCECAUSE, meaning that a resource limit was exceeded. The HISTORYREASON value might be PROCESSEXCEEDEDV, which means specifically that the processor time limit was exceeded.
The system uses the HISTORYTYPE and HISTORYCAUSE values to determine what termination message to display for a process. The correspondence between these task attributes and the termination messages is shown in Table 10–1.

