COPY MQI
Using this statement, you can copy the contents of a set (or sets) of variables created from a structure (or multiple structures), found in a IBM MQ message, to another set of variables for the purpose of temporarily saving.
For example, suppose you want to GET a message from one queue, save the message descriptor values for later, GET another message and inspect some portion of that message and, based on values discovered from the second GET, forward the first message to another queue. Using the COPY MQI command, you can do this by saving the first set of structure values. Later, using another COPY command, you can copy them back to the IMFMQI_ variables and, optionally, PUT the message to another queue.
The IMFEXEC COPY MQI statement will copy entire structures based on input parameters. You can copy a single structure, for example, the MD, or multiple structures, for example, the MD and the MDE or ALL structures that exist in the message. You can also use the COPY MQI statement to nullify all variables in a structure or more than one structure.
Command | Parameters |
---|---|
IMFEXEC COPY MQI | STRTYPE(structure Ids) STRFROM(input prefix) STRTO(output prefix) |
This table describes the IMFEXEC COPY MQI parameters.
Parameters | Function | Notes |
---|---|---|
STRTYPE | Identifies the structure IDs to copy. | This parameter is required. Possible input values are as follows:
Multiple structures can be specified, delimited by blanks or commas. The variables IMFMQI_STRUCTURES or IMFQ_STRUCTURES can be used in place of individual entries. The IMFMQI_STRUCTURES variable is returned from an IMFEXEC MQI GET statement and contains a blank-delimited list of structures that exist within the message. The IMFQ_STRUCTURES variable is passed to an EXEC from a IBM MQ rule and contains a blank-delimited list of structures that exist within the message. |
STRTYPE (continued) | Identifies the structure IDs to copy. | |
STRFROM | Specifies the prefix of the variables to copy from. | This parameter is not required. If omitted, the default variable prefix is IMFMQI_. The value specified must contain characters acceptable to CLIST and REXX. To set a structure of variables to nulls, specify STRFROM(NULLS). The allowable input prefix length is from 1 to 24 characters. |
STRTO | Specifies the prefix of the variables to copy to | This parameter is required. The length of the value specified must be from 1 to 24 characters and must consist of characters acceptable to CLIST and REXX. Do not use STRTO value of BBIJRNL_ because MainView AutoOPERATOR reserves this for internal processing. |
The completion code is returned in the IMFMQCC and IMFCC variables. For additional information, see How-completion-and-reason-codes-are-returned.
The reason code is returned in the IMFMQRC and IMFRC variables; contents of both variables are the same. Refer to the IBM manual MQ Application Programming Reference for the reason code description.