Command reference / object

CRTDTAQ

Create Data Queue

The Create Data Queue (CRTDTAQ) command creates a data queue and stores it in a specified library. Data queues, which are a type of i5/OS system object, are used to communicate and store data used by several programs either within a job or between jobs. Multiple jobs can send or receive data from a single queue. For more information about data queues on output queues, see the Printing category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/. The Create Data Queue (CRTDTAQ) command optionally creates a distributed data management (DDM) data queue when TYPE(*DDM) is specified. The DDM data queue is used as a reference data queue by programs to access data queues located on a remote (target) system in the DDM network. Programs on the local (source) system refer to a remote data queue by the DDM data queue's name, not by the remote data queue's name. The DDM data queue name, however, can be the same as the remote data queue name. The DDM data queue on the source system contains the name of the remote data queue and the name of the remote (target) system on which the remote data queue is located.

Allowed environments: *ALL. Positional parameters: 2.

Restrictions

Parameters

DTAQ Data queue

Specifies the data queue to be created. This is a required parameter.

Type
*QUAL
Required
Yes
Case
Uppercase
name (Data queue)
Specify the name of the data queue.
*CURLIB
The current library for the job is used to locate the data queue. If no current library entry exists in the library list, QGPL is used.
name (Library)
Specify the library where the data queue is located.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Data queue Data 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

MAXLEN Maximum entry length

Specifies the maximum length of the entry that is sent to the data queue. Notes: If the data queue is associated with an output queue, the maximum length value should be at least 128. This parameter is valid only when TYPE(*STD) is specified.

Type
*INT4
Required
No
Range
1 to 64512
Case
Uppercase
1-64512
Specify the maximum entry length. Valid values range from 1 through 64512.

TYPE Type

Specifies the type of data queue to be created. A standard data queue, a distributed data management (DDM) data queue, or a display data queue can be created.

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

Allowed values: *STD, *DSP, *DDM

*STD
A standard data queue is created. The MAXLEN parameter is required with the use of this value.
*DDM
A DDM data queue is created. This value requires the name of the remote data queue accessed (RMTDTAQ parameter) and the name of the remote (target) system that the data queue is located on (RMTLOCNAME parameter).
*DSP
A display data queue is created. The data queue will be used with a display file. An interactive job waiting on this data queue will be eligible for inactive job time-out. The MAXLEN parameter is required with the use of this value.

FORCE Force to auxiliary storage

Specifies whether the data queue is forced to auxiliary storage when entries are sent or received for this data queue. Note: This parameter is valid only when TYPE(*STD) is specified.

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

Allowed values: *NO, *YES

*NO
Send and receive operations are not immediately forced to auxiliary storage.
*YES
Send and receive operations are immediately forced to auxiliary storage. This ensures that the changes are not lost if a system failure occurs. This requires additional system overhead.

SEQ Sequence

Specifies the sequence in which entries are received from the data queue. Notes: If the data queue is associated with an output queue, the sequence value should be *FIFO or *LIFO." This parameter is valid only when TYPE(*STD) is specified.

Type
*CHAR
Required
No
Default
*FIFO
Length
6
Case
Uppercase

Allowed values: *FIFO, *LIFO, *KEYED

*FIFO
Data queue entries are received in a first-in first-out sequence.
*LIFO
Data queue entries are received in a last-in first-out sequence.
*KEYED
Data queue entries are received by key. A key is a prefix added to an entry by its sender.

KEYLEN Key length

Specifies the number of characters in the key. Note: This parameter is valid only when SEQ(*KEYED) and TYPE(*STD) are specified.

Type
*INT4
Required
No
Range
1 to 256
Case
Uppercase
1-256
Specify the key length. Valid values range from 1 through 256.

SENDERID Include sender ID

Specifies a sender ID to be attached to each message sent to the Data Queue. The ID contains the job name and the sender's current user profile. Note: This parameter is valid only when TYPE(*STD) is specified.

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

Allowed values: *NO, *YES

*NO
Messages sent do not include the sender ID.
*YES
Messages sent include the sender ID.

SIZE Queue size

Specifies the amount of storage allocated for the data queue. Parameter elements consist of the maximum number of entries and the initial number of entries for the data queue. Note: This parameter is valid only when TYPE(*STD) is specified. One of the following is used to specify the maximum number of entries that can be added to a data queue. Specifies the amount of storage that will initially be allocated to the data queue. The queue will be created to hold the initial number of entries of the maximum entry length.

