ESCAPE command

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

Syntax

ESCAPE <ALL> <IF test>

Parameters

Name Description
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