CREATE MQ SCRIPT command

Use the CREATE MQ SCRIPT command to generate scripts for creating the IBM® MQ objects that are needed for Q Replication and Event Publishing.

When you create control tables and queue maps, you can use the MQDEFAULTS keyword in these commands to specify that the ASNCLP program automatically use the default objects that are generated by the CREATE MQ SCRIPT command. This method bypasses the need to specify individual queue managers and queues.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-CREATE MQ SCRIPT--+---------+--CONFIG TYPE--+-U-+--| mq-clause |-><
                     '-RUN NOW-'               +-E-+                  
                                               +-B-+                  
                                               '-P-'                  

mq-clause

   .-,-----------------------------------------.   
   V                                           |   
|----MQSERVER--number--NAME--name--| options |-+----------------|

options

|--MQHOST--host_name--+---------------------+--+-------------------------+--+-----------------------+-->
                      '-MQPORT--port_number-'  '-QMANAGER--queue_manager-'  '-QNAME_QUAL--qualifier-'   

>--+--------------+--+----------------------+------------------->
   '-PLATFORM ZOS-'  '-| multiplex-option |-'   

>--+------------------+--+-----------------------+--------------|
   '-| file-options |-'  '-| multiinst-options |-'   

multiplex-option

|--PARALLEL SENDQS--number--------------------------------------|

file-options

|--+---------------------+--+-----------------------+-----------|
   '-MQLOG--log_location-'  '-MQDATA--data_location-'   

multiinst-options

              .-,------------------------------------------.   
              V                                            |   
|--MULTIINST----MQHOST--host_name--+---------------------+-+----|
                                   '-MQPORT--port_number-'     

Parameters

RUN NOW
Specifies that you want the ASNCLP program to run the generated MQ script after it is created. The queue manager and ASNCLP program must be on the same system for you to use this option.
CONFIG TYPE
Specifies the type of replication:
U
Unidirectional
E
Event publishing
B
Bidirectional
P
Peer-to-peer

mq-clause

MQSERVER
A number that identifies the Q Capture server, Q Apply server, or both for multidirectional replication. The numbers differ depending on the configuration type:
Unidirectional
Use 1 to represent the Q Capture server and 2 to represent the Q Apply server. Both numbers are required.
Event publishing
Use 1 to represent the Q Capture server.
Bidirectional
Use 1 to represent one server and its paired Q Capture and Q Apply, and the number 2 to represent the other server. Both numbers are required.
Peer-to-peer
Use 1, 2, 3, and so on, depending on the number of servers in the peer-to-peer environment. At least two server numbers are required.
NAME
The subsystem name or database alias of the Q Capture server, Q Apply server, or the combined Q Capture-Q Apply server for multidirectional replication.

options

MQHOST
The host name or IP address of the system that contains the queue manager under which the MQ objects will be created. In a multi-instance queue manager configuration that is used for high availability, this keyword refers to the host name or IP address of the primary server.
MQPORT
The port number that the channel listener monitors for incoming requests. If this keyword is not specified, the ASNCLP program uses the default MQ port number, 1414. In a multi-instance queue manager configuration that is used for high availability, this keyword refers to the port that is used on the primary server.
QMANAGER
The queue manager that will be created, and that will be used to create other MQ objects. If this keyword is not specified, the value that was specified for the NAME keyword is used to name the queue manager.
QNAME_QUAL
A qualifier that is used for the generated queue names. The default is ASN, which is the default Q Capture or Q Apply schema. This qualifier can help identify queues at the Q Capture system or Q Apply system.
PLATFORM ZOS
Specifies to create MQ scripts with options that are specific to the z/OS® platform.

multiplex-option

PARALLEL SENDQS number
Specifies that the Q Capture program will use multiple send queues to replicate transactions that use the queue map. Use this option in conjunction with the PLATFORM ZOS keywords. The variable number specifies the number of send queues. The send queues must be defined in the following format:
send_queue_name.suffix

Where send_queue_name remains the same for all send queues that are part of the queue map, and suffix is an integer with a minimum value of 1. For example, if number is 3 you would use a naming scheme similar to the following:

ASN.SRC_TO_ASN.TGT.DATA.1
ASN.SRC_TO_ASN.TGT.DATA.2
ASN.SRC_TO_ASN.TGT.DATA.3
The generated script will include all of the send queues and associated transmission queues, sender channels, and receiver channels that are needed for parallel send queues. For more detail on setting up this configuration, see MQ objects required to use parallel send queues.

file-options

