0 / 0
Managing environment variables in DataStage

Managing environment variables in DataStage

You can manage environment variables for IBM® DataStage® in several different ways.

In DataStage, you can manage environment variables in three different ways: at the project level, and the flow level, and by using the dsjob command-line interface (CLI).

Project level

To set up environment variables from the project level, complete the following steps:
  1. Open a project, then click the Manage tab.
  2. Click Environments > Templates > New template + or edit an existing template by opening it, clicking New environment variable + and adding a key-value pair.
  3. Specify the environment details and configuration.
  4. In the Environment variables field, specify runtime environment variables by using a name=value pair.
    For example:
    CC_MSG_LEVEL=1
    APT_CONFIG_FILE=/ds-storage/2nodes.apt
  5. Click Create.
  6. From a DataStage flow, click the Settings icon on the toolbar, then click Run on the Settings page.
  7. Select the environment that you created, then click Save.

DataStage flow level

To select environment variables from the flow level, complete the following steps:
  1. Open a DataStage flow.
  2. Click the Add parameters icon ({#}) on the toolbar.
  3. Select one or more environment variables from the list of available environment variables.
  4. Click Add, then click Return to canvas.

Command-line interface (CLI)

You can pass in environment variables from the CLI. See the following example:
cpdctl dsjob run --job "TestSimpleJavaWriteJSON.DataStage job" --project Project2021 --wait 300 --param FILE_NAME=/ds-storage/output/MySales5k.json --env "\$CC_MSG_LEVEL"="1"

For more information, see DataStage command-line tools.

Override rules

The following override rules apply to the environment variables:
  • dsjob CLI environment variables overwrite DataStage flow level environment variables.
  • DataStage flow-level environment variables overwrite runtime environment-level environment variables.
Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more