:STOP

Use the :STOP script statement to cancel the processing of a script. The script statement lets you cancel the script with or without issuing an error message.

Important! :STOP cancels the activation of the object that contains the script. Do not use :STOP on the Post Process page.

Note: This script statement causes all open transactions of the script to be written to the AE database. For more information, see Script Processing.

Tip: To effect changes via scripts on the Post Process page, use the :MODIFY_STATE script statement.

Syntax

:STOP[Stop Mode]

Parameters

  • :STOP
    Cancels the processing of the script

  • Stop Mode
    (Optional) Defines whether or not to issue an error message
    Allowed values:

    • MSG, Error Number, Error Text
      Cancels the activation of the object and issues an error message
      Important!

      •  Use error numbers between 50 and 59 only. This range is reserved for users. Other error numbers will cause the script to abort with an error message.
      •  Return code 4 is used for the error number 50 and return code 8 for the numbers ranging from 51 to 59.
      Notes:
      • Specifying an error number and error message is important for objects that start via the AE CallAPI. The returned information is the only information about the script execution.
      • Tasks that you stop with this mode are listed in the execution data as canceled tasks.

    • NOMSG, Message Number[, Message Text]
      Cancels the activation of the object without an error
      Notes:

      • The message number is syntactically necessary, but is not evaluated.
      • Optionally enter a message text. The text is stored in the execution data, and is sent as part of the confirmation when a call is made via the CallAPI.
      • This mode can be used in objects which do not require an agent for processing. You can work with script statements only, such as to set variables.

    • No stop mode
      If you do not specify a stop mode parameter, :STOP cancels the processing of the script and writes the error message U0010014 in the activation report.
      Notes:

      • A database rollback takes place. All transactions that are not specifically executed are rolled back.
      • Variables used in the beginning of the script may already have new values, while scripts at the end of the script have not received values.

Example

The following example returns an error message that informs you whether a job was correctly activated or not.

: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: