crtmqenv (create IBM MQ environment)
Create a list of environment variables for an installation of IBM MQ, on UNIX, Linux, and Windows.
Purpose
We can use the crtmqenv command to create a list of environment variables with the appropriate values for an installation of IBM MQ. The list of environment variables is displayed on the command line, and any variables that exist on the system have the IBM MQ values added to them. This command does not set the environment variables for you, but gives you the appropriate strings to set the variables yourself, for example, within your own scripts.
If we want the environment variables set for you in a shell environment, we can use the setmqenv command instead of using the crtmqenv command.
We can specify which installation the environment is created for by specifying a queue manager name, an installation name, or an installation path. We can also create the environment for the installation that issues the crtmqenv command by issuing the command with the -s parameter.
This command lists the following environment variables, and their values, appropriate to the system:- CLASSPATH
- INCLUDE
- LIB
- MANPATH
- MQ_DATA_PATH
- MQ_ENV_MODE
- MQ_FILE_PATH
- MQ_INSTALLATION_NAME
- MQ_INSTALLATION_PATH
- MQ_JAVA_INSTALL_PATH
- MQ_JAVA_DATA_PATH
- MQ_JAVA_LIB_PATH
- MQ_JAVA_JVM_FLAG
- MQ_JRE_PATH
- PATH
Usage notes
The crtmqenv command removes all directories for all IBM MQ installations from the environment variables before adding new references to the installation for which we are setting up the environment. Therefore, if you want to set any additional environment variables that reference IBM MQ, set the variables after issuing the crtmqenv command. For example, if we want to add MQ_INSTALLATION_PATH/java/lib to LD_LIBRARY_PATH, we must do so after running crtmqenv.
Syntax
Required Parameters
- -m QMgrName
- Create the environment for the installation associated with the queue manager QMgrName.
- -n InstallationName
- Create the environment for the installation named InstallationName.
- -p InstallationPath
- Create the environment for the installation in the path InstallationPath.
- -r
- Remove all installations from the environment.
- -s
- Create the environment for the installation that issued the command.
Optional Parameters
- -k
- Applies to UNIX and Linux only. If the
-k flag is specified:
- On AIX, the LIBPATH environment variable is set.
- On Linux, the LD_LIBRARY_PATH environment variable is set.
- -l
- Applies to UNIX and Linux only. If the
-l flag is specified:
- On AIX, the LIBPATH environment variable is set.
- On Linux, the LD_LIBRARY_PATH environment variable is set.
- -x Mode
- Mode can take the value 32, or 64.
- -i
- List only the additions to the environment.
Return codes
Return code | Description |
---|---|
0 | Command completed normally. |
10 | Command completed with unexpected results. |
20 | An error occurred during processing. |
Examples
The following examples assume that a copy of IBM MQ is installed in /opt/mqm on a UNIX or Linux system.- This command creates a list of environment variables for an installation installed in
/opt/mqm:
/opt/mqm/bin/crtmqenv -s
- This command creates a list of environment variables for an installation installed in
/opt/mqm2, and includes the path to the installation at the end of the current
value of the LD_LIBRARY_PATH variable:
/opt/mqm/bin/crtmqenv -p /opt/mqm2 -l
- This command creates a list of environment variables for the queue manager QM1,
in a 32-bit environment:
/opt/mqm/bin/crtmqenv -m QM1 -x 32
The following example assumes that a copy of IBM MQ is installed in C:\Program Files\IBM\MQ on a Windows system.
- This command creates a list of environment variables for an installation called
installation1:
"C:\Program Files\IBM\MQ\crtmqenv" -n installation1
Related reference
Related information