In MaxL and MDX scripts, you can use variables as placeholders for any data that is subject to change or that you reference frequently; for example, computer names, user names, and passwords. Using variables eliminates the need to create customized scripts for each user, database, or host.
Variables can be environment variables (for example, $ARBORPATH, which references the directory in which Essbase is installed) or positional parameters (for example, $1, $2). In a script, a variable always begins with a $ (dollar sign).
Before executing a script or individual statement that contains variables, you need to define each variable in MaxL Script Editor or MDX Script Editor. Variable definitions remain intact until you close the editor window. Variables are not saved, so you need to define variables each time you need them for a script. You can update variable definitions as necessary.
To define variables in MaxL Script Editor or MDX Script Editor:
Right-click and select Set variables.
In the Script Variables dialog box, click New.
Enter the variable and the value of the variable, and press Enter.
You do not need to include the dollar sign ($) in the variable definition. For example, a variable such as ARBORPATH and a value such as EPM_ORACLE_HOME\products\Essbase\EssbaseClient is acceptable.
To update a variable, click in the appropriate Value field, and update the value.
Following the steps above, continue defining all variables used in the script.
To delete a variable, select the row containing the variable, and click Delete.
Click OK to save the variable definitions and close the dialog box.
To see the variable definitions in the script, expand the script.
To ensure that you are prompted to define undefined variables when you execute a script, see Resolving Undefined Variables.