IBM Version 4 Universal Remote User Manual


 
Data Queue APIs
Data queues are a type of system object that you can create, to which one high-
level language (HLL) program can send data, and from which another HLL program
can receive data. The receiving program can be 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, the data queue APIs can provide better response time and
decrease the size of the interactive program and its process activation 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 a fast means of asynchronous communication between two
jobs. Using a data queue to send and receive data requires less system
resource 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 program. This is done by calling the Send to a Data Queue
(QSNDDTAQ), Receive from Data Queue (QRCVDTAQ), Retrieve Data Queue
Message (QMHRDQM), Clear Data Queue (QCLRDTAQ), and Retrieve Data
Queue Description (QMHQRDQD) APIs.
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 is different from using
the EOFDLY parameter on the Override Database File (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 is 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 data from the data queue in first-in-first-out (FIFO), last-in-
first-out (LIFO), or 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 that is
established when the queue is created, contains the qualified job name and
current user profile.
Comparisons with Using Database Files as Queues:
The following describes
the differences between using data queues and database files:
Data queues have been improved to communicate between active programs,
not to store large volumes of data or large numbers of entries. For these pur-
poses, use database files as queues.
Data queues should not be used for long-term storage or indefinite retention of
data. For this purpose, you should use database files.
When using data queues, you should include abnormal end procedures in your
programs to recover any entries not yet completely processed before the
system is ended.
8-12 System API Programming V4R1