Substituting data load attribute values with variables
You can substitute the values of most attributes in the wc-dataload.xml data load order configuration file and wc-dataload-env.xml data load environment configuration files. By using variable substitutions, you can change the value of attributes without editing the configuration file. For example, you can substitute the value of the user ID attribute for a variable.
About this task
Consider the
following possible issues when you perform this task:
- When you substitute a variable for a password attribute, you must
specify an encrypted password value. If you specify a plain text password,
the Data Load utility tries to decrypt your password and fails to
do so. Note: For the password attribute, you do not need to use a variable substitution. You can leave the value empty. When the data load runs, you are prompted to enter a password. The password that you enter can be a plain unencrypted password. For security reasons, the system does not echo the password value that is entered.
- When you use a substitution variable for a numeric attribute field
such as batch size or commit count, you must turn off XML validation
because of the XSD validation problem. For more information about
setting the
-DXmlValidation
parameter, see Data Load utility.
Note: Variable substitution is case-sensitive.
Procedure
- Open the configuration file that contains the attribute value you want to substitute for editing.
- Type a variable name in the space where the attribute value
is expected. The format of a variable name is ${name}.
You can also specify a default value in the format
${name,defaultValue}.
The following examples include the database configuration properties that are in the wc-dataload.xml load order configuration file:<_config:Database type="db2" name="mall" user="userId" password="" port="50000" schema="USERID" server="localhost"/>
<_config:Database name="system1" password="" server="system1.abc.com" type="OS400" user="wcuser1" schema="wcuser1"/>
<_config:Database type="${dbType}" name="${dbName}" user="${dbUser}" password="" schema="${dbSchema}" server="${dbServerHost,localhost}" port="${dbPort}"/>
<_config:Database name="${dbName}" password="" server="${dbServerHost,localhost}" type="${dbType}" user="${dbUser}" schema="${dbSchema}"/>
Note: To use the IBM Toolbox for JDBC driver, the driverType property is needed. For example:<_config:Database name="system1" password="" server="system1.abc.com" type="OS400" driverType="toolbox" user="wcuser1" schema="wcuser1"/>
- To enter the actual values of the attributes, type -D in
front of each parameter on the command line when they run the data
load utility. For example:
The–DdbType=db2 –DdbName=mall -DdbUser=userId -DdbSchema=USERID -DdbServerHost=localhost -DdbPort=50000
-DdbServerHost=localhost
parameter can be omitted because a default value is specified for the-DdbServerHost
parameter.