Adding an environment variable

You can add an environment variable by using the setmqvar command on the command line. You can add either a global environment variable, or a queue manager specific environment variable.

Procedure

  1. Enter the IBM® MQ administration mode by entering the following command:

    mqcli

  2. Add the environment variable:
    • To add a global environment variable, enter the following command:

      setmqvar -k Name -v Value

      Where:
      Name
      Specifies the name of the global environment variable.
      Ensure that the value of Name is correct before you use the command to add an environment variable. The value of Name is not validated.
      Value
      Specifies the value of the specified environment variable.
      If Value is a string that contains spaces, it must be enclosed in double quotation marks. Any double quotation marks that are used in the Value must be escaped by using a backslash ( \ ).
      Ensure that the value of Value is correct before you use the command to add an environment variable. The value of Value is not validated.
    • To add an environment variable for a specific queue manager, enter the following command:

      setmqvar -m QMgrName -k Name -v Value

      Where:
      QMgrName
      Specifies the queue manager for which the environment variable is added.
      Name
      Specifies the name of the queue manager environment variable.
      Ensure that the value of Name is correct before you use the command to add an environment variable. The value of Name is not validated.
      Value
      Specifies the value of the specified environment variable.
      If Value is a string that contains spaces, it must be enclosed in double quotation marks. Any double quotation marks that are used in the Value must be escaped by using a backslash ( \ ).
      Ensure that the value of Value is correct before you use the command to add an environment variable. The value of Value is not validated.
  3. Optional: Exit the IBM MQ administration mode by entering the following command:

    exit

Example

The following example shows the addition of the global environment variable MQSSLRESET with a value of 0:
setmqvar -k MQSSLRESET -v 0