Variables in Batch Processing scripts
Within a Batch Processing script, values are assigned to predefined variables by the equal sign. In the following example the value “2” is assigned to the variable “LogLevel”:
LogLevel = 2 # This is a remark
In the second row in the example above a comment is given starting with the hash symbol “#”. Such rows are ignored. It is impossible to use a remark in the right-hand part of a row with a value assignment.
In a value assignment variables can also be used in the value definition as exemplified below:
ColdDataDirectory = /cache/cold ColdInputBaseDirectory = <ColdDataDirectory>/input
The variable <ColdInputBaseDirectory> will eventually be set to “/cache/cold/input” because the variable <ColdDataDirectory>, which must be surrounded by angle brackets, is evaluated so.
The following runtime variables are available during script execution. Although these are not set in any configuration file, they provide values that can be accessed from the runtime environment.
Runtime Variables |
Example Value |
Description |
---|---|---|
ScriptName |
Initialize |
Script name of the currently running script |
SpoolType |
Demo |
Spool name that was passed to the script for execution |
Generation |
000823 |
Generation number that was passed to the script for execution |
SpoolType.Generation |
Demo.000823 |
A commonly used combination of the above two values |
25.06.2007 |
Current date |
|
CurrentDateDDMMYYYY |
25.06.2007 |
Current date in format DD.MM.YYYY |
CurrentDateYYYYMMDD |
2007.06.25 |
Current date in format YYYY.MM.DD |
CurrentDateMMDDYYYY |
06.25.2007 |
Current date in format MM.DD.YYYY |
CurrentTime |
23:45:13 |
Time at which the script execution started |
OperatingSystem |
solaris |
Operating system name |
ENV_OS |
OS_SOLARIS10 |
Value of the system environment variable $OS |
CurrentDateYYYY |
2009 |
Current year |
CurrentDateMM |
10 |
Current month |
CurrentDateDD |
31 |
Current day of month |
CurrentTimeHHMM |
23:45 |
Time without seconds (at which script execution started) |
CurrentTimeHH |
23 |
Hour (at which script execution started) |
CurrentTimeMM |
45 |
Minute (at which script execution started) |
CurrentTimeSS |
13 |
Seconds (at which script execution started) |