Using Variables in EnterpriseSCHEDULE
The purpose of a variable is to allow job switching and wait state controls that go beyond the traditional prerequisites and initiates. Variables are evaluated or set at the time the job is submitted. They can be used to determine job switching in resource statements, set in a resource (or end action) statement, or inserted anywhere in a command list using preprocessor syntax of enclosed double parentheses.
There are four types of variables in EnterpriseSCHEDULE.
- String variables: Any alphanumeric string can be used as a variable.
- Temporary variables: Temporary variables only hold value for the duration of the job run. They include time settings, job parameters and job information. Temporary variables begin with a $.
- Variable Expressions: EnterpriseSCHEDULE supports a rich set of enhanced variable expressions that feature simple or complex math expressions, date expressions and string expressions. This extends the power of variables and allows for run time calculation of dates and other values.
- Job Variables: Job variables are stored within a job and are accessible only within that job unless they are explicitly included in other jobs. For more, see Job Variables.
There are several places where variables can be accessed in a job:
- Resource or End Actions: Used in a resource statement, variables can be compared with each other or with a constant to determine job switching or set using the set command
- Command Lists: Using the preprocessing syntax of enclosed double quotes (e.g. (( Myvar )) ), the variables value can be placed anywhere in a command list. This is especially useful for inserting date expressions that can change depending on when the job is submitted.
- Notices text: Using the preprocessing syntax of enclosed double quotes, the variables value can be placed anywhere in a notices list. This is especially useful for inserting date expressions that can change depending on when the job is submitted.
A variable's value is stored in the database where it can be accessed or modified with the SET command when a job's resources or end actions are evaluated. Variables can also be created or modified on the command line or in the EnterpriseSCHEDULE Windows Client. EnterpriseSCHEDULE supports a rich set of enhanced variable expressions that feature simple and complex math expressions, date expressions and string expressions. This extends the power of variables and allows for run time calculation of dates and other values. In the EnterpriseSCHEDULE Windows Client, variables may be edited in the Layout or the Explorer. The edit screen for the properties of String variable is shown below:
