STOP Statement

<stop statement>

── STOP ─┬───────────────────────┬─────────────────────────────────────┤
         └─ <string expression> ─┘

Explanation

The STOP statement is used either to terminate a job or to terminate an asynchronous subroutine. The job or asynchronous subroutine is terminated normally if it has no asynchronous subtasks being executed at the time of the STOP; otherwise, the parent and its in use dependent subtasks are terminated abnormally. The in use dependent subtasks include tasks that are SCHEDULED, ACTIVE, or STOPPED. Refer to “Task State” under Boolean Expressions.

If a string expression is specified in the STOP statement, the value of the string expression (up to a maximum of 430 characters) is displayed prior to the STOP. The STOP statement accepts up to 1799 characters.

Example

The following is an example job that uses the STOP statement:

?BEGIN JOB STOP/EXAMPLE;
TASK T1,T2;
PROCESS COMPILE Y WITH PASCAL [T1] LIBRARY;
  COMPILER FILE CARD(KIND=DISK,TITLE=SYMB/Y,FAMILYNAME=MYDISK);
RUN Z [T2];
IF T2 ISNT COMPLETEDOK THEN
   STOP;               % The job will be terminated normally if the Pascal
                       % compile is finished; otherwise, it will be
                       % terminated abnormally.
WAIT(T1);
IF T1 IS COMPILEDOK THEN
   STOP "NORMAL JOB TERMINATION"  % Normal job termination after
                                  % the message is displayed.
ELSE ABORT "ABNORMAL JOB TERMINATION";
?END JOB.