MSGQ_SEND

LANSA Composer

MSGQ_SEND

This activity sends a message to a named message queue on the IBM i server.  It is supported only on IBM i servers.

You can use this activity to send an impromptu message or a pre-defined message.

An impromptu message is one for which the message text is entirely supplied at run-time.  To send an impromptu message, specify the message text in the MSG parameter value.  The MSGID, MSGF, MSGFLIB and MSGDTA parameter values are ignored if MSG is specified.

A pre-defined message uses a message description contained in a message file to provide the text for the message.  To send a pre-defined message, do not provide a value for the MSG parameter but instead specify the message identifier in the MSGID parameter and specify the message file that contains the message description in the MSGF parameter (and the MSGFLIB parameter, if necessary).  When using a pre-defined message you may also provide message substitution values using the MSGDTA parameter for messages that are defined to use them.

The message is always sent with a message type of *INFO.

Refer also to the companion MSGQ_RECEIVE and WATCH_MSGQ activities that allow you to receive messages from a named message queue.  Refer to IBM i documentation concerning message queues, message descriptions and message files for further information about the operating system features upon which this activity depends.

INPUT Parameters:

TOMSGQ : Required

This parameter must specify the name of the message queue to which the message is sent.

TOMSGQLIB: Optional

This parameter may specify the name of the library containing the message queue.  If not specified, a default of *LIBL is used which means the library list is used to locate the named message queue.

MSG: Optional

This parameter may specify the message text for an impromptu message.  If message text is specified in this parameter, any values specified in the MSGID, MSGF, MSGFLIB and MSGDTA parameters are ignored.

MSGID: Optional

Specifies the message identifier for a pre-defined message description contained in the message file named in the MSGF parameter.  The message identifier is an alphanumeric value of seven characters and numbers.  For example, CPF9898 is the message identifier for a general-purpose message description supplied with the IBM i operating system in message file QCPFMSG.  This value is ignored if impromptu message text is specified in the MSG parameter.

MSGF: Optional

Specifies the name of the message file containing the pre-defined message description identified by the MSGID parameter.  For example, QCPFMSG is the name of a message file supplied with the IBM i operating system, but you may use message files of your own as well.  This value is ignored if impromptu message text is specified in the MSG parameter.

MSGFLIB: Optional

This parameter may specify the name of the library containing the message file identified by the MSGF parameter.  If not specified, a default of *LIBL is used which means the library list is used to locate the named message file.  This value is ignored if impromptu message text is specified in the MSG parameter.

MSGDTA: Optional

When using a pre-defined message, this parameter may specify a string containing one or more substitution values that are used as message data fields within the pre-defined message.  This value is ignored if impromptu message text is specified in the MSG parameter.

OUTPUT Parameters:

There are no output parameters