MQI PUT1


This statement puts a message to a queue without the need for an OPEN and CLOSE.

Command

Parameters

IMFEXEC MQI PUT1

HCONN(hconn)

POPTS(options)

BUFFLEN(bufferlength)

BUFFER(buffer)

The following table describes the IMFEXEC MQI PUT1 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 IBM manual MQ Application Programming Reference.

Parameter

Function

Notes

HCONN

Provides the connection handle that represents the connection to the queue manager.

This parameter:

  • Specifies a variable created in an earlier CONN command
  • Is not required

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.

POPTS

Specifies the options that control the PUT1 action.

This parameter is not required.

If omitted, the PUT1 options are taken from the default variable IMFMQI_PMO_OPTIONS.

The variable IMFMQI_PMO_OPTIONS is not required. Valid PUT1 options:

  • MQPMO_SYNCPOINT
  • MQPMO_NO_SYNCPOINT
  • MQPMO_NO_CONTEXT
  • MQPMO_DEFAULT_CONTEXT
  • MQPMO_PASS_IDENTITY_CONTEXT
  • MQPMO_PASS_ALL_CONTEXT
  • MQPMO_SET_IDENTITY_CONTEXT
  • MQPMO_SET_ALL_CONTEXT
  • MQPMO_ALTERNATE_USER_AUTHORITY
  • MQPMO_FAIL_IF_QUIESCING
  • MQPMO_NONE (IBM default)
  • MQPMO_NEW_MSG_ID
  • MQPMO_NEW_CORREL_ID
  • MQPMO_ASYNC_RESPONSE
  • MQPMO_RESOLVE_LOCAL_Q
  • MQPMO_MD_FOR_OUTPUT_ONLY
  • MQPMO_RESPONSE_AS_Q_DEF

See note at the beginning of this table.

POPTS

(continued)

Specifies the options that control the PUT1 action.

When specifying multiple options, they must be enclosed within single quotation marks, for example: POPTS(‘MQPMO_NO_SYNCPOINT MQPMO_SET_ALL _CONTEXT’)

In addition to the above options, another MainView AutoOPERATOR-provided option (REMOVE_DLH) is available.

Using the REMOVE_DLH option, you can remove the Dead Letter Header from a message before PUTting it to another queue. REMOVE_DLH is added to the POPTS() keyword parameter of the IMFEXEC MQI PUT1 statement.

This option causes the message being PUT1 to be rebuilt by reloading the Encoding, CodedCharSetId and Format fields from the Dead Letter Header (DLH) into the Message Descriptor. This reloading occurs before the PUT1 statement executes. The DLH, if present, is removed from the buffer containing the data.

BUFFER

Specifies the variable that contains the message buffer data prior to issuing a PUT1.

This parameter is not required. If omitted, the variable IMFMQI_BUFFER must contain the message buffer data in order to complete the PUT1. Be aware that upon successful completion of the PUT1 statement, the original buffer variable may be different if you have specified structure variables prior to the PUT1.

For example, you may want to build a Dead Letter message by changing the format variable, IMFMQI_MD_FORMAT, to MQFMT_DEAD_LETTER_HEADER and by setting variables starting with IMFMQI_DLH_ and ending with Dead Letter (DLH) field names (see Appendix D for lists of structure variables).

In this example, MainView AutoOPERATOR updates the buffer from the variables set before issuing the IBM MQ PUT1 (see the section entitled Creating-a-message-from-variables to learn how MainView AutoOPERATOR creates message out of variables).

The Dead Letter header is prefixed in front of the data that is currently in the buffer. MainView AutoOPERATOR updates the variable specified for the buffer so that it contains the DLH structure before control is returned to the EXEC.

BUFFLEN

Specifies the length of the data used to create the message buffer data.

This parameter:

  • Is not required
  • Can specify a numeric value or the name of a variable that contains a numeric value
  • Can specify a value in the range of 0 - 32767 when using a CLIST or 0 to 16777169 when using a REXX EXEC, either by specifically citing a numeric value, or by using a variable.

If this parameter is omitted, the variable IMFMQI_BUFFLEN is used to obtain the BUFFER length. If neither is set, the length of the data in the message buffer variable is used.

