Command reference / msg

CRTMSGQ

Create Message Queue

Creates a user-defined message queue in a specified library, to hold predefined or immediate messages. The queue is created with DLVRY(*HOLD), PGM set to *DSPMSG and *ALWRPY, SEV(00), and RESET(*NO). These attributes cannot be set on CRTMSGQ; change them later with CHGMSGQ. Put the queue in a library that all users who send and receive messages on it can access with *USE authority. QSYSOPR ships with MSGQFULL(*WRAP); if it is recreated after damage, that value is reset to *WRAP.

Allowed environments: *ALL. Positional parameters: 1.

Parameters

MSGQ Message queue

Specifies the message queue to be created. This is a required parameter. The library qualifier defaults to *CURLIB.

Type
*QUAL
Required
Yes
Case
Uppercase
*CURLIB
The job's current library is used; if none is in the library list, QGPL is used.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Message queue Message queue

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*CURLIB
Length
10
Case
Uppercase

Suggested / special values: *CURLIB

TEXT Text 'description'

Specifies the text that briefly describes the object. No more than 50 characters.

Type
*CHAR
Required
No
Default
*BLANK
Length
50
Case
Uppercase

Suggested / special values: *BLANK

*BLANK
No text is specified.

FORCE Force to auxiliary storage

Specifies whether changes to the queue description, and messages added to or removed from the queue, are forced immediately to auxiliary storage. This protects them if a system failure occurs.

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

Allowed values: *NO, *YES

*NO
Changes are not immediately forced to auxiliary storage.
*YES
Changes to the description and messages are immediately forced to auxiliary storage.

SIZE Queue size

Specifies the initial storage size, the size of each increase, and the maximum number of increases, in KB. Defaults are 3, 1, and *NOMAX.

Type
*ELEM
Required
No
Case
Uppercase
*NOMAX
The number of increases is not limited by the user; the system determines the maximum size.
Elements in order

Initial storage size Initial storage size

Type
*INT4
Required
No
Default
3
Case
Uppercase

Increment storage size Increment storage size

Type
*INT4
Required
No
Default
1
Case
Uppercase

Maximum increments Maximum increments

Type
*INT4
Required
No
Default
*NOMAX
Case
Uppercase

Suggested / special values: *NOMAX

AUT Authority

Specifies the authority given to users who have no specific authority, are not on an authorization list, and whose group profiles have no specific authority.

Type
*NAME
Required
No
Default
*LIBCRTAUT
Length
10
Case
Uppercase

Suggested / special values: *LIBCRTAUT, *CHANGE, *ALL, *USE, *EXCLUDE

*LIBCRTAUT
Uses the CRTAUT value of the library containing the new queue, at creation time.
*CHANGE
All operations except those limited to the owner or to object existence and management authorities.
*ALL
All operations except those limited to the owner or AUTLMGT authority, including changing ownership.
*USE
Basic operations such as reading messages from the queue; the user cannot change it.
*EXCLUDE
The user cannot access the object.

ALWALR Allow alerts

Specifies whether the queue allows alerts to be generated from alert messages sent to it.

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

Allowed values: *NO, *YES

*NO
Alerts cannot be generated from this queue.
*YES
Alerts can be generated from this queue.

CCSID Coded character set ID

Specifies the CCSID associated with the queue. It applies only to immediate messages and to character message data that can be converted.

Type
*INT4
Required
No
Default
*HEX
Range
1 to 65535
Case
Uppercase

Suggested / special values: *MSG, *HEX, *JOB

*HEX
Messages are not converted; the queue CCSID is 65535.
*MSG
Messages are not converted when sent; the sending job's CCSID is saved for later conversion. The queue CCSID is 65534.
*JOB
The queue CCSID is the CCSID of the job running the command.

MSGQFULL Message queue full action

Specifies the action to take when the message queue is full.

Type
*CHAR
Required
No
Default
*SNDMSG
Length
7
Case
Uppercase

Allowed values: *SNDMSG, *WRAP

*SNDMSG
CPF2460 is sent to the program or user that is sending the message to the full queue.
*WRAP
The oldest informational and answered messages are removed to make room; unanswered inquiry messages are removed if still needed, after their default reply is sent.

Examples

CRTMSGQ MSGQ(MYQ) SIZE(3 3 *NOMAX) TEXT('Message queue for inventory transactions') AUT(*CHANGE)

Creates message queue MYQ in the current library, with an initial size of 3 KB that grows in 3 KB increments with no user-set limit. All users are authorized to send messages to the queue and read its messages.

IBM command documentation

Generated from os/cl/catalog/CRTMSGQ.json and os/cl/help/CRTMSGQ.json.