Skip to Main Content
Return to Navigation

Adding New Environmental Variables

Environmental variables are project level parameters which are typically used across projects. The advantage to environmental variables is that they can be set at the project level and all associated jobs in that project will automatically use the value.

Creating a New Environmental Variable

To add a new environmental variable:

  1. In DataStage Administrator, select the Projects tab.

  2. Click the Properties button and select the General tab.

  3. Click the Environment button and select User Defined from the Categories pane.

    Image: Defining Environmental Variables

    This example illustrates the Defining Environmental Variables.

    Defining Environmental Variables
  4. Enter your new environmental variable parameters for the following fields:

    1. Name

    2. Type

    3. Prompt

    4. Value

  5. Click OK to save your changes.

Adding an Environmental Variable to a Server Job

To add the new environmental variable to a server job:

  1. In DataStage Designer, select Jobs from the project tree.

  2. Select the job you want to add the environmental variable.

  3. Select Edit, Job Properties from the menu and select the Parameters tab.

  4. Click the Add Environment Variable... button.

    The Choose Environment Variable window appears.

  5. Select the new environmental variable from the Choose Environment Variable window.

  6. Click OK to save your changes.

    The new environmental parameter is now a part of the job parameters.

    The Default value can be changed to $PROJDEF in the job parameters to signify that the value shall be taken from the project default value unless overwritten.

  7. Save and recompile the job.

Updating the Related Sequencer Job

If there is a sequencer job that calls the server job you modified, you must update the sequencer job to add the parameter value to the job activity stage where the value is passed to the called job.

To modify the related sequencer job:

  1. Select Edit, Job Properties from the menu and select the Job tab.

    Image: Job Tab of Job Properties

    This example illustrates the Job Tab of Job Properties.

    Job Tab of Job Properties
  2. Select the parameter from the list, and click Insert Parameter.

    Image: Inserting Your New Parameter

    This example illustrates Inserting Your New Parameter.

    Inserting Your New Parameter
  3. Select your parameter, then click OK to save changes and exit.

  4. Save and recompile the job.