The following table describes the most common Input and Output variables for the IMFEXEC MQI PUT1 statement. Any required variables must be set prior to the PUT. For structures other than the MD (message descriptor) and the OD (object descriptor), please refer to EXECs-variables. Variables used begin with 'IMFMQI_', followed by the 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 derived from IBM MQ structure field names and used in this table, see the IBM manual MQ Application Programming Reference.

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. Also note that when specifying multiple options, they must be enclosed within single quotation marks. For example, POPTS(‘MQPMO_NO_SYNCPOINT MQPMO_SET_ALL_CONTEXT’)

Variable name

Source

Notes

IMFMQI_OD_STRUCID

Input

(optional) The EXEC may or may not set this variable. If the EXEC does not set this variable, the IBM MQ default value will be used unmodified by the EXEC Manager.

IMFMQI_OD_VERSION

Input

(optional) The EXEC may or may not set this variable. If the EXEC does not set this variable, the IBM MQ default value will be used, unmodified by the EXEC Manager.

IMFMQI_OD_OBJECTTYPE

Input

(optional) The EXEC may or may not set this variable. If the EXEC does not set this variable, the IBM MQ default value will be used, unmodified by the EXEC Manager.

IMFMQI_OD_OBJECTNAME

Input

This variables contains the queue name to be opened. Up to 48 characters can be specified.

IMFMQI_OD_OBJECTQMGRNAME

Input

(optional) This variables contains the 48-character object queue manager name. The EXEC Manager does not specify any default value when this variable is not set.

IMFMQI_OD_DYNAMICQNAME

Input

(optional) This variables contains the 48-character dynamic queue name when using a model queue. The EXEC Manager does not specify any default value when this variable is not set.

IMFMQI_OD_ALTERNATEUSERID

Input

(optional) This variables contains the 12-character alternate user identifier. The EXEC Manager does not specify any default value when this variable is not set.

IMFMQI_OD_RECSPRESENT

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_OD_KNOWNDESTCOUNT

Output

This variable contains 0.

IMFMQI_OD_UNKNOWNDESTCOUNT

Output

This variable contains 0.

IMFMQI_OD_INVALIDDESTCOUNT

Output

This variable contains 0.

IMFMQI_OD_OBJECTRECOFFSET

Input

This variable contains 0.

IMFMQI_OD_RESPONSERECOFFSET

Input

This variable contains 0.

IMFMQI_OD_OBJECTRECPTR

Input

This variable contains 0.

IMFMQI_OD_RESPONSERECPTR

Input

This variable contains 0.

IMFMQI_OD_ALTERNATESECURITYID

Input

This variable exists but is null.

IMFMQI_OD_RESOLVEDQNAME

Output

This variable contains blanks.

IMFMQI_OD_RESOLVEDQMGRNAME

Output

This variable contains blanks.

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

Input

(optional) Specify one or more of the following delimited by blanks:

  • MQRO_EXCEPTION
  • MQRO_EXCEPTION_WITH_DATA
  • MQRO_EXCEPTION_WITH_FULL_DATA
  • MQRO_EXPIRATION
  • MQRO_EXPIRATION_WITH_DATA
  • MQRO_EXPIRATION_WITH_FULL_DATA
  • MQRO_COA
  • MQRO_COA_WITH_DATA
  • MQRO_COA_WITH_FULL_DATA
  • MQRO_COD
  • MQRO_COD_WITH_DATA
  • MQRO_COD_WITH_FULL_DATA
  • MQRO_PAN
  • MQRO_NAN
  • MQRO_NEW_MSG_ID
  • MQRO_PASS_MSG_ID
  • MQRO_COPY_MSG_ID_TO_CORREL_ID
  • MQRO_PASS_CORREL_ID
  • MQRO_DEAD_LETTER_Q
  • MQRO_DISCARD_MSG
  • MQRO_NONE (IBM default)

See note at the beginning of this table.

IMFMQI_MD_MSGTYPE

Input

(optional) Specify one of the following:

  • MQMT_DATAGRAM (IBM default)
  • MQMT_REQUEST
  • MQMT_REPLY
  • MQMT_REPORT

See note at the beginning of this table.

IMFMQI_MD_EXPIRY

Input

(optional) Specify a decimal number, in the range 1 to 999999999, or MQEI_UNLIMITED (IBM default).

IMFMQI_MD_FEEDBACK

Input

