CL Command Reference - CRTDTAQ
CL Command List > CRTDTAQ Reference
Description:
The Create Data Queue (CRTDTAQ) command creates a data queue and stores it in a specified library.
Data queues, which are a type of OS/400 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.
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.
Restrictions: Users of this command must have add (*ADD) authority for the library where the data queue is located.
Examples:
Example 1: Creating a Standard Data Queue
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.
Example 2: Creating a DDM Data Queue to Access a Data Queue at Another iSeries 400
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 an iSeries 400 in New York.
Example 3: Creating a Data Queue Specifying Size Attributes and Automatic Reclaim
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.