Administer > Transforming, loading, and extracting data > Overview of the data load utility
Substitute attribute values with variables in data load configuration files
You can substitute the values of most attributes in the wc-dataload.xml and wc-dataload-env.xml 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.
Instead of using fixed attribute values in data load configuration files, you can use variable substitutions. The actual values for the variables are entered in the command line when the data load is run. If you do not enter a value for a variable when running the data load, the utility will prompt you to enter a value.
The following problems should be considered when performing this task:
- When substituting a variable for a password attribute, specify an encrypted password value. If you specify a plain text password, the data load utility tries to decrypt the password and fails to do so.
For the password attribute, you do not need to use a variable substitution. You can leave the value empty. When the data load runs, we will be prompted to enter a password. At this time, the password you enter should be a plain unencrypted password. For security reasons, the system does not echo the password value that is entered.
- When using a substitution variable for a numeric attribute field such as batch size or commit count, turn off XML validation because of the XSD validation problem. For more information on setting the -DXmlValidation parameter, see Data Load utility.
Variable substitution is case-sensitive.
Procedure
- Open the configuration file which contains the attribute value 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} . For example, the following database configuration properties are in the wc-dataload.xml configuration file:
Operate System Example
<_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"/>
The values can be substituted for the following variables:
Operate System Example
<_config:Database type="${dbType}" name="${dbName}" user="${dbUser}" password="" schema="${dbSchema}" server="${dbServerHost}" port="${dbPort}"/>
<_config:Database name="${dbName}" password="" server="${dbServerHost}" type="${dbType}" user="${dbUser}" schema="${dbSchema}"/>
To use the IBM Toolbox 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 variable name on the command line when running the data load utility, as shown in the following example:
–DdbType=db2 –DdbName=mall -DdbUser=userId -DdbSchema=USERID -DdbServerHost=localhost -DdbPort=50000