Most Teradata PT job script values can be coded as job variables, which can be used anywhere in the script except within quoted strings and in comments. Once job variables have been defined, they can be reused multiple times within the associated job script. A common use of job variables is substituting the values for operator attributes.
- A character data type, the job variable value must be a quoted string.
- An integer data type, the job variable value must be an integer.
- An array attribute, the job variable value must be an array of values of the attribute data type.
Job variables can also be used as substitutes for object names and other job script parameters, but they cannot be used within quoted strings. The concatenation operator allows job variables to be used between quoted strings. For example, to substitute the job variable 'item' for the target table in an insert statement, use the string:
'Insert this'|| @item || ' into a column'
in the APPLY statement of the job script.
- Assign values to the job variables in the one of the following places, shown in processing order, from lowest to highest priority.
- in the job script itself (lowest priority)
- in the global job variables file (UNIX and Windows platforms) (next lowest priority)
- in a local job variables file (next highest)
- on the command line (highest priority)
- Reference the job variables in the job script
- If values for a particular variable are stored in more than one of the above listed locations, the value of highest priority source is used.
- A job variable can only be defined once per priority source; a redefinition within one priority source is considered an error by Teradata PT.
- Job Variables are case-insensitive (for example, UserName and USERNAME are equivalent). Camel casing is used for ease of readability.