Retain

Use this procedure to identify DAL variables that should not be cleared between the processing of transactions.

Syntax

Retain (Variable)

Parameter

Description

Variable

Enter the names of the DAL variables (as a quoted string) you want to retain during the processing of transactions.

Keep in mind that certain features rely upon DAL variables living forever. This procedure lets you identify the DAL variables you do not want cleared during the processing of transactions.

This procedure is not required unless you have the FlushDALSymbols option set to Yes, as shown here:

< RunMode >
  FlushDALSymbols = Yes

The Retain procedure works in both the Documaker and Documaker Desktop environments and is necessary when you want certain variables to live for the entire session.

Note Declaring a variable to be retained does not affect the value you assign to the variable. The Retain procedure does not protect that variable’s value from being changed in subsequent scripts that are executed.

Once declared as retained, a variable cannot be later removed from the list.

Example

Here is an example:

$total_amt = Sum("$prem_");
  Retain ("$total_amt");

In this example, the DAL variable $total_amt will survive transaction boundaries and can be referenced in any subsequent transaction DAL script.

See also