CLP中的DATAQ介绍

发表于:2007-05-26来源:作者:点击数: 标签:
Data queues are a type of system object that you can create, to which one HLL procedure or program can send data, and from which another HLL procedure or program can receive data. The receiving program can be a lr eady waiting for the data

Data queues are a type of system object that you can create, to which one HLL procedure or program can send data, and from which another HLL procedure or program can receive data. The receiving program can be already waiting for the data, or can receive the data later.

The advantages of using data queues are:

* Using data queues frees a job from performing some work. If the job is an interactive job, this can provide better response time and decrease the size of the interactive program and its process aclearcase/" target="_blank" >ccess group (PAG). This, in turn, can help overall system performance. For example, if several work station users enter a transaction that involves updating and adding to several files, the system can perform better if the interactive jobs submit the request for the transaction to a single batch processing job.

* Data queues are the fastest means of asynchronous communication between two jobs. Using a data queue to send and receive data requires less overhead than using database files, message queues, or data areas to send and receive data.

* You can send to, receive from, and retrieve a description of a data queue in any HLL procedure or program by calling the QSNDDTAQ, QRCVDTAQ,QMHRDQM, QCLRDTAQ, and QMHQRDQD programs without exiting the HLL procedure or program or calling a CL procedure or program to send,receive, clear, or retrieve the description.

* When receiving data from a data queue, you can set a time out such that the job waits until an entry arrives on the data queue. This differs from using the EOFDLY parameter on the OVRDBF command, which causes the job to be activated whenever the delay time ends.

* More than one job can receive data from the same data queue. This has an advantage in certain applications where the number of entries to be processed is greater than one job can handle within the desired performance restraints. For example, if several printers are available to print orders, several interactive jobs could send requests to a single data queue. A separate job for each printer could receive from the data queue, either in first-in-first-out (FIFO), last-in-first-out
(LIFO), or in keyed-queue order.

* Data queues have the ability to attach a sender ID to each message being placed on the queue. The sender ID, an attribute of the data queue which is established when the queue is created, contains the qualified job name and current user profile.

Create command - Local & DDM data queue

1)CRTDTAQ DTAQ(MYLIB/INPUT) MAXLEN(128) TEXT(sample data queue?)

2)CRTDTAQ DTAQ(LOCALLIB/DDMDTAQ) TYPE(*DDM) RMTDTAQ(REMOTELIB/REMOTEDTAQ) RMTLOCNAME(SYSTEMB) TEXT(DDM data queue to access data queue on SYSTEMB?)

原文转自:http://www.ltesting.net