+

Search Tips | Advanced Search

More on passing arguments

This example shows how to define a server service object to start a program called runserv when a queue manager is started.

This example is written with Windows style path separator characters.

One of the arguments that is to be passed to the starting program is a string containing a space. This argument needs to be passed as a single string. To achieve this, double quotation marks are used as shown in the following command to define the command service object:
  1. The server service object is defined, using the DEFINE SERVICE MQSC command:
    DEFINE SERVICE(S1) SERVTYPE(SERVER) CONTROL(QMGR) +
    STARTCMD('C:\Program Files\Tools\runserv.exe') +
    STARTARG('-m +QMNAME+ -d "C:\Program Files\Tools\"') +
    STDOUT('C:\Program Files\Tools\+MQ_SERVICE_NAME+.out')
    
    
    DEFINE SERVICE(S4) +
    CONTROL(QMGR) +
    SERVTYPE(SERVER) +
    STARTCMD('C:\Program Files\Tools\runserv.exe') +
    STARTARG('-m +QMNAME+ -d "C:\Program Files\Tools\"') +
    STDOUT('C:\Program Files\Tools\+MQ_SERVICE_NAME+.out')
    
    Where:

    • +QMNAME+ is a token representing the name of the queue manager.
    • C:\Program Files\Tools\ is a string containing a space, which will be passed as a single string.