ibm-information-center/dist/eclipse/plugins/i5OS.ic.rbam6_5.4.0.1/dspfdq.htm

111 lines
6.4 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="reference" />
<meta name="DC.Title" content="Example: Wait for input from a display file and a data queue" />
<meta name="abstract" content="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." />
<meta name="description" content="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." />
<meta name="DC.Relation" scheme="URI" content="explq.htm" />
<meta name="DC.Relation" scheme="URI" content="qcomm.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="dspfdq" />
<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> Example: Wait for input from a display file and a data queue</title>
</head>
<body id="dspfdq"><a name="dspfdq"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1"> Example: Wait for input from a display file and a data queue</h1>
<div><p>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.</p>
<div class="section"><p>The program in Job B is waiting for input from a display file
that it is using and for input to arrive on the data queue from Job A. Instead
of alternately waiting for the display file and then the data queue, the program
waits for one object, the data queue.</p>
</div>
<div class="section"><br /><img src="rbafn545.gif" alt="In this example, the program in Job B is waiting for input from a display file that it is using and for input to arrive on the data queue from Job A. Instead of alternately waiting for the display file and then the data queue, the program waits for one object, the data queue." /><br /></div>
<div class="section"><p> The program calls QRCVDTAQ and waits for the placement of an
entry on the data queue that was specified on the display file. Job A is
also placing entries on the same data queue. There are two types of entries
that are put on this queue, the display file entry, and the user-defined entry.
Display data management places the display file entry on the data queue when
data is available from the display file. Job A places the user-defined entry
on the data queue.</p>
</div>
<div class="section"><p>The structure of the display file entry is described in the previous
example.</p>
</div>
<div class="section"><p>The structure of the entry placed on the queue by Job A is defined
by the application programmer.</p>
</div>
<div class="section"><p>The following example shows coding logic that the application
program in Job B might use: </p>
<pre> .
.
.
.
OPEN DSPFILE ... /* Open the Display file. DTAQ parameter specified on*/
/* CRTDSPF, CHGDSPF, or OVRDSPF for the file. */
.
.
DO
WRITE DSPFILE /* Write with Invite for the Display file */
CALL QRCVDTAQ /* Receive an entry from the data queue specified */
/* on the DTAQ parameter for the file. Entries */
/* are placed on the data queue either by Job A or */
/* by display data management when data is */
/* available from any invited device on the display */
/* file. */
/* After the entry is received, determine what type */
/* of entry it is, process it, and return to receive */
/* the next entry on the data queue. */
IF 'ENTRY TYPE' FIELD = '*DSPF ' THEN /* Entry is from display */
DO /* file. Since this entry*/
/* does not contain the */
/* data received, the data*/
/* must be read from the */
/* file before it can be */
READ DATA FROM DISPLAY FILE /* processed. */
PROCESS INPUT DATA FROM DISPLAY FILE
WRITE TO DISPLAY FILE /* Write with Invite */
END
ELSE /* Entry is from Job A. */
/* This entry contains */
/* the data from Job A, */
/* so no read is required*/
/* before processing the */
/* data. */
PROCESS DATA QUEUE ENTRY FROM JOB A
LOOP BACK TO RECEIVE ENTRY FROM DATA QUEUE
.
.
.
END</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="explq.htm" title="This includes examples of three methods for processing data queue files.">Examples: Use a data queue</a></div>
</div>
<div class="reltasks"><strong>Related tasks</strong><br />
<div><a href="qcomm.htm" title="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.">Use data queues</a></div>
</div>
</div>
</body>
</html>