Use these options for specifying a location for log and data files for the queue manager. When you use the MULTIINST keyword for a multi-instance queue manager, you must specify values for both MQLOG and MQDATA and these locations will be used by all instances of the queue manager.

MQLOG
The location where a multi-instance queue manager writes its log files.
MQDATA
The location where a multi-instance queue manager writes its data files.

multiinst-options

MULTIINST
Specifies that the MQ objects to be created will run under a multi-instance queue manager.
MQHOST
The host name or IP address of the standby server in a high-availability configuration.
MQPORT
The port number that the channel listener monitors for incoming requests on the standby server in a high-availability configuration.

Usage notes

  • Linux, UNIX, Windows: The default file name for the generated script is qrepl.server_name.mq, where server_name is the server alias that was specified in the CREATE MQ SCRIPT command. The scripts are executable files in either the .bat or .exe format depending on whether the ASNCLP program runs on Windows or Linux-UNIX.
  • z/OS: If the ASNCLP program is running natively on z/OS, the output DD name for the generated script is OUTMQCAP, OUTMQTRG, and OUTMQx. The following lines must be included in the JCL:
    //OUTMQCAP DD DSN=&SYSUID..ASNCLP.OUTNODE1,DISP=(NEW,CATLG,DELETE),
    //         UNIT=SYSDA,SPACE=(TRK,(30,10))
    //OUTMQTRG DD DSN=&SYSUID..ASNCLP.OUTNODE1,DISP=(NEW,CATLG,DELETE),
    //         UNIT=SYSDA,SPACE=(TRK,(30,10))
    The generated script will be wrapped to 80 characters per line. Comments are included with changes that need to be made for z/OS.
  • You can specify the CREATE MQ SCRIPT command in the same input file as other ASNCLP commands, but this command does not use the server and schema information from any previous SET commands.
  • If the Q Capture and Q Apply servers are on the same system, only one script file is generated that contains all of the MQ commands.
  • When you use the MULTIINST keyword to specify a configuration with a multi-instance queue manager, the ASNCLP program includes these options in the generated script:
    • The crtmqm command uses the –ld and –md options for the log file and data files.
    • The strmqm command uses the –x option. This option prevents the accidental start of a second instance of a multi-instance queue manager and obtains an exclusive lock on shared files.
    • Channel definitions include the primary and secondary host and port information, for example:
      CONNAME('primary_host(primary_port),secondary_host(secondary_port)')

Example 1

To generate a script that creates MQ objects for event publishing:
CREATE MQ SCRIPT CONFIG TYPE E
MQSERVER 1 NAME SOURCEDB MQHOST "9.30.54.118" MQPORT "1414";

Example 2

To generate a script that creates MQ objects for a unidirectional replication configuration where the Q Capture and Q Apply servers are on the same system and share a local queue manager:
CREATE MQ SCRIPT CONFIG TYPE U
MQSERVER 1 NAME SOURCEDB MQHOST "9.30.54.118",
MQSERVER 2 NAME TARGETDB MQHOST "9.30.54.118";

Example 3

To generate a script that creates MQ objects for a unidirectional replication configuration where the source and target servers are remote with different queue managers (no MQPORT keywords are specified so the default ports of 1414 are used at each system):
CREATE MQ SCRIPT CONFIG TYPE U
MQSERVER 1 NAME SOURCEDB MQHOST "9.30.54.118",
MQSERVER 2 NAME TARGETDB MQHOST "9.30.54.119";

Example 4

To generate a script that creates MQ objects for a bidirectional replication configuration where the primary and standby servers are remote with different queue managers:
CREATE MQ SCRIPT CONFIG TYPE B
MQSERVER 1 NAME DB1 MQHOST "9.30.54.118",
MQSERVER 2 NAME DB2 MQHOST "9.30.54.119";

Example 5

To generate a script that creates MQ objects for a peer-to-peer replication configuration:
CREATE MQ SCRIPT CONFIG TYPE P
MQSERVER 1 NAME DB1 MQHOST "9.30.54.117",
MQSERVER 2 NAME DB2 MQHOST "9.30.54.118",
MQSERVER 3 NAME DB3 MQHOST "9.30.54.119";

Example 6

To create the MQ objects that are needed for a bidirectional replication configuration that uses a multi-instance queue manager at the source:
CREATE MQ SCRIPT CONFIG TYPE B
MQSERVER 1 NAME SOURCEDB MQHOST "ionx11" MQPORT "1450"
  MQLOG "LOG1" MQDATA "DATA1",
  MULTINST MQHOST "iony11",
MQSERVER 2 NAME TARGETDB MQHOST "coral501" MQPORT "1450”;