ibm-information-center/dist/eclipse/plugins/i5OS.ic.dbp_5.4.0.1/rbafoefdel.htm

128 lines
8.4 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<?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="concept" />
<meta name="DC.Title" content="Wait for more records when end of file is reached" />
<meta name="abstract" content="End-of-file delay is a method of continuing to read sequentially from a database file (logical or physical) after an end-of-file condition occurs." />
<meta name="description" content="End-of-file delay is a method of continuing to read sequentially from a database file (logical or physical) after an end-of-file condition occurs." />
<meta name="DC.subject" content="end-of-file, waiting for more records" />
<meta name="keywords" content="end-of-file, waiting for more records" />
<meta name="DC.Relation" scheme="URI" content="rbaforddbf.htm" />
<meta name="DC.Relation" scheme="URI" content="../rzaks/rzaks1.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="rbafoefdel" />
<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>Wait for more records when end of file is reached</title>
</head>
<body id="rbafoefdel"><a name="rbafoefdel"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Wait for more records when end of file is reached</h1>
<div><p>End-of-file delay is a method of continuing to read sequentially
from a database file (logical or physical) after an end-of-file condition
occurs.</p>
<p>When an end-of-file condition occurs on a file being read sequentially
(for example, next/previous record) and you have specified an end-of-file
delay time (EOFDLY parameter on the Override with Database File (OVRDBF) command),
the system waits for the time you specified.</p>
<p>At the end of the delay time, another read is done to determine if any
new records were added to the file. If records were added, normal record processing
is done until an end-of-file condition occurs again. If records were not added
to the file, the system waits again for the time specified. Special consideration
should be taken when using end-of-file delay on a logical file with select/omit
specifications, opened so that the keyed sequence access path is not used.
In this case, after end-of-file is reached, the system retrieves only those
records added to a based-on physical file that meet the select/omit specifications
of the logical file.</p>
<p>Also, special consideration should be taken when using end-of-file delay
on a file with a keyed sequence access path, opened so that the keyed sequence
access path is used. In this case, after end-of-file is reached, the system
retrieves only those records added to the file or those records updated in
the file that meet the specification of the read operation using the keyed
sequence access path.</p>
<p>For example, end-of-file delay is used on a keyed file that has a numeric
key field in ascending order. An application program reads the records in
the file using the keyed sequence access path. The application program performs
a read next operation and gets a record that has a key value of 99. The application
program performs another read next and no more records are found in the file,
so the system attempts to read the file again after the specified end-of-file
delay time. If a record is added to the file or a record is updated, and the
record has a key value less than 99, the system does not retrieve the record.
If a record is added to the file or a record is updated and the record has
a key value greater than or equal to 99, the system retrieves the record.</p>
<p>For end-of-file delay times equal to or greater than 10 seconds, the job
is eligible to be removed from main storage during the wait time. If you do
not want the job eligible to be moved from main storage, specify PURGE(*NO)
on the Create Class (CRTCLS) command for the CLASS the job is using.</p>
<p>To
indicate which jobs have an end-of-file delay in progress, the status field
of the Work with Active Jobs (WRKACTJOB) display shows an end-of-file wait
or end-of-file activity level for jobs that are waiting for a record.</p>
<p>If a job uses end-of-file-delay and commitment control, it can hold its
record locks for a longer period of time. This increases the chances that
some other job can try to access those same records and be locked out. For
that reason, be careful when using end-of-file-delay and commitment control
in the same job.</p>
<p>If a file is shared, the OVRDBF command specifying an end-of-file delay
must be requested before the <em>first</em> open of the file because overrides
are ignored that are specified after the shared file is opened.</p>
<div class="p">There are several ways to end a job that is waiting for more records because
of an end-of-file-delay specified on the OVRDBF command: <ul><li>Write a record to the file with the end-of-file-delay that will be recognized
by the application program as a last record. The application program can then
specify a force-end-of-data (FEOD) operation. An FEOD operation allows the
program to complete normal end-of-file processing.</li>
<li>Do a controlled end of a job by specifying OPTION(*CNTRLD) on the End
Job (ENDJOB) command, with a DELAY parameter value time greater than the EOFDLY
time. The DELAY parameter time specified must allow time for the EOFDLY time
to run out, time to process any new records that have been put in the file,
and any end-of-file processing required in your application. After new records
are processed, the system signals end of file, and a normal end-of-file condition
occurs.</li>
<li>Specify OPTION(*IMMED) on the ENDJOB command. No end-of-file processing
is done.</li>
<li>If the job is interactive, press the System Request key to end the last
request.</li>
</ul>
</div>
<p>The following example shows an end-of-file delay operation:</p>
<br /><img src="rbafo541.gif" alt="Example of end-of-file delay operation" /><br /><p>The actual processing of the EOFDLY parameter is more complex than shown
because it is possible to force a true end-of-file if OPTION(*CNTRLD) on the
ENDJOB command is used with a long delay time.</p>
<div class="p">The job does not become active whenever a new record is added to the file.
The job becomes active after the specified end-of-file delay time ends. When
the job becomes active, the system checks for any new records. If new records
were added, the application program gets control and processes all new records,
then waits again. Because of this, the job takes on the characteristic of
a batch job when it is processing. For example, it normally processes a batch
of requests. When the batch is completed, the job becomes inactive. If the
delay is small, you can cause excessive system overhead because of the internal
processing required to start the job and check for new records. Normally,
only a small amount of overhead is used for a job waiting during end-of-file
delay. <div class="note"><span class="notetitle">Note:</span> When the job is inactive (waiting) it is in a long-wait status,
which means it was released from an activity level. After the long-wait status
is satisfied, the system reschedules the job in an activity level.</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbaforddbf.htm" title="The iSeries system provides a number of ways to read database records.">Read database records</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="../rzaks/rzaks1.htm">Work management</a></div>
</div>
</div>
</body>
</html>