ESCAPE command

Modified on Thu, 21 Sep, 2023 at 11:27 AM

Terminates the script being processed, or all scripts, without exiting Analytics.

Note

To exit a script and also close Analytics, see QUIT command.

Syntax

ESCAPE <ALL> <IF test>

Parameters

NameDescription
ALL

optional

Terminates all active scripts. If omitted, the current script is terminated.

IF test

optional

A test that must evaluate to true before the command is executed. If the test evaluates to false the command does not run.

Examples

Terminating a script conditionally

You count the number of records in a table, and use the ESCAPE command to terminate the script if the number of records is less than 100:

COUNT
ESCAPE
IF COUNT1 < 100

Remarks

When to use ESCAPE

Use ESCAPE to halt the execution of a script or subscript based on a condition, or to stop the execution of all running scripts.

Using ESCAPE in subscripts

If you execute ESCAPE inside a subscript, then the subscript stops executing and the main script resumes processing from the DO SCRIPT command that invoked the subscript.

If you include the ALL option in the ESCAPE command in the subscript, then both the subscript and the main script stop processing:

ESCAPE ALL

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article