(optional) Specify one of the following values for report messages:

  • MQFB_NONE (IBM default)
  • MQFB_COA
  • MQFB_COD
  • MQFB_EXPIRATION
  • MQFB_PAN
  • MQFB_NAN
  • MQFB_QUIT

See note at the beginning of this table.

In addition, this variable can contain any reason code from the following sources:

  • IMS-bridge feedback codes
  • CICS-bridge feedback codes
  • MQ reason codes
  • User-specified numeric codes

IMFMQI_MD_ENCODING

Input

(optional) Specify one of the following:

MQENC_NATIVE (IBM default) or any decimal number up to 999999999.

IMFMQI_MD_CODEDCHARSETID

Input

(optional) This variables contains one of the following:

  • MQCCSI_Q_MGR
  • MQCCSI_EMBEDDED
  • Or any decimal number up to 999999999.

See note at the beginning of this table.

IMFMQI_MD_FORMAT

Input

(optional) Specify one of the following:

  • MQFMT_NONE (IBM default)
  • MQFMT_ADMIN
  • MQFMT_CHANNEL_COMPLETED
  • MQFMT_CICS
  • MQFMT_COMMAND_1
  • MQFMT_COMMAND_2
  • MQFMT_DEAD_LETTER_HEADER
  • MQFMT_EVENT
  • MQFMT_IMS
  • MQFMT_IMS_VAR_STRING
  • MQFMT_MD_EXTENSION
  • MQFMT_PCF
  • MQFMT_REF_MSG_HEADER
  • MQFMT_STRING
  • MQFMT_TRIGGER
  • MQFMT_WORK_INFO_HEADER
  • MQFMT_XMIT_Q_HEADER
  • MQFMT_RF_HEADER
  • MQFMT_RF_HEADER_2

See note at the beginning of this table.

IMFMQI_MD_PRIORITY

Input

(optional) Specify a decimal number in the range 0 to 999999999 or MQPRI_PRIORITY_AS_Q_DEF (IBM default).

IMFMQI_MD_PERSISTENCE

Input

(optional) Specify one of the following:

  • MQPER_PERSISTENT
  • MQPER_NOT_PERSISTENT
  • MQPER_PERSISTENCE_AS_Q_DEF (IBM default)

See note at the beginning of this table.

IMFMQI_MD_MSGID

Input or Output

(optional) Specify up to a 32-byte MsgId. Processed exactly as received. No conversion of hexadecimal data is done. For input, the value MQMI_NONE is valid. After a successful PUT, the variable is set from the field in the message descriptor.

IMFMQI_MD_CORRELID

Input or Output

(optional) Specify up to a 32-byte CORRELID. Processed exactly as received. No conversion of hexadecimal data is done. After a successful PUT, the variable is set from the field in the message descriptor. For input, the following values are valid:

  • MQCI_NONE (IBM default)
  • MQCI_NEW_SESSION

IMFMQI_MD_BACKOUTCOUNT

NA

This variable is not used for PUT.

IMFMQI_MD_REPLYTOQ

Input

(optional) Specify up to a 48-character name of the ReplyToQ. The IBM default value is 48 blanks.

IMFMQI_MD_REPLYTOQMGR

Input

(optional) Specify up to a 48-character name of the ReplyToQMgr. The IBM default value is 48 blanks.

IMFMQI_MD_USERIDENTIFIER

Input or Output

(optional) Specify up to a 12-character UserIdentifier. See the IBM manual MQ Application Programming Reference to determine the circumstances under which the UserIdentifier field is used as Input and Output.

IMFMQI_MD_ACCOUNTINGTOKEN

Output

(optional) This variables contains MQACT_NONE (IBM default) or up to a 32-byte AccountingToken. Processed exactly as received. No conversion of hexadecimal data is done.

IMFMQI_MD_APPLIDENTITYDATA

Input or Output

(optional) This variables contains up to a 32-character value for ApplIdentityData. See the IBM manual MQ Application Programming Reference to determine the circumstances under which the ApplIdentityData field is used as Input and Output.

IMFMQI_MD_PUTAPPLTYPE

Input or Output

