The following list of ibm as400 commands and APIs are used for receiving/sending messages. The APIs can be used in any program, whereas the commands are restricted to CL.
1. SNDPGMMSG. The Send Program Message (SNDPGMMSG) command sends a message to a named message queue or to a call message queue. A call message queue can be the *EXT external message queue or a message queue associated with a call stack entry. Each time a program or procedure is called a new message queue is associated with its call stack entry. The message queue is identified by the name of its associated program or procedure.
2. QMHSNDPM. The Send Program Message (QMHSNDPM) API sends a as400 message to a call message queue or the external message queue. (The external message queue is the part of the job message queue that handles messages between an interactive job and the work station user. It is not associated with a specific call stack entry.) This API allows the current call stack entry to send a message to its caller, a previous caller, or itself.
3. QMHSNDM. The Send Nonprogram Message (QMHSNDM) API sends a message to a nonprogram message queue so your program can communicate with another job or user
4. RCVMSG. The Receive Message (RCVMSG) command is used by a program to receive a message previously sent to a message queue. The RCVMSG command receives messages from a job message queue (a message queue associated with a call stack entry or the external message queue (*EXT)), or from a named message queue. The program can receive a message from a message queue associated with its own call stack entry or from a message queue associated with another call stack entry
5. QMHRCVPM. The Receive Program Message (QMHRCVPM) API receives a message from a call message queue or external message queue and returns information describing the message
6. QMHRCVM. The Receive Nonprogram Message (QMHRCVM) API receives a message from a nonprogram message queue. To receive a message from a program message queue or from the external message queue, see Receive Program Message API.
More tips on handling messages on IBM as400 to follow...