Here's the situation: You are writing an RPG or some other high-level language (HLL) program. You are programming a portion of the program that will probably be long running, for instance, a search procedure that is looking for a string of characters within the last names stored in the 100,000-record customer master file. This is a perfect time for a status message -- that is, a message at the bottom of the screen informing the user that the operation may take a moment. But how can you set up such a message quickly?
Status messages, the easy way
The traditional way of sending a status message is to use the Send Program Message (SNDPGMMSG) CL command or one of the message APIs. But, both of these approaches require external program calls and can be overly complicated to implement.
On the other hand, the Dispatch Message (CEEMOUT) API provides a quick and easy way of sending a "status" message (actually, the message is sent more like a notify message). And, the CEEMOUT API is a bindable API (i.e., it is a procedure), so calls to it are extremely fast.
Understanding CEEMOUT's interface
The interface of the CEEMOUT API is simple. It accepts the following two required parameters and a third optional parameter:
The CEEMOUT API requires the use operational descriptors, which we will tackle next time. We'll also discuss a code example.
About the author: Ron Turull is editor of Inside Version 5. He has more than 20 years' experience programming for and managing AS/400-iSeries systems.