17.08.2013 Views

System i: Programming Message Handling APIs - IBM

System i: Programming Message Handling APIs - IBM

System i: Programming Message Handling APIs - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Message</strong> <strong>Handling</strong> <strong>APIs</strong><br />

The message handling <strong>APIs</strong> can be used to work with i5/OS ®<br />

messages. They allow you to perform the<br />

following tasks:<br />

v Send messages to users or programs.<br />

v Receive messages from a message queue.<br />

v Handle errors.<br />

v Return message and message queue information.<br />

v Return message description and message file information.<br />

Before you use the message handling <strong>APIs</strong>, read the following topics:<br />

v “<strong>Message</strong> <strong>Handling</strong> Terms and Concepts” on page 196. This topic briefly describes the elements of<br />

i5/OS messages and message handling.<br />

v Control language. For complete background information, see the topic collection about messages.<br />

The message handling <strong>APIs</strong> are:<br />

v “Change Exception <strong>Message</strong> (QMHCHGEM) API” on page 3 (QMHCHGEM) changes an exception<br />

message on a call message queue. This API allows the current program to perform a variety of actions<br />

on an exception message that was sent to its caller, a previous caller, or itself.<br />

v “Control Job Log Output (QMHCTLJL) API” on page 6 (QMHCTLJL) controls the production of a job<br />

log when the related job ends or when the job message queue becomes full and the print-wrap option<br />

is in effect for the job.<br />

v “List Job Log <strong>Message</strong>s (QMHLJOBL) API” on page 13 (QMHLJOBL) lists messages from the job<br />

message queue of a job. This function gets the requested message information and returns it in a user<br />

space in the format specified in the parameter list.<br />

v “List Nonprogram <strong>Message</strong>s (QMHLSTM) API” on page 30 (QMHLSTM) lists messages from one or<br />

two nonprogram message queues. This function gets the requested message information and returns it<br />

in a user space in the format specified in the parameter list.<br />

v “Move Program <strong>Message</strong>s (QMHMOVPM) API” on page 48 (QMHMOVPM) moves messages from one<br />

call message queue to the message queue of an earlier call stack entry in the call stack. This is<br />

especially useful for error handling.<br />

v<br />

“Open List of History Log <strong>Message</strong>s (QMHOLHST) API” on page 54 (QMHOLHST) provides<br />

information about messages that were sent to the QHST message queue.<br />

v “Open List of Job Log <strong>Message</strong>s (QGYOLJBL) API” on page 65 (QGYOLJBL) lists messages from a job<br />

log. Returned messages are sorted by their sending date and time unless the message being listed is a<br />

reply message to an inquiry, a sender’s copy, or a notify type of message.<br />

v “Open List of <strong>Message</strong>s (QGYOLMSG) API” on page 77 (QGYOLMSG) provides information on<br />

messages for the current user, a specific user, or one specific nonprogram message queue.<br />

v “Promote <strong>Message</strong> (QMHPRMM) API” on page 91 (QMHPRMM) promotes an escape or status<br />

message that was sent to a call stack entry. That is, the message is handled and replaced with a new<br />

escape or status message. You may promote an escape message to another escape message or to a<br />

status message. You may promote a status message to an escape message or to another status message.<br />

v “Receive Nonprogram <strong>Message</strong> (QMHRCVM) API” on page 94 (QMHRCVM) receives a message from<br />

a nonprogram message queue, providing information about the sender of the message as well as the<br />

message itself. This API is similar in function to the Receive <strong>Message</strong> (RCVMSG) command with the<br />

MSGQ parameter.<br />

© Copyright <strong>IBM</strong> Corp. 1998, 2008 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!