(optional) Specify one of the following standard types or a numeric user-defined type:

  • MQAT_AIX
  • MQAT_BROKER
  • MQAT_CICS
  • MQAT_CICS_BRIDGE
  • MQAT_CICS_VSE
  • MQAT_DEFAULT
  • MQAT_DOS
  • MQAT_DQM
  • MQAT_GUARDIAN
  • MQAT_IMS
  • MQAT_IMS_BRIDGE
  • MQAT_JAVA
  • MQAT_MVS
  • MQAT_NO_CONTEXT
  • MQAT_NOTES_AGENT
  • MQAT_NSK
  • MQAT_OS2
  • MQAT_OS390
  • MQAT_OS400
  • MQAT_QMGR
  • MQAT_UNKNOWN
  • MQAT_UNIX

IMFMQI_MD_PUTAPPLTYPE

(continued)

Input or Output

(optional) Specify one of the following standard types or a numeric user-defined type:

  • MQAT_VMS
  • MQAT_VOS
  • MQAT_WINDOWS
  • MQAT_WINDOWS_NT
  • MQAT_XCF

See note at the beginning of this table.

See the IBM manual MQ Application Programming Reference to determine the circumstances under which the PutApplType field is used as Input and Output.

IMFMQI_MD_PUTAPPLNAME

Input or Output

(optional) Specify up to a 28-character value for PutApplName. See the IBM manual MQ Application Programming Reference to determine the circumstances under which the PutApplName field is used as Input and Output.

IMFMQI_MD_PUTDATE

Input or Output

(optional) Specify an 8-character date stamp. See the IBM manual MQ Application Programming Reference to determine the circumstances under which the PutDate field is used as Input and Output.

IMFMQI_MD_PUTTIME

Input or Output

(optional) Specify an 8-character time stamp. See the I IBM manual MQ Application Programming Reference to determine the circumstances under which the PutTime field is used as Input and Output.

IMFMQI_MD_APPLORIGINDATA

Input or Output

(optional) Specify a 4-character value for ApplOriginData. See the IBM manual MQ Application Programming Reference to determine the circumstances under which the ApplOriginData field is used as Input and Output.

IMFMQI_MD_GROUPID

Input or Output

(optional) If the current MD is an MQMD_VERSION_2 MD, this variable may be set to a 24-byte GROUPID. Processed exactly as received from the PUT1. No conversion of hexadecimal data is done. See the IBM manual MQ Application Programming Reference to determine the circumstances under which the Grouped field is used as Input and Output.

IMFMQI_MD_MSGSEQNUMBER

Input or Output

(optional) If a MQMD_VERSION_2 MD is present, this variable may contain a decimal number in the range 1 to 999999999 (IBM default 1). See the IBM manual MQ Application Programming Reference to determine the circumstances under which the MsgSeqNumber field is used as Input and Output.

IMFMQI_MD_OFFSET

Input or Output

(optional) If a MQMD_VERSION_2 MD is present, this variable may contain a decimal number in the range 0 to 999999999 (IBM default 0). See the IBM manual MQ Application Programming Reference to determine the circumstances under which the Offset field is used as Input and Output.

IMFMQI_MD_MSGFLAGS

Input

(optional) If a MQMD_VERSION_2 MD is present, this variable may contain one or more of the following character strings delimited by blanks:

  • MQMF_SEGMENTATION_INHIBITED
  • MQMF_SEGMENTATION_ALLOWED
  • MQMF_MSG_IN_GROUP
  • MQMF_LAST_MSG_IN_GROUP
  • MQMF_SEGMENT
  • MQMF_LAST_SEGMENT
  • MQMF_NONE (IBM default)

See note at the beginning of this table.

IMFMQI_MD_ORIGINALLENGTH

Input

(optional) This variables contains a decimal number, in the range 1 to 999999999, or MQOL_UNDEFINED.

IMFMQI_STRUCTURES

Output

This variables contains a blank-delimited list of the IBM MQ structures used in the creation of the message. For example, in the case of a Dead Letter message, the contents would contain at least, ‘MD OD DLH’.

IMFMQI_OFFSETS

Output

This variables contains a blank-delimited list of the offsets of the structures used in the creation of 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 after issuing the PUT. The number of entries in the list is always one more than the number of structures participating in the operation, including MD, which participates in the operation but is not part of the message buffer.

This is because an entry for the offset of the application data is included in the list. The value ‘NONE’ is always used for a structure that does not exist in the buffer but is used in creating the message for PUT, such as ‘MD’. For example, if the message was a dead letter message and contained application data, the variable may 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.

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.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*