183 lines
12 KiB
HTML
183 lines
12 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html lang="en-us" xml:lang="en-us">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="security" content="public" />
|
|
<meta name="Robots" content="index,follow" />
|
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
|
<meta name="DC.Type" content="task" />
|
|
<meta name="DC.Title" content="Use data queues" />
|
|
<meta name="abstract" content="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." />
|
|
<meta name="description" content="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." />
|
|
<meta name="DC.subject" content="data queue, communicating between programs" />
|
|
<meta name="keywords" content="data queue, communicating between programs" />
|
|
<meta name="DC.Relation" scheme="URI" content="clpgcomm.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="remdq.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="compq.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="simiq.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="prerq.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="mangq.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="alloq.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="explq.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="dqoutput.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="../clfinder/finder.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="../rzaki/rzakikickoff.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="../cl/chgoutq.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="../cl/crtoutq.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="../rzalu/rzalukickoff.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="dspficf.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="dspfdq.htm" />
|
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
|
|
<meta name="DC.Format" content="XHTML" />
|
|
<meta name="DC.Identifier" content="qcomm" />
|
|
<meta name="DC.Language" content="en-us" />
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
|
<title>Use data queues</title>
|
|
</head>
|
|
<body id="qcomm"><a name="qcomm"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Use data queues</h1>
|
|
<div><p>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. </p>
|
|
<div class="section"> <p>The receiving program can be already waiting for the data, or
|
|
can receive the data later.</p>
|
|
<p>The advantages of using data queues are:
|
|
</p>
|
|
<ul><li>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 workstation
|
|
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.</li>
|
|
<li>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.</li>
|
|
<li>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.</li>
|
|
<li>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.</li>
|
|
<li>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.</li>
|
|
<li>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.</li>
|
|
</ul>
|
|
<p>In addition to these advantages, you can journal your data queues.
|
|
This allows you to recover the object to a consistent state, even if the object
|
|
was in the middle of some change action when the abnormal initial program
|
|
load (IPL) or crash occurred. Journaling also provides for replication of
|
|
the data queue journal to a remote system (using remote journal for instance).
|
|
This lets the system reproduce the actions in a similar environment to replicate
|
|
the application work.</p>
|
|
<p>The following example shows how data queues work.
|
|
Several jobs place entries on a data queue. The entries are handled by a server
|
|
job. This might be used to have jobs send processed orders to a single job
|
|
that would do the printing. Any number of jobs can send to the same queue.</p>
|
|
<br /><img src="rbafn535.gif" alt="This is an example showing how data queues work. Several jobs place entries on a data queue. The entries are handled by a server job. This might be used to have jobs send processed orders to a single job that would do the printing. Any number of jobs can send to the same queue." /><br /><p>Another example using data
|
|
queues follows. A primary job gets the work requests and sends the entries
|
|
to a data queue (by calling the QSNDDTAQ program). The server jobs receive
|
|
the entries from the data queue (by calling the QRCVDTAQ program) and process
|
|
the data. The server jobs can report status back to the primary job using
|
|
another data queue.</p>
|
|
<p>Data queues allow the primary job to route the work
|
|
to the server jobs. This frees the primary job to receive the next work request.
|
|
Any number of server jobs can receive from the same data queue.</p>
|
|
<br /><img src="rbafn536.gif" alt="Data queues allow the primary job to route the work to the server jobs. This frees the primary job to receive the next work request. Any number of server jobs can receive from the same data queue." /><br /><p>When no entries are on a
|
|
data queue, server jobs have the following options: </p>
|
|
<ul><li>Wait until an entry is placed on the queue</li>
|
|
<li>Wait for a specific period of time; if the entry still has not arrived,
|
|
then continue processing</li>
|
|
<li>Do not wait, return immediately.</li>
|
|
</ul>
|
|
<p>Data queues can also be used when a program needs to wait for input
|
|
from display files, ICF files, and data queues at the same time. When you
|
|
specify the DTAQ parameter for the following commands: </p>
|
|
<ul><li><span class="cmdname">Create Display File (CRTDSPF)</span> command</li>
|
|
<li><span class="cmdname">Change Display File (CHGDSPF)</span> command</li>
|
|
<li><span class="cmdname">Override Display File (OVRDSPF)</span> command</li>
|
|
<li><span class="cmdname">Create ICF File (CRTICFF)</span> command</li>
|
|
<li><span class="cmdname">Change ICF File (CHGICFF)</span> command</li>
|
|
<li><span class="cmdname">Override ICF File (OVRICFF)</span> command</li>
|
|
</ul>
|
|
<p>you can indicate a data queue that will have entries placed on it
|
|
when any of the following happens:</p>
|
|
<ul><li>An enabled command key or Enter key is pressed from an invited display
|
|
device</li>
|
|
<li>Data becomes available from an invited ICF session</li>
|
|
</ul>
|
|
<p>Support is available to optionally associate a data queue to an output
|
|
queue by using the <span class="cmdname">Create Output Queue (CRTOUTQ)</span> or <span class="cmdname">Change
|
|
Output Queue (CHGOUTQ)</span> command. The system logs entries in the data
|
|
queue when spooled files are in ready (RDY) status on the output queue. A
|
|
user program can determine when a spooled file is available on an output queue
|
|
by using the <span class="apiname">Receive Data Queue (QRCVDTAQ)</span> API
|
|
to receive information from a data queue.</p>
|
|
<p>Jobs running on the system
|
|
can also place entries on the same data queue as the one specified in the
|
|
DTAQ parameter by using the QSNDDTAQ program.</p>
|
|
<p>An application calls the
|
|
QRCVDTAQ program to receive each entry placed on the data queue and then processes
|
|
the entry based on whether it was placed there by a display file, an ICF file,
|
|
or the QSNDDTAQ program.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<ul class="ullinks">
|
|
<li class="ulchildlink"><strong><a href="remdq.htm">Remote data queues</a></strong><br />
|
|
Remote data queues are data queues that reside on a remote server.</li>
|
|
<li class="ulchildlink"><strong><a href="compq.htm">Comparisons with using database files as queues</a></strong><br />
|
|
This describes the differences between using data queues and using database files.</li>
|
|
<li class="ulchildlink"><strong><a href="simiq.htm">Similarities to message queues</a></strong><br />
|
|
Data queues are similar to message queues, in that procedures and programs can send data to the queue that is received later by another procedure or program.</li>
|
|
<li class="ulchildlink"><strong><a href="prerq.htm">Prerequisites for using data queues</a></strong><br />
|
|
Before using a data queue, you must first create it using the <span class="cmdname">Create
|
|
Data Queue (CRTDTAQ)</span> command. </li>
|
|
<li class="ulchildlink"><strong><a href="mangq.htm">Manage the storage used by a data queue</a></strong><br />
|
|
Because smaller data queues have better performance than large ones, it's important to manage the size of the storage allocated to a data queue.</li>
|
|
<li class="ulchildlink"><strong><a href="alloq.htm">Allocate data queues</a></strong><br />
|
|
If all users of a data queue allocate it before using it, this helps to ensure that a data queue is not accessed by more than one job at a time.</li>
|
|
<li class="ulchildlink"><strong><a href="explq.htm">Examples: Use a data queue</a></strong><br />
|
|
This includes examples of three methods for processing data queue files.</li>
|
|
<li class="ulchildlink"><strong><a href="dqoutput.htm">Create data queues associated with an output queue</a></strong><br />
|
|
You can associate a data queue with an output queue.</li>
|
|
</ul>
|
|
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="clpgcomm.htm" title="This gives information about how programs and procedures can communicate using data queues and data areas.">Communicate between programs and procedures</a></div>
|
|
</div>
|
|
<div class="relref"><strong>Related reference</strong><br />
|
|
<div><a href="dspficf.htm" title="This example shows a program waiting for input from a display file and an ICF file, using a data queue.">Example: Wait for input from a display file and an ICF file</a></div>
|
|
<div><a href="dspfdq.htm" title="This example shows a program in a job waiting for input from a display file and for input on a data queue in another job.">Example: Wait for input from a display file and a data queue</a></div>
|
|
</div>
|
|
<div class="relinfo"><strong>Related information</strong><br />
|
|
<div><a href="../clfinder/finder.htm">CL command finder</a></div>
|
|
<div><a href="../rzaki/rzakikickoff.htm">Journal management</a></div>
|
|
<div><a href="../cl/chgoutq.htm">Change Output Queue (CHGOUTQ) command</a></div>
|
|
<div><a href="../cl/crtoutq.htm">Create Output Queue (CRTOUTQ) command</a></div>
|
|
<div><a href="../rzalu/rzalukickoff.htm">Basic printing</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |