All variables are identified by the %% prefix. If %% is included in the value for a job processing parameter, Control‑M assumes that it is referring to a variable or function.
NOTE: A Variable name cannot start with a numeric digit.
A special %%# prefix (on Linux or UNIX) or %%%#% prefix (on Windows) can be used to indicate that a variable or function should not be resolved. In these cases, the actual name of the variable or function (minus the # sign) is output. For example, Do Notification Variable %%#PARM1 is greater than 100 issues the following message:
Variable %%PARM1 is greater than 100.
Variables are divided into the following types:
Job Submission variables pass parameters to a job or set the job’s working parameters. For more information, see Job submission variables.
System variables are automatically assigned values using system information available at the time of job submission (for example, %%DATE contains the current system date). For more information, see Control-M system variables.
User-defined variables can be defined in a number of different ways for inclusion in various job processing parameters. For more information, see User-defined variables.
Variable lists. The %%LIBMEMSYM special variable can be used to point to a file containing a list of assignments statements to be applied to a job. This variable enables you to create one or more lists of assignment statements that can be applied to many job processing definitions. For more information, see Variable lists.
Multiple variables (each with a different scope) can have the same name. If more than one variable with the same name has been defined, the variable with the narrowest scope is used.
NOTE: The exception to this rule occurs when the variable is distributed from the Control‑M/Server to the Control‑M/Agent. The variable from the narrowest scope may not be the one that is used by the Control‑M/Agent.
NOTE: Depending on the value of the VARIABLE_INC_SEC variable of the Control‑M/Server, duplicate variables from different scopes can be distributed to the agents. For more information, see Control-M Administration.
Control‑M uses the following logic to determine which value to use when a variable is specified in a job processing definition:
Control‑M checks if a local variable (for the job) has been defined with the specified name. If a local variable exists, the value specified for that variable is used.
If no local variable exists with the specified name, and the job is in a SMART Folder, Control‑M checks for a variable with the specified name in the SMART Folder definition. If the variable is defined in the SMART Folder definition, that value is used.
If the job is not in a SMART Folder, or the variable is not defined in the SMART Folder definition, Control‑M searches for a Global variable with the specified name.
VARIABLE_INC_SEC must be set to Global to resolve a variable that is included in the script of a job, where the variable is defined in the SMART Folder.
If no definition is found for a specified variable, the variable is resolved to the reserved word CTMERR.