To specify dataset allocation using environment variables

Describes a preferred method for allocating datasets for an enterprise server region using environment variables instead of defining the full path to each dataset.

An obvious method to configure datasets is to specify the full path for each dataset accessed by Enterprise Server. However, as the number of datasets accessed increases, the more cumbersome this method becomes. In addition, having a hard-coded location for each dataset can make it difficult to move between test and production environments that have different directory structures.

To reduce the effort required when the system uses large numbers of data files, you can set environment variables to define the datasets by an enterprise server region:

  1. From the Enterprise Server Administration page, click the Edit button that corresponds to the enterprise server region to configure.
  2. Select the Server > Properties > General tabs.
  3. In the Configuration Information text box, type: [ES-Environment]
  4. Configure the datasets to use with the env-var=path syntax where:
    • env-var is the name of the environment variable you are creating
    • path is the full path, including the drive letter, to the dataset

    You can create as many environment variables as you need to cover all of the paths you want to specify.

  5. When you have defined a variable for each required path, click OK. The settings are applied to the enterprise server region.
  6. In the catalog, when allocating datasets using the %PCDSN option to specify a physical file, you can substitute an environment variable that you defined to represent the path to the file. Prefix environment variable names with a dollar sign ($).

    For example, you could create an environment variable named PRODDATA and set its value to d:\mydataset.

    Then, to allocate a dataset in the catalog for a file named MFIO1.SAMPLE.DATA, you would use this code:

     //*MFE:%PCDSN='$PRODDATA\MFI01.SAMPLE.DATA'