sendPgmMsg()

This procedure sends message to program in call stack entry.

ParameterTypeDescription
callStackEntry4096AMandatoryCall stack entry. The program name from call stack to which the message will be sent.
msgId7AMandatoryMessage id in the message file.
fields1024AOptipnalNames of fields, coma separated, for which the message was issued. Programmer can indicate the message receiver that message is connected functionally with these fields.
msgDta32767AOptionalData which will replace variables in messages
msgLen10I 0OptionalMandatory if msgData was provided. Length od message data in bytes.
msgType10AOptionalDefault value : *INF0. The type of the message. See message type list.
msgFile10AOptionalFor a predefined message, the name of the message file and the library in which it resides. The first 10 characters specify the file name, and the second 10 characters specify the library. You can use these special values for the library name: *CURLIB, *LIBL
callStackCount10I 0OptionalCall stack counter A number identifying the location in the call stack of the call stack entry to whose message queue the message is to be sent. The number is relative to the call stack entry identified by the Call stack entry parameter. It indicates how many calls up the call stack the target entry is from the one identified by the Call stack entry parameter. it could be 0 or any positive number.
callStackEntryLen10I 0OptionalLength of call stack entry The length of the value for the Call stack entry parameter. See QMHSNDPM IBM API for more details.
callStackEntryQual20AOptionalCall stack entry qualification. This parameter is used when it is necessary to further identify the call stack entry. The parameter consists of two 10 character parts. The first part is the module name qualifier and the second part is the program name qualifier. See QMHSNDPM IBM API for more details.

Message types

Message typeDescription
*CMDCommand
*COMPCompletion
*DIAGDiagnostic
*ESCAPEEscape
*INFOInformational
*INQInquiry. You can send inquiry messages only to the external message queue.
*NOTIFYNotify
*RQSRequest
*STATUSStatus

Procedure returns unique message key (4A).

Examples:

//Send simple message to MGRR0001 program message queue.
sendPgmMsg("MGRR0001" : "MSG0001");

//or
//Send message to MGRR0001 program message queue. This time
//olso the field names are provided.
sendPgmMsg("MGRR0001" : "MSG0002" : "item, warehouse");

//or
//Send message to MGRR0001 program message queue. This time
//message contains data fields.
xxData = xxItem + xxWarehouse;
sendPgmMsg("MGRR0001" : "MSG0003" 
           :"customer, warehouse"
           : xxData : %len(xxData));