Variables

There are two types of variables you can reference in scripts:

Script variables

All script variables are of type string. A variable name is preceded by a % character. Use the equal sign to create and assign variables. For example, the following line creates and initializes the variable myvariable:

%myvariable = "data";

Available in receive or send scripts

The following read-only reserved variables are available in receive or send scripts.

Variable

Description

%EXEC

The value returned from the last local command. See Local Command .

%TMPDIR

The path of a temporary directory at the local site (the machine where Activator is installed). Temporary files can be stored in this directory.

%FTPSTATUS

There are two cases:

For the LIST statement: If the NLIST command was executed, %FTPSTATUS is set to the reply code from the NLIST command; otherwise, it is set to the reply code from the last (or only) command executed.

For statements other than the LIST statement: %FTPSTATUS is set to the reply code from the last (or only) command executed.

If a script is executed locally, Activator simulates execution of FTP commands and sets the variable accordingly.

Available in send scripts only

The following read-only reserved variables are available in send scripts only.

Variable

Description

%LOCALFILE

Activator saves a copy of the message being processed to a file at the local site and sets the variable to the path and file name of this file.

%REMOTEFILE

Activator generates a unique name for the message being processed and sets the variable to this name. The name is the transfer ID of the message. Because the name is unique within Activator, it provides a way of generating unique file names.

%LOGID

Activator sets this variable to the transfer ID of the message being processed. In the message log, you can use the transfer ID to identify the log entry. There is precisely one associated with the message.

Environment variables

For a local host, a script can reference Activator environment variables. A reference has the format:

$variablename

where variablename is the name of the environment variable. For example, the following line references the environment variable:

Related Links