Environment variables

Environment variables are an IBM operating system feature that allows a series of key-value pairs to be defined at two levels:

  • system level
  • job level

The operating system provides the following commands to help manage environment variables:

  • ADDENVVAR (add a new environment variable)
  • CHGENVVAR (change the value of an environment variable)
  • RMVENVVAR (delete an existing environment variable)
  • WRKENVVAR (work with a list of existing environment variables)

In addition, CoolSpools provides the following commands, intended primarily to assist with migrating your environment variables from one system or partition to another@

  • SAVENVVAR (save the current values of system-level environment variables into a stream file)
  • RSTENVVAR (restore the values of system-level environment variables from a stream file)

Each job has its own set of environment variables. These are normally initialized from the system-level environment variables when the job starts. In the case of a batch job, the job-level environment variables may be copied from the submitting job's job-level environment variables if SBMJOB......CPYENVVAR(*YES) is specified.

Please note that, if you set an environment variable at *SYS level, that environment variable will not take effect for jobs that are already running. You will need to restart CoolSpools server jobs (e.g. those running in the COOLSPOOLS subsystem and CoolSpools SMTP servers) for your changes to take effect.

Also please note that environment variables names and their values are both case-sensitive.

CoolSpools uses environment variables to control a number of aspects of its processing. In many cases, an environment variable can be used to modify the default way in which CoolSpools behaves. They are also used to activate some program fixes.

If you are testing a CoolSpools fix which is activated by an environment variable, to limit any impact on other users, you should add the environment variable at job-level

ADDENVVAR ENVVAR('VARIABLE_NAME') VALUE('1') LEVEL(*JOB)

When you are satisfied with the fix, make it available to all users by adding the environment variable at system-level

ADDENVVAR ENVVAR('VARIABLE_NAME') VALUE('1') LEVEL(*SYS)

remembering that this will take effect for all new jobs that start after this point, so we would recommend the users sign off and on again.