Message queue

A message queue is an object on which messages are placed when they are sent to a person or a program. A message queue is used when a user sends or receives messages.

Add User prompt:
Not shown
CL parameter:
MSGQ
Length:
10 (message queue name) 10 (library name)
Authority:
*USE for message queue, if it exists. *EXECUTE for the message queue library.

If the message queue does not exist, it is created when the profile is created or changed. The message queue is owned by the profile being created or changed. The user creating the profile is given *ALL authority to the message queue.

If the message queue for a user profile is changed using the Change User Profile (CHGUSRPRF) command, the previous message queue is not automatically deleted by the system.

Table 1. Possible values for MSGQ:
*USRPRF A message queue with the same name as the user profile name is used as the message queue for this user. If the message queue does not exist, it is created in library QUSRSYS.
message- queue-name Specify the message queue name that is used for this user. If you specify a message queue name, you must specify the library parameter.
Table 2. Possible values for MSGQ Library:
*LIBL The library list is used to locate the message queue. If the message queue does not exist, you cannot specify *LIBL.
*CURLIB The current library for the job is used to locate the message queue. If no current library entry exists in the library list, QGPL is used. If the message queue does not exist, it is created in the current library or QGPL.
library- name Specify the library where the message queue is located. If the message queue does not exist, it is created in this library.

Recommendations: Give each user profile a unique message queue, preferably with the same name as the user profile.