MQI GET
Command | Parameters |
---|---|
IMFEXEC MQI GET | HCONN(hconn) HOBJ(hobj) GOPTS(options) BUFFLEN(bufferlength) BUFFER(buffer) DATALEN(datalength) |
The following table describes the IMFEXEC MQI GET parameters.
Note
The following list of constants may not be complete because IBM may have added new constants since the printing of this manual. For a more complete list, see the IBM manual MQ Application Programming Reference or the IBM Knowledge Center.
Parameter | Function | Notes |
---|---|---|
HCONN | Provides the connection handle that represents the connection to the queue manager. | This parameter:
If omitted, the connection handle value is the default variable IMFHCONN. The connection handle is returned by a previous IMFEXEC MQI CONN request and stored in the IMFHCONN variable or a user-specified variable. Either this parameter, specifying an existing variable that contains the connection handle, or a previously created IMFHCONN variable containing the connection handle is required. |
HOBJ | Provides the object handle that represents the queue from which the message is returned. | This parameter:
If omitted:
Either this parameter, specifying an existing variable that contains the object handle, or a previously created IMFHOBJ variable containing the object handle is required. |
GOPTS | Specifies the options that control the action of GET. | This parameter is not required. If omitted, the GET options value is taken from the default variable IMFMQI_GMO_OPTIONS. The variable IMFMQI_GMO_OPTIONS is not required. If GET options are not specified, IBM MQ will use the default, MQGMO_NO_WAIT. More than one of the following valid GET options can be specified in any valid combination:
|
GOPTS (continued) | Specifies the options that control the action of GET. |
See note at the beginning of this table. In addition to these options, another MainView AutoOPERATOR option is REMOVE_DLH. Using the REMOVE_DLH option, you can retrieve messages from a Dead Letter queue, process them and forward them to an application queue without the Dead Letter Header. The REMOVE_DLH option is added to the GOPTS() keyword parameter of the IMFEXEC MQI GET statement. This option causes the IMFMQI_MD_ENCODING, IMFMQI_MD_CODEDCHARSETID and I MFMQI_MD_FORMAT variables to be set from the Dead Letter Header instead of the message descriptor. The returned buffer is without the DLH. This action occurs before control is returned to the EXEC following the IMFEXEC MQI GET command. The message can optionally be placed directly onto another queue. |
BUFFER | Specifies the variable that contains the message buffer data following a successful GET. | This parameter is not required. If omitted, the variable IMFMQI_BUFFER will contain the Message Buffer data upon successful completion of the GET. |
BUFFLEN | Specifies the length of the data used to create the variable containing the message buffer data. | This parameter:
If this parameter is omitted, the variable IMFMQI_BUFFLEN is used to obtain the BUFFER length. If the variable is not set, the message length is used. The recommendation is that you do not set the variable so that the message length is used. Note The BUFFER variable will be left justified and blank-padded to the right up to the value of the BUFFLEN variable. If you want to change the BUFFER variable size to be exactly the message size, use the REXX SUBSTR or LEFT built-in function. |
DATALEN | Specifies the variable to be set to the message length following a successful GET. | This parameter is not required. If omitted, the variable IMFMQI_DATALEN is set with the length of the message data returned from the GET. If the value is greater than the buffer length value, only buffer length bytes are returned in the buffer variable. If the value is zero, it means that the message contains no application data. |
The following table describes the most common input and output variables for the IMFEXEC MQI GET command. These variables, whether used as input or output, are always accessible after a successful GET. For structures other than the MD (message descriptor), refer to EXECs variables. Variables created from structures begin with 'IMFMQI_', followed by the IBM MQ structure, followed by the field name within the IBM MQ structure, with each node delimited by an underscore.
For definitions of field names and constants used in this table that are derived from IBM MQ structure field names, see the IBM manual MQ Application Programming Reference or the IBM Knowledge Center.
Variable name | Source | Notes |
---|---|---|
Note The following list of constants may not be complete because IBM may have added new constants since the printing of this manual. For a more complete list, see the IBM manual MQ Application Programming Reference or the IBM Knowledge Center. | ||
IMFMQI_STRUCTURES | Output | This variable contains a blank-delimited list of the IBM MQ structures contained in the message. For example, in the case of a Dead Letter message, the contents would contain at least: ‘MD DLH’ |
IMFMQI_OFFSETS | Output | This variable contains a blank-delimited list of the offsets of the structures contained in the message (as well as the offset of the application data) from the beginning of the message buffer. Using this variable, you can access application data beyond the structures in the message buffer. The number of entries in the list is always one more than the number of structures participating in the operation (IMFMQI_STRUCTURES) because an entry for the offset of the application data is included in the list. A ‘NONE’ is always used for a structure that does not exist in the buffer, such as ‘MD’. For example, if the message was a dead letter message and contained some application data, the variable might look like this: ‘NONE 0 172’ In the above example, NONE is specified for the MD, 0 for the offset of the Dead Letter Header and 172 is the offset of the application data. |
IMFMQI_MD_STRUCID | Input | (optional) The EXEC may or may not set this variable. If the EXEC does not set this value, the IBM MQ default will be used, unmodified by the EXEC Manager. |
IMFMQI_MD_VERSION | Input | (optional) The EXEC may or may not set this variable. If the EXEC does not set this value, the IBM MQ default will be used unmodified by the EXEC Manager. |
IMFMQI_MD_REPORT | Output | This variable contains one or more of the following values delimited by blanks:
See note at the beginning of this table. |
IMFMQI_MD_MSGTYPE | Output | This variable contains one of the following values:
See note at the beginning of this table. |
IMFMQI_MD_EXPIRY | Output | This variable contains a decimal number, in the range 1 to 999999999, or MQEI_UNLIMITED. |
IMFMQI_MD_FEEDBACK | Output | This variable contains one of the following values for report messages:
In addition, this field can contain any reason code from the following sources:
See note at the beginning of this table. |
IMFMQI_MD_ENCODING | Output | This variable contains MQENC_NATIVE or any decimal number up to 999999999. |
IMFMQI_MD_CODEDCHARSETID | Input or Output | This variable contains:
Or any decimal number up to 999999999. See the IBM manual MQ Application Programming Reference or the IBM Knowledge Center for details on how to use the CodedCharSetId field as input. |
IMFMQI_MD_FORMAT | Output | This variable contains one of the following formats:
See note at the beginning of this table. |
IMFMQI_MD_PRIORITY | Output | This variable contains a decimal number in the range 0 to 999999999. |
IMFMQI_MD_PERSISTENCE | Output | This variable contains one of the following:
|
IMFMQI_MD_MSGID | Input or Output | This variable processes or receives up to a 32-byte MsgId that is processed exactly as received for input to, and as Output from, the GET command. No conversion of hexadecimal data is performed in either case. For input, the value MQMI_NONE is valid. |
IMFMQI_MD_CORRELID | Input or Output | This variable processes or receives up to a 32-byte CORRELID that is processed exactly as received for input to and as Output from the GET command. No conversion of hexadecimal data is performed in either case. For input, the following constant values is recognized and converted to their corresponding hexadecimal equivalent:
|
IMFMQI_MD_BACKOUTCOUNT | Output | This variable contains a decimal value in the range 0 to 255. |
IMFMQI_MD_REPLYTOQ | Output | This variable contains up to a 48-character name of the ReplyToQ. |
IMFMQI_MD_REPLYTOQMGR | Output | This variable contains up to a 48-character name of the ReplyToQMgr. |
IMFMQI_MD_USERIDENTIFIER | Output | This variable contains up to a 12-character UserIdentifier. |
IMFMQI_MD_ACCOUNTINGTOK | Output | This variable contains MQACT_NONE or up to a 32-byte AccountingToken. Processed exactly as received from the GET. No conversion of hexadecimal data is done. |
IMFMQI_MD_APPLIDENTITYDATA | Output | This variable contains up to a 32-character value for ApplIdentityData. |
IMFMQI_MD_PUTAPPLTYPE | Output | This variable contains a user-defined type or one of the following standard types:
|
IMFMQI_MD_PUTAPPLTYPE (continued) | Output |
See note at the beginning of this table. |
IMFMQI_MD_PUTAPPLNAME | Output | This variable contains up to a 28-character value for PutApplName. |
IMFMQI_MD_PUTDATE | Output | This variable contains an 8-character date stamp. |
IMFMQI_MD_PUTTIME | Output | This variable contains an 8-character time stamp. |
IMFMQI_MD_APPLORIGINDATA | Output | This variable contains a 4-character value for ApplOriginData. |
IMFMQI_MD_GROUPID | Output | If a MQMD_VERSION_2 MD is present, this variable may contain a 24-byte GROUPID. Processed exactly as received from the GET. No conversion of hexadecimal data is done. |
IMFMQI_MD_MSGSEQNUMBER | Output | If a MQMD_VERSION_2 MD is present, this variable may contain a decimal number in the range 1 to 999999999. |
IMFMQI_MD_OFFSET | Output | If a MQMD_VERSION_2 MD is present, this variable may contain a decimal number in the range 0 to 999999999. |
IMFMQI_MD_MSGFLAGS | Output | If a MQMD_VERSION_2 MD is present, this variable may contain one or more of the following character strings delimited by blanks:
See note at the beginning of this table. |
IMFMQI_MD_ORIGINALLENGTH | Output | This variable contains a decimal number, in the range 1 to 999999999, or MQOL_UNDEFINED. See note at the beginning of this table. |
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 IBM manual MQ Application Programming Reference or the IBM Knowledge Center for the reason code description.
Comments
Log in or register to comment.