CLP中的DATAQ介绍

王朝厨房·作者佚名  2007-01-04
宽屏版  字体: |||超大  

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 access 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?)

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有