Predefined messages are stored in a message file.
You can create your own message files and message descriptions.
By creating predefined messages, you can use the same message in several procedures
or programs but define it only once. You can also change and translate predefined
messages into languages other than English (based on the user viewing the
messages) without affecting the procedures and programs that use them. If
the messages were defined in the procedure or program, the module
or program would have to be recompiled when you change the messages.
In
addition to creating your own messages and message files, the system message
handling function allows you to:
- Create and change message queues (Create Message Queue (CRTMSGQ), Change
Message Queue (CHGMSGQ), and Work with Message Queues (WRKMSGQ) commands)
- Create and change message files (Create Message File (CRTMSGF), Change
Message File (CHGMSGF) commands)
- Add message descriptions (Add Message Description (ADDMSGD) command)
- Change message descriptions (Change Message Description (CHGMSGD) command)
- Remove message descriptions (Remove Message Description (RMVMSGD) command)
- Send immediate messages (Send Message (SNDMSG), Send
Break Message (SNDBRKMSG), Send Program Message (SNDPGMMSG),
and Send User Message (SNDUSRMSG) commands)
- Display messages in a message queue (Display Messages (DSPMSG) and Work
with Messages (WRKMSG))
- Display message descriptions in a message file (Display Message
Description (DSPMSGD) and Work with Message Descriptions
(WRKMSGD) commands)
- Use a CL procedure or program to:
- Send a message to a workstation user or the system operator (Send
User Message (SNDUSRMSG) command)
- Send a message to a message queue (Send Program Message (SNDPGMMSG) command)
- Receive a message from a message queue (Receive Message (RCVMSG) command)
- Send a reply for a message to a message queue (Send Reply (SNDRPY) command)
- Retrieve a message from a message file (Retrieve Message (RTVMSG) command)
- Remove a message from a message queue (Remove Message (RMVMSG) command)
- Monitor for escape, notify, and status messages that are sent to a call
message queue (Monitor Message (MONMSG) command)
- Use the system reply list to specify the replies for predefined inquiry
messages sent by a job (Add Reply List Entry (ADDRPYLE), Change
Reply List Entry (CHGRPYLE), Remove Reply List Entry (RMVRPYLE),
and Work with Reply List Entry (WRKRPYLE) commands)
When a message is sent, it is defined as one of the following types:
- Informational (*INFO). A message that conveys information about the condition
of a function.
- Inquiry (*INQ). A message that conveys information but also asks for
a reply.
- Notify (*NOTIFY). A message that describes a condition for which a procedure
or program requires corrective action or a reply from its calling procedure
or program. A procedure or program can monitor for the arrival of notify messages
from the programs or procedures it calls.
- Reply (*RPY). A message that is a response to a received inquiry or notify
message.
- Sender's copy (*COPY). A copy of an inquiry or notify message that is
kept by the sender.
- Request (*RQS). A message that requests a function from the receiving
procedure or program. (For example, a CL command is a request message.)
- Completion (*COMP). A message that conveys completion status of work.
- Diagnostic (*DIAG). A message about errors in the processing of a system
function, in an application program, or in input data.
- Status (*STATUS). A message that describes the status of the work done
by a procedure or program. A procedure or program can monitor for the arrival
of status messages from the program or procedure it calls, but the status
message will not appear in a job log. Status messages sent to the external
message queue (*EXT) are shown at the display station and can be used to inform
the display station user of an operation in progress.
- Escape (*ESCAPE). A message that describes a condition for which a procedure
or program must end abnormally. A procedure or program can monitor for the
arrival of escape messages from the program or procedure it calls or from
the machine. Control does not return to the sending program after an escape
message is sent.