Built-in Variables
ActiveBatch provides a number of built-in variables. Variables prefixed by (or that contain) a dollar sign ($), an at-sign (@) or a pound-sign (#) are exclusively reserved for ActiveBatch use.
To maintain upward compatibility, ABAT$ prefixed variables, denote environment variables (you should never define your own variable names using either ABAT$ or the dollar sign character).
The built-in variables that follow describe various ActiveBatch objects. They can be used wherever a variable can be specified although some variables require their use to be limited to their context. For example, you can’t use an AlertNotification variable except within an Alert. The syntax when using these variables is ${@variablename}. For example, ${@name} would represent the Job name depending on the context.
The table below lists Job Scheduler built-in variables.
Name | Description |
---|---|
JobScheduler.CurrentBusinessDate |
Today’s Business Date |
JobScheduler.Name |
Active Directory Published Name |
JobScheduler.Description |
Active Directory Published Description |
JobScheduler.Hostname |
Hostname |
JobScheduler.IpAddress |
IP Address |
JobScheduler.InstallPath |
Installation Path of ActiveBatch software |
JobScheduler.Version |
Version (10.n.n.n) |
The table below lists Job/Plan built-in variables.
Name | Description |
---|---|
ID |
Instance ID |
Name |
Plan/Job Name |
Label |
Object label |
Path |
Object Path |
Owner |
Object Owner |
BatchID |
Batch ID. Batch ID is specific to a group of related executing instances. |
ExitCode |
Exit Code of the Plan/Job, where applicable. |
ExitCodeDescription |
Interpretation of Exit Code (may not be correct if program uses exit codes in nonstandard format). |
QueueName |
Name of the Execution Queue |
OriginalQueueName |
Name of original submitted Queue. |
TemplateID |
Definition or Template Object ID |
LogFileName |
Full file specification of log file, where applicable. |
CreationTime |
Date/Time object was created. |
BeginExecutionTime |
Starting Execution Date/Time |
EndExecutionTime |
Ending Execution Date/Time |
RestartTime |
Last Restart Date/Time |
RestartCount |
Number of Restarts |
ExecutionMachine |
Execution Machine name (Jobs only) |
Execution User |
Username that Job executed as. |
Template.Description |
Description of Job/Plan definition |
Template.Documentation.Documentation |
Documentation of Job/Plan Definition |
JSSTime |
Local time of the Job Scheduler’s machine (hhmm; leading zero suppressed) |
Time |
Local time based on the Job’s specified Time Zone (hhmm; leading zero suppressed) |
The table below lists Event Trigger Built-in Variables.
Name | Description |
---|---|
Trigger |
Structure Variable. Available when a File Trigger or WMI event has occurred. |
Trigger.Type |
Reason Plan/Job was triggered for execution. One of these (File, Wmi, Msmq, E-Mail, Web Services, DateTime, Manual). |
Trigger.Username |
Triggered by |
Trigger.Filename |
File Specification when trigger is “File”. |
Trigger.MofText |
MOF Text of event when trigger is “Wmi”. |
Trigger.Message |
MSMQ Received Message |
Trigger.From |
E-Mail “From” |
Trigger.To |
E-Mail “To” |
Trigger.Subject |
E-Mail “Subject” |
Trigger.Date |
E-Mail “Date” |
Trigger.Body |
E-Mail “Body of Message” |
Event.DateTime |
Date and Time the Event occurred. |
Event.ID |
The enumerated event id as published in abatJobAlertType. |
Event.Name |
The corresponding event string (i.e. Succeeded, Failed, etc) |
For those variables which have a date/time value, an optional format qualifier may also be specified. The syntax is ${var:format} where format is one of the following as noted in the table below.
All times are Job Scheduler machine local except where specifically noted. Locale format means the Job Scheduler machine’s regional date/time settings as noted.
Format | Output | Description |
---|---|---|
<default> |
2023-08-17T16:32:42 |
Sortable ISO |
s |
2023-08-17T16:32:42 |
Sortable ISO |
S |
2023-08-17T16-32-42 |
Sortable Filename |
g |
8/17/2023 4:32 PM |
Short date/time (Locale format, no seconds) |
G |
8/17/2023 4:32:42 PM |
Short date/time (Locale format, seconds) |
f |
Thursday, August 17, 2023 4:32 PM |
Long date/time (Locale format, no seconds) |
F |
Thursday, August 17, 2023 4:32:42 PM |
Long date/time (Locale format, seconds) |
D |
Thursday, August 17, 2023 |
Long date (Locale format, no time) |
d |
8/17/2023 |
Short date (Locale format) |
T |
4:32:42 PM |
Short time (Locale format, seconds) |
t |
4:32 PM |
Short time (Locale format, no seconds) |
u |
2023-08-17T20:32:42 |
Sortable ISO (UTC) (Using ET as base) |
U |
2023-08-17T20-32-42 |
Sortable Filename (UTC) (Using ET as base) |
As an example:
${@CreationTime:S} would yield the value 2023-08-17T16-32-42.
The following VBscript expression would retrieve the 24-hour portion: split("${timevariable:s}", "T")(1).