Setting Up Job Variables - Parallel Transporter

Teradata Parallel Transporter User Guide

Product
Parallel Transporter
Release Number
15.10
Language
English (United States)
Last Update
2018-10-07
dita:id
B035-2445
lifecycle
previous
Product Category
Teradata Tools and Utilities

Setting Up Job Variables

Job variables can be set up in the following locations

  • In the job script itself: The lowest priority for supplying values for job variables is specifying them inside the job script itself. Use the optional SET directive before the DEFINE JOB statement, for example:
  • SET MyTdpId    = 'database1';
    SET MyUserName = 'johndoe';
    SET MyUserPassword = 'johndoe';
     
    DEFINE JOB CREATE_SOURCE_EMP_TABLE
    (
      DEFINE OPERATOR DDL_OPERATOR
      DESCRIPTION 'Teradata Parallel Transporter DDL Operator'
      TYPE DDL
      ATTRIBUTES
      (
        VARCHAR TdpId        = @MyTdpId,
        VARCHAR UserName     = @MyUserName,
        VARCHAR UserPassword = @MyUserPassword
      );
     
      APPLY
        ('DROP TABLE SOURCE_EMP_TABLE;'),
        ('CREATE TABLE SOURCE_EMP_TABLE(EMP_ID INTEGER, EMP_NAME CHAR(10));'),
        ('INSERT INTO SOURCE_EMP_TABLE(1,''JOHN'');'),
        ('INSERT INTO SOURCE_EMP_TABLE(2,''PETER'');')
      TO OPERATOR (DDL_OPERATOR);
    );
  • Global job variables file: The next lowest priority for supplying values for job variables is storing them inside the global job variables file. The global job variables file is read by every Teradata PT job. Place common, system-wide job variables in this file, then specify the path of the global job variables in the Teradata PT configuration file by using the GlobalAttributeFile parameter. An example global job variables file would contain the following text:
  • MyTdpId    = 'database1',
    MyUserName = 'johndoe',
    MyUserPassword = 'johndoe'

    Note: A global job variables file is available on UNIX and Windows systems.

  • Local job variables file: The second highest priority and most common method for defining values for job variables is storing them inside a local job variables file. You can specify a local job variables file, which contains the values for job variables, using the -v option on the command line as follows:
  •    tbuild -f weekly_update.txt -v jobvars.txt

    For example, the jobvars.txt file might contain the following text:

    MyTdpId    = 'database1',
    MyUserName = 'johndoe',
    MyUserPassword = 'johndoe'

    Note: On z/OS, specify a local job variables file through the DDNAME of ATTRFILE.

  • On the command line: The highest priority method for defining values for job variables is passing them in as arguments on the command line using the -u option. For example:
  • tbuild -f weekly_update.txt -u "MyTdpId = 'database1', MyUserName = 'johndoe', MyUserPassword = 'johndoe'"

    For further information on specifying job variables on the command line, see “Assigning Job Variables on the Command Line” on page 141.

    For more information, see “Setting Up the Job Variables Files” on page 72.