[IBM i]

Copy MQ Service (CPYMQMSVC)

Where allowed to run
All environments (*ALL)
Threadsafe
Yes

The Copy MQ Service (CPYMQMSVC) command creates an MQ service definition of the same type and, for attributes not specified in the command, with the same attribute values as an existing service definition.

Parameters

Table 1. Command parameters
Keyword Description Choices Notes
FROMSVC From Service Character value Required, Key, Positional 1
TOSVC To Service Character value Required, Key, Positional 2
MQMNAME Message Queue Manager name Character value, *DFT Optional, Key, Positional 3
REPLACE Replace *NO, *YES Optional, Positional 4
TEXT Text 'description' Character value, *BLANK, *SAME Optional, Positional 5
STRCMD Start program Single values: *SAME, *NONE Other values: Qualified object name Optional, Positional 6
Qualifier 1: Start program Name
Qualifier 2: Library Name
STRARG Start program arguments Character value, *BLANK, *SAME Optional, Positional 7
ENDCMD End program Single values: *SAME, *NONE Other values: Qualified object name Optional, Positional 8
Qualifier 1: End program Name
Qualifier 2: Library Name
ENDARG End program arguments Character value, *BLANK, *SAME Optional, Positional 9
STDOUT Standard output Character value, *BLANK, *SAME Optional, Positional 10
STDERR Standard error Character value, *BLANK, *SAME Optional, Positional 11
TYPE Service type *SAME, *CMD, *SVR Optional, Positional 12
CONTROL Service control *SAME, *MANUAL, *QMGR, *STARTONLY Optional, Positional 13

From Service (FROMSVC)

Specifies the name of the existing service definition to provide values for the attributes not specified in this command.

The possible values are:

from-service-name
Specify the name of the source service.

To Service (TOSVC)

The name of the new service definition to be created. The name can contain a maximum of 48 characters.

If a service definition with this name already exists, REPLACE(*YES) must be specified.

The possible values are:

to-service-name
Specify the name of the service being created.

Message Queue Manager name (MQMNAME)

Specifies the name of the queue manager.

The possible values are:

*DFT
Use the default queue manager.
queue-manager-name
The name of a message queue manager.

Replace (REPLACE)

Specifies whether the new service definition should replace an existing service definition with the same name.

The possible values are:

*NO
This definition does not replace any existing service definition with the same name. The command fails if the named service definition already exists.
*YES
Replace the existing service definition. If there is no definition with the same name, a new definition is created.

Text 'description' (TEXT)

Specifies text that briefly describes the service definition.

Note: The field length is 64 bytes and the maximum number of characters is reduced if the system is using a double-byte character set (DBCS).

The possible values are:

*SAME
The attribute is unchanged.
*BLANK
The text is set to a blank string.
description
Specify no more than 64 characters enclosed in apostrophes.

Start program (STRCMD)

The name of the program to run.

The possible values are:

*SAME
The attribute is unchanged.
start-command
The name of the start command executable.

Start program arguments (STRARG)

The arguments passed to the program at startup.

The possible values are:

*SAME
The attribute is unchanged.
*BLANK
No arguments are passed to the start command.
start-command-arguments
The arguments passed to the start command.

End program (ENDCMD)

The name of the executable to run when the service is requested to stop.

The possible values are:

*SAME
The attribute is unchanged.
*BLANK
No end command is executed.
end-command
The name of the end command executable.

End program arguments (ENDARG)

The arguments passed to the end program when the service is requested to stop.

The possible values are:

*SAME
The attribute is unchanged.
*BLANK
No arguments are passed to the end command.
end-command-arguments
The arguments passed to the end command.

Standard output (STDOUT)

The path to a file to which the standard output of the service program is redirected.

The possible values are:

*SAME
The attribute is unchanged.
*BLANK
The standard output is discarded.
stdout-path
The standard output path.

Standard error (STDERR)

The path to a file to which the standard error of the service program is redirected.

The possible values are:

*SAME
The attribute is unchanged.
*BLANK
The standard error is discarded.
stderr-path
The standard error path.

Service type (TYPE)

Mode in which to run service.

The possible values are:

*SAME
The attribute is unchanged.
*CMD
When started the command is executed but no status is collected or displayed.
*SVR
The status of the executable started will be monitored and displayed.

Service control (CONTROL)

Whether the service should be started automatically at queue manager start.

The possible values are:

*SAME
The attribute is unchanged.
*MANUAL
The service is automatically started or stopped.
*QMGR
The service is started and stopped as the queue manager is started and stopped.
*STARTONLY
The service is started as the queue manager is started, but will not be requested to stop when the queue manager is stopped.