Job Variables allow you to easily use changeable values in the configuration and execution of your jobs. Job Variables are similar in concept and usage to Windows environment variable: you create a variable, giving it a name and a value. You can then insert the variable (by referencing its name) in various places within adTempus (such as the command line for a program to be executed). When adTempus runs the job, it replaces the reference to the variable with the variable's current value.
For example, supposed you have a job with 8 steps. Each of those steps runs a program that requires as a command-line parameter the name of the folder from which it should read data files. All of the steps use the same folder, which is usually "c:\clientdata\inputfiles". However, occasionally you need to do a special run of this job, reading data from a different folder. Without Job Variables, such a change would require you to edit all 8 steps to change the command-line parameters to point to the new location.
With Job Variables, you can create a variable for the job (on the Variables page of the job's properties) named "DataPath" and set the variable to "c:\clientdata\inputfiles". In each Job Step, instead of putting the path "c:\clientdata\inputfiles" in the command-line parameters, you put a reference to the job variable, using this syntax:
%DataPath%
When the job runs, adTempus will replace "%DataPath%" with the current value of the "DataPath" Job Variable.
Now when you need to do a special run using a different path you can simply change the value of the "DataPath" variable in one place (in the job's properties) and the new value will be used throughout the job. And if you run the job manually, you can override the "DataPath" variable at runtime without even modifying the job (using the Variables page of the Execute Job window).
Job Variables may be defined at many levels within adTempus: Server, Job Group and Job Queue, Job, and Step. Variables set at a level are inherited by all objects at a lower level: variables set at the Server level are inherited by all Groups and Queues on that server, variables set for a Group are inherited by all Groups and Jobs within that Group, etc.
Inherited Variables can be overridden to change their values. In the previous example the "DataPath" variable was defined for a job. This variable will now appear on the "Variables" page in the properties of each step in the job. If one step needs to use a different value, you can edit the variable for that step only and give it the necessary value.
Job Variables can be used throughout adTempus in most places where you enter text that is used in the execution of a job. For example:
The execution target and command-line parameters for a task.
Paths for file triggers and conditions.
Notification message subjects and bodies.
The help topic for a text entry box will note if Job Variables can be used.
To insert a Job Variable, simply type the name of the variable enclosed in percent signs, like this:
%Variable Name%
Variable names are not case sensitive, so you could also enter the variable as:
%variable name%
Variables can also be retrieved and set within scripts.
See Also