Promote Message (QMHPRMM) API


  Required Parameter Group:


  Default Public Authority: *USE

  Threadsafe: Yes

The Promote Message (QMHPRMM) API promotes an escape or status message that has been sent to a call stack entry. The API replaces the message with a new escape or status message to the same call stack entry. An escape message may be promoted to another escape message or to a status message. A status message may be promoted to an escape message or to another status message. The stored severity of the new message may be overridden. The new message may be added to the job log, and the initial priority of the new message may be changed.

The message to be promoted must be an active escape message or status message, existing on the message queue of the specified call stack entry. This API causes the existing message to be handled. The source call stack entry of the new message is the same as the source call stack entry of the promoted message. The message key of the new message is returned to the caller of this API. If the new message is not monitored by the target call stack entry, an error may be returned to the caller of this API and the new message key may not be returned.

In a multithreaded job only messages on a call message queue in the thread that calls this API can be promoted. This API cannot promote messages on call message queues in other threads.


Authorities and Locks

Message File Authority
*USE
Message File Library Authority
*EXECUTE

Required Parameter Group

Invocation pointer
INPUT; POINTER

The invocation pointer to the call stack entry receiving the escape message or status message that is to be promoted. When the call stack counter parameter is other than 0, the invocation pointer points to the call stack entry from which to start counting earlier in the call stack. This locates the call stack entry that received the escape message or status message being promoted. The call stack entry you specify must be in the call stack. A null invocation pointer may be specified. If this pointer is not set, the call stack entry that called the QMHPRMM API is used.

Call stack counter
INPUT; BINARY(4)

A number identifying the location in the call stack of the call stack entry receiving the escape or status message that is to be promoted. The number is relative to the call stack entry specified in the invocation pointer parameter. It indicates how many calls up the call stack the call stack entry is from the one specified in the invocation pointer parameter. Valid values follow:


Message key
INPUT; CHAR(4)

The message key of the existing message that is to be promoted.

Message identifier
INPUT; CHAR(7)

The identifying code for the new predefined message that replaces the message being promoted.

Qualified message file name
INPUT; CHAR(20)

The name of the message file and the library in which the new predefined message resides. The first 10 characters specify the file name, and the second 10 characters specify the library. You must specify both the message file name and the library name. You can use these special values for the library name:


Message data
INPUT; CHAR(*)

The data to insert in the predefined message's substitution variables.

If there is no data to insert, a value of 0 should be specified for the length of message data parameter.

If this parameter contains pointer data, each pointer must start on a 16-byte boundary to keep the data accurate.

Length of message data
INPUT; BINARY(4)

The length of the message data, in bytes. Valid values are 0 through 32767.

Message type
INPUT; CHAR(10)

The type of the new message.

You must specify one of these values:

You may promote an escape message to another escape message or to a status message. You may promote a status message to an escape message or to another status message.

Message severity
INPUT; BINARY(4)

A number identifying the message severity that overrides the severity that is stored in the message description for the message. Valid values follow:


Log option
INPUT; CHAR(1)

A value that indicates whether the new message is to appear in the job log. Valid values follow:


Priority
INPUT; CHAR(10)

The initial priority of the new message.

You must specify one of these values:


New message key
OUTPUT;CHAR(4)

The message key of the new message that replaces the promoted message.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Error Messages



API introduced: V2R3

[ Back to top | Message Handling APIs | APIs by category ]