Type
*ELEM
Required
No
Case
Uppercase
16
Initially, storage is allocated to hold 16 entries of the maximum entry length.
*MAX16MB
The system will calculate the maximum number of entries that can be added to the queue and will be allowed to grow to a maximum size of approximately 16 megabytes(MB). One megabyte equals 1,048,576 bytes. This value with an initial number of entries of 16 provides compatibility with releases of the operating system earlier than Version 4 Release 5 Modification 0 (V4R5M0).
*MAX2GB
The system will calculate the maximum number of entries that can be added to the data queue. The data queue will be allowed to grow to a maximum size of approximately 2 gigabytes (GB). One gigabyte equals 1,073,741,824 bytes.
number-of-entries
The data queue will be allowed to hold at least this number of entries. Based on the extend size used by the machine, the maximum number of data queue entries may be slightly higher than the specified value. The value specified must be greater than 0.
initial-number-of-entries
Specify the value for the initial number of entries that the data queue can hold. The value must be greater than 0.
Elements in order

Maximum number of entries Maximum number of entries

Type
*INT4
Required
No
Default
*MAX16MB
Case
Uppercase

Suggested / special values: *MAX16MB, *MAX2GB

Initial number of entries Initial number of entries

Type
*INT4
Required
No
Default
16
Case
Uppercase

AUTORCL Automatic reclaim

Specifies whether the storage allocated for the data queue is automatically reclaimed (released) when the data queue is empty. Note: This parameter is valid only when TYPE(*STD) is specified.

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

Allowed values: *NO, *YES

*NO
The storage allocated for the data queue is not released when the data queue is empty.
*YES
The storage allocated for the data queue is released when the data queue is empty. Storage for the Initial Number of Entries value will remain allocated.

TEXT Text 'description'

Specifies text that briefly describes the data queue.

Type
*CHAR
Required
No
Default
*BLANK
Length
50
Case
Mixed case

Suggested / special values: *BLANK

*BLANK
No text is specified.
'description'
Specify no more than 50 characters, enclosed in apostrophes.

AUT Authority

Specifies the authority you are giving to users who do not have specific authority for the object, who are not on an authorization list, and whose group profile or supplemental group profiles do not have specific authority for the object.

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

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

*LIBCRTAUT
The system determines the authority for the object by using the value specified for the Create authority (CRTAUT) parameter on the Create Library command (CRTLIB) for the library containing the object to be created. If the value specified for the CRTAUT parameter is changed, the new value will not affect any existing objects.
*CHANGE
The user can perform all operations on the object except those limited to the owner or controlled by object existence (*OBJEXIST) and object management (*OBJMGT) authorities. The user can change and perform basic functions on the object. *CHANGE authority provides object operational (*OBJOPR) authority and all data authority. If the object is an authorization list, the user cannot add, change, or remove users.
*ALL
The user can perform all operations except those limited to the owner or controlled by authorization list management (*AUTLMGT) authority. The user can control the object's existence, specify the security for the object, change the object, and perform basic functions on the object. The user also can change ownership of the object.
*USE
The user can perform basic operations on the object, such as running a program or reading a file. The user cannot change the object. Use (*USE) authority provides object operational (*OBJOPR), read (*READ), and execute (*EXECUTE) authorities.
*EXCLUDE
The user cannot access the object.
name
Specify the name of an authorization list to be used for authority to the object. Users included in the authorization list are granted authority to the object as specified in the list. The authorization list must exist when the object is created.

Examples

CRTDTAQ DTAQ(DEPTADTA) MAXLEN(100) AUT(*EXCLUDE) TEXT('Special data + files for DEPTA')

This command creates a data queue named DEPTADTA and puts it in the current library; the maximum length entry is 100. Because AUT(*EXCLUDE) is specified, the data queue can be used and controlled only by the user who created the queue and by users who have been given specific authority. Users in Department A can be given authority to use this data queue by using the Grant Object Authority (GTROBJAUT) command.

CRTDTAQ DTAQ(SOURCE/SALES) TYPE(*DDM) RMTDTAQ(REMOTE/SALES) RMTLOCNAME(NEWYORK)

This command creates a DDM data queue named SALES and stores it in the SOURCE library on the source system. This DDM data queue uses the remote location named NEWYORK to access a remote data queue named SALES stored in the REMOTE library on a system in New York.

CRTDTAQ DTAQ(MYLIB/MYDTAQ) MAXLEN(80) SIZE(*MAX2GB 100) AUTORCL(*YES)

This command creates a data queue named MYDTAQ and stores it in the MYLIB library. The maximum entry length is 80 bytes and the queue entries are received in a first-in-first-out (FIFO) sequence. The data queue will initially have storage allocated to hold 100 entries. The data queue can grow to a maximum size of approximately 2 gigabytes. If all queue entries are received, storage for the data queue will be automatically reclaimed.

IBM command documentation

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