Modifying an environment variable

You can modify an environment variable by using the setmqvar command on the command line. You can modify 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. Modify the environment variable:
    • To modify a global environment variable, enter the following command:

      setmqvar -k Name -v Value

      Where:
      Name
      Specifies the name of the global environment variable to modify.
      Ensure that the value of Name is correct before you use the command to modify 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 modify an environment variable. The value of Value is not validated.
    • To modify 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 modified.
      Name
      Specifies the name of the queue manager environment variable.
      Ensure that the value of Name is correct before you use the command to modify 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 modify 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 modification of the global environment variable MQSSLRESET with a value of 1000:
setmqvar -k MQSSLRESET -v 1000