ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzakb_5.4.0.1/rzakbmstdtdynsl.htm

200 lines
10 KiB
HTML
Raw 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="reference" />
<meta name="DC.Title" content="DYNSLT (Dynamic Select) keyword—logical files only" />
<meta name="abstract" content="Use this file-level keyword to indicate that the selection and omission tests specified in the file (using select/omit specifications) are done at processing time. This keyword specifies dynamic select/omit rather than access path select/omit." />
<meta name="description" content="Use this file-level keyword to indicate that the selection and omission tests specified in the file (using select/omit specifications) are done at processing time. This keyword specifies dynamic select/omit rather than access path select/omit." />
<meta name="DC.subject" content="DYNSLT (Dynamic Select) keyword, Dynamic Select (DYNSLT) keyword" />
<meta name="keywords" content="DYNSLT (Dynamic Select) keyword, Dynamic Select (DYNSLT) keyword" />
<meta name="DC.Relation" scheme="URI" content="rzakbmstlfkeyw.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2001, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2001, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="dtdynsl" />
<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>Physical and Logical Files, DYNSLT</title>
</head>
<body id="dtdynsl"><a name="dtdynsl"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">DYNSLT (Dynamic Select) keyword—logical files only</h1>
<div><p>Use this file-level keyword to indicate that the selection and
omission tests specified in the file (using select/omit specifications) are
done at processing time. This keyword specifies dynamic select/omit rather
than access path select/omit.</p>
<div class="section"><p>This keyword has no parameters.</p>
<p>When your program does input
operations to a logical file with the DYNSLT keyword specified, all the records
in the associated physical file are tested by the system to see if they satisfy
the select/omit values. Only those records that satisfy the values are supplied
to your program. The testing of each record can result in slower I/O performance,
but can be more efficient than maintaining an access path for the file. This
is particularly likely for files read only occasionally, especially when the
physical files they are based on are updated frequently. Using dynamic select/omit
is probably also more efficient for files with a high percentage of selected
records.</p>
<p>In
keyed sequence access files, an access path is created at file creation time
and is maintained for the file according to the MAINT parameter on the Create
Logical File (CRTLF) or Change Logical File (CHGLF) command. The DYNSLT keyword
does not affect the maintenance of access paths for keyed sequence access
files.</p>
<p>For all single-format logical files with a DYNSLT keyword, you
do not need to specify key fields in order to specify select/omit fields.
However, for all multiple-format logical files with a DYNSLT keyword, you
do need to specify at least one key field. You can specify *NONE for this
key field.</p>
<div class="p">You must use the DYNSLT keyword when you
want to select or omit fields and any of the following situations are true:
<ul><li>The logical file has arrival sequence (no key fields are specified). See
example 1 in this topic.</li>
<li>The logical file is a join logical file with the JDFTVAL keyword specified.</li>
<li>The logical file is a join logical file, select/omit fields come from
more than one of the physical files the logical file is based on, and one
of the following conditions is true: <ul><li>The select/omit fields are on the same select or omit statement. See example
3 in this topic.</li>
<li>The select/omit fields are on a mixture of select and omit statements.
See example 4 in this topic.</li>
<li>The select/omit fields are on select statements that are grouped together
by OR.</li>
<li>The select/omit fields are on omit statements that are grouped together
by AND.</li>
</ul>
</li>
</ul>
</div>
<p>You cannot specify the DYNSLT keyword with the REFACCPTH keyword.</p>
<p>For
a join logical file, the select/omit fields can occur in any of the physical
files specified on the JFILE keyword. Use the JREF keyword in join logical
files to qualify the origin of the field and resolve any ambiguities.</p>
</div>
<div class="section"><h4 class="sectiontitle">Examples</h4><p>The following examples show how to specify
the DYNSLT keyword.</p>
</div>
<div class="example"><h4 class="sectiontitle">Example 1</h4><p>The following example shows how to specify
dynamic select with arrival sequence.</p>
<pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A DYNSLT
00020A R RECORD1 PFILE(PF1)
00030A FLD1
00040A FLD2
00050A S FLD1 COMP(GT 2)</pre>
<p>The DYNSLT
keyword is required because there are no key fields.</p>
<div class="p">The logical file
supplies records to your program in arrival sequence. Assume that physical
file PF1 has the following records: <dl><dt><strong>FLD1</strong></dt>
<dd><strong>FLD2</strong></dd>
<dt class="dlterm">1</dt>
<dd>aaaa</dd>
<dt class="dlterm">2</dt>
<dd>dddd</dd>
<dt class="dlterm">3</dt>
<dd>jjjj</dd>
<dt class="dlterm">4</dt>
<dd>bbbb</dd>
</dl>
</div>
<div class="p">As your program does input operations, the system tests
the first two records according to the select/omit values, but does not supply
them to your program. Your program only sees the last two records: <dl><dt><strong>FLD1</strong></dt>
<dd><strong>FLD2</strong></dd>
<dt class="dlterm">3</dt>
<dd>jjjj</dd>
<dt class="dlterm">4</dt>
<dd>bbbb</dd>
</dl>
</div>
</div>
<div class="example"><h4 class="sectiontitle">Example 2</h4><p>The following example shows how to specify
dynamic select with keyed sequence access path.</p>
<pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A DYNSLT
00020A R RECORD1 PFILE(PF1)
00030A FLD1
00040A FLD2
00050A K FLD1
00060A S FLD2 COMP(GT 'bbbb')
A</pre>
<div class="p">In this example, the DYNSLT keyword is not required.
The logical file supplies records to your program in keyed sequence. Assume
that physical file PF1 has the following records: <dl><dt><strong>FLD1</strong></dt>
<dd><strong>FLD2</strong></dd>
<dt class="dlterm">1</dt>
<dd>aaaa</dd>
<dt class="dlterm">2</dt>
<dd>dddd</dd>
<dt class="dlterm">3</dt>
<dd>jjjj</dd>
<dt class="dlterm">4</dt>
<dd>bbbb</dd>
</dl>
</div>
<div class="p">When your program requests a record, the system tests
the value of FLD2 for that record according to the select/omit values. Your
program only sees the following records: <dl><dt><strong>FLD1</strong></dt>
<dd><strong>FLD2</strong></dd>
<dt class="dlterm">2</dt>
<dd>dddd</dd>
<dt class="dlterm">3</dt>
<dd>jjjj</dd>
</dl>
</div>
</div>
<div class="example"><h4 class="sectiontitle">Example 3</h4><p>The following example shows how to specify
a join logical file with select/omit comparing fields from two physical files.</p>
<pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A DYNSLT
00020A R RECORD1 JFILE(PF1 PF2)
00030A J JFLD(FLD1 FLD3)
00040A FLD1 JREF(PF1)
00050A FLD2 JREF(PF1)
00060A FLD3 JREF(PF2)
00070A FLD4 JREF(PF2)
00080A S FLD1 COMP(GT FLD4)
A</pre>
<p>FLD1 and FLD2 come from the primary file (PF1), and FLD3
and FLD4 come from the secondary file (PF2). The select specification compares
FLD1 from the primary file with FLD4 from the secondary file. Therefore, the
DYNSLT keyword is required.</p>
</div>
<div class="example"><h4 class="sectiontitle">Example 4</h4><p>The following example shows how to specify
a join logical file with select and omit using fields from more than one physical
file.</p>
<pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A DYNSLT
00020A R JREC JFILE(PF1 PF2)
00030A J JOIN(PF1 PF2)
00040A JFLD(FLD1 FLD2)
00050A FLD1 JREF(PF1)
00060A FLD2 JREF(PF1)
00070A FLD3 JREF(PF2)
00080A K FLD1
00090A S FLD1 COMP(GT 0)
00100A O FLD3 COMP(GT 4)
A</pre>
<p>FLD1 and FLD3 come from different physical files and
are specified in a mixture of select and omit statements. Therefore, the
DYNSLT keyword is required.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzakbmstlfkeyw.htm" title="This topic lists valid keyword entries for describing physical and logical files. They are typed in positions 45 through 80 (functions).">Keyword entries for physical and logical files (positions 45 through 80)</a></div>
</div>
</div>
</body>
</html>