:STOP

Use the :STOP script statement to cancel the processing of a script, with or without issuing an error message. :STOP cancels the activation of the object that contains the script and writes all open transactions to the AE database.

Important! Do not use :STOP on the Post Process page. To make changes via scripts on the Post Process page, use :MODIFY_STATE instead.

Note: For more information on transaction handling, see Script Processing.

Syntax

: STOP [Stop Mode]

Parameters

Parameter Description Allowed Values
Stop Mode
(Optional)
Defines whether to issue an error message when cancelling.
  • MSG, Error Number, Error Text — Cancels activation and issues an error message. Use error numbers between 50 and 59 only (reserved for users). Error number 50 uses return code 4; numbers 51–59 use return code 8. The error number and text are returned to objects started via the CallAPI. Tasks stopped with this mode appear as cancelled in the execution data.
  • NOMSG, Message Number[, Message Text] — Cancels activation without an error. The message number is required syntactically but not evaluated. An optional message text is stored in the execution data and sent via the CallAPI. Useful for script-only objects that do not require an agent.
  • No stop mode — Cancels processing and writes error message U0010014 to the activation report. A database rollback takes place: all uncommitted transactions are rolled back.

Examples

The following example activates a Job and returns an error message if the activation fails.

: SET &ACTNR# = ACTIVATE_UC_OBJECT (JOBS, MM)

: IF &ACTNR# = "0"

: STOP MSG, 50, "Error in activating the job MM."

: ELSE

: PRINT "The job MM was activated with the activation number &ACTNR#."

: ENDIF

See also: