SEND_MESSAGE procedure
The SEND_MESSAGE procedure sends an informational message to the QSYSOPR message queue.
Authorization: The caller must have:
- *OBJOPR and *ADD authorities to the QSYSOPR message queue,
- *EXECUTE authority to the library containing the message file, and
- *USE authority to the message file.
The schema is QSYS2.
- message-id
- A character string expression that identifies the message ID to send to the QSYSOPR message queue.
- message-length
- An integer value that defines the length of message-text.
- message-text
- The message text for the message.
- message-file-library
- The library that contains message-file. Can contain the special value *LIBL. The default is QSYS.
- message-file
- The message file that contains message-id. The default is QSQLMSG.
Notes
This procedure is designed to send a predefined message to the QSYSOPR message queue. The message is expected to have one substitution variable defined as *CHAR *VARY 2.
When sending a message from a Query Supervisor exit program, SQL7064 in the QSYS/QSQLMSG message file is defined for this purpose. When sending a message in other situations, it is recommended that a different message should be used.
Example
- Send a message to the QSYSOPR message queue when a critical error is diagnosed.
CALL QSYS2.SEND_MESSAGE('APP1234', 31, 'Unexpected error in MYLIB/PGM2.' , 'APPLIB', 'MYMSGF');