A message is a communication sent from one user, program, or procedure
to another.
System messages can report both status information and error conditions.
Most data processing systems provide communications between the system and
the operator to handle errors and other conditions that occur during processing. i5/OS™ also
provides message handling functions that support two-way communications between
programs and system users, between programs, between procedures within a program,
and between system users. Two types of messages are supported:
- Immediate messages, which are created by the program or system user when
they are sent and are not permanently stored in the system.
- Predefined messages, which are created before they are used. These messages
are placed in a message file when they are created, and retrieved from that
file when they are used.
Because messages can be used to provide communications between programs,
between procedures in a program, and between programs and users, using the i5/OS message
handling functions should be considered when developing applications. The
following concepts of message handling are important to application development:
- Messages can be defined in messages files, which are outside the programs
that use them, and variable information can be provided in the message text
when a message is sent. Because messages are defined outside the programs,
the programs do not have to be changed when the messages are changed. This
approach also allows the same program to be used with message files containing
translations of the messages into different languages.
- Messages are sent to and received from message queues, which are separate
objects on the system. A message sent to a queue can remain on the queue
until it is explicitly received by a program or workstation user.
- A program can send messages to a user who requested the program regardless
of what workstation that user has signed on to. Messages do not have to be
sent to a specific device; one program can be used from different workstations
without change.