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

240 lines
14 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="Control how records are retrieved in a file with multiple formats" />
<meta name="abstract" content="In a logical file with more than one record format, key field definitions are required. Each record format has its own key definition, and the record format key fields can be defined to merge the records of the different formats. Each record format does not have to contain every key field in the key." />
<meta name="description" content="In a logical file with more than one record format, key field definitions are required. Each record format has its own key definition, and the record format key fields can be defined to merge the records of the different formats. Each record format does not have to contain every key field in the key." />
<meta name="DC.subject" content="retrieving, records in a multiple format file, multiple format logical file, retrieving records" />
<meta name="keywords" content="retrieving, records in a multiple format file, multiple format logical file, retrieving records" />
<meta name="DC.Relation" scheme="URI" content="rbafocrlff.htm" />
<meta name="DC.Relation" scheme="URI" content="../dds/kickoff.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="rbafononef" />
<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>Control how records are retrieved in a file with multiple formats</title>
</head>
<body id="rbafononef"><a name="rbafononef"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Control how records are retrieved in a file with multiple formats</h1>
<div><p>In a logical file with more than one record format, key field definitions
are required. Each record format has its own key definition, and the record
format key fields can be defined to merge the records of the different formats.
Each record format does not have to contain every key field in the key. </p>
<p> Consider the following records.</p>
<table cellpadding="4" cellspacing="0" border="1" class="tableborder"><tr><td>
<table cellpadding="4" cellspacing="0" summary="" width="100%" border="0"><caption>Table 1. Header record format</caption><thead align="left"><tr><th align="left" valign="top" width="25%" id="d0e36">Record</th>
<th align="left" valign="top" width="25%" id="d0e38">Order</th>
<th align="left" valign="top" width="25%" id="d0e40">Cust</th>
<th align="left" valign="top" width="25%" id="d0e42">Ordate</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="25%" headers="d0e36 ">1</td>
<td align="left" valign="top" width="25%" headers="d0e38 ">41882</td>
<td align="left" valign="top" width="25%" headers="d0e40 ">41394</td>
<td align="left" valign="top" width="25%" headers="d0e42 ">050688</td>
</tr>
<tr><td align="left" valign="top" width="25%" headers="d0e36 ">2</td>
<td align="left" valign="top" width="25%" headers="d0e38 ">32133</td>
<td align="left" valign="top" width="25%" headers="d0e40 ">28674</td>
<td align="left" valign="top" width="25%" headers="d0e42 ">060288</td>
</tr>
</tbody>
</table>
</td></tr></table>
<table cellpadding="4" cellspacing="0" border="1" class="tableborder"><tr><td>
<table cellpadding="4" cellspacing="0" summary="" width="100%" border="0"><caption>Table 2. Detail record format</caption><thead align="left"><tr><th align="left" valign="top" id="d0e75">Record</th>
<th align="left" valign="top" id="d0e77">Order</th>
<th align="left" valign="top" id="d0e79">Line</th>
<th align="left" valign="top" id="d0e81">Item</th>
<th align="left" valign="top" id="d0e83">Qtyord</th>
<th align="left" valign="top" id="d0e85">Extens</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" headers="d0e75 ">A</td>
<td align="left" valign="top" headers="d0e77 ">32133</td>
<td align="left" valign="top" headers="d0e79 ">01</td>
<td align="left" valign="top" headers="d0e81 ">46412</td>
<td align="left" valign="top" headers="d0e83 ">25</td>
<td align="left" valign="top" headers="d0e85 ">125000</td>
</tr>
<tr><td align="left" valign="top" headers="d0e75 ">B</td>
<td align="left" valign="top" headers="d0e77 ">32133</td>
<td align="left" valign="top" headers="d0e79 ">03</td>
<td align="left" valign="top" headers="d0e81 ">12481</td>
<td align="left" valign="top" headers="d0e83 ">4</td>
<td align="left" valign="top" headers="d0e85 ">001000</td>
</tr>
<tr><td align="left" valign="top" headers="d0e75 ">C</td>
<td align="left" valign="top" headers="d0e77 ">41882</td>
<td align="left" valign="top" headers="d0e79 ">02</td>
<td align="left" valign="top" headers="d0e81 ">46412</td>
<td align="left" valign="top" headers="d0e83 ">10</td>
<td align="left" valign="top" headers="d0e85 ">050000</td>
</tr>
<tr><td align="left" valign="top" headers="d0e75 ">D</td>
<td align="left" valign="top" headers="d0e77 ">32133</td>
<td align="left" valign="top" headers="d0e79 ">02</td>
<td align="left" valign="top" headers="d0e81 ">14201</td>
<td align="left" valign="top" headers="d0e83 ">110</td>
<td align="left" valign="top" headers="d0e85 ">454500</td>
</tr>
<tr><td align="left" valign="top" headers="d0e75 ">E</td>
<td align="left" valign="top" headers="d0e77 ">41882</td>
<td align="left" valign="top" headers="d0e79 ">01</td>
<td align="left" valign="top" headers="d0e81 ">08265</td>
<td align="left" valign="top" headers="d0e83 ">40</td>
<td align="left" valign="top" headers="d0e85 ">008000</td>
</tr>
</tbody>
</table>
</td></tr></table>
<div class="p">In data description specifications (DDS), the header record format is defined
before the detail record format. If the access path uses the <em>Order</em> field
as the first key field for both record formats and the <em>Line</em> field as
the second key field for only the second record format, both in ascending
sequence, the order of the records in the access path is: <ul><li>Record 2</li>
<li>Record A</li>
<li>Record D</li>
<li>Record B</li>
<li>Record 1</li>
<li>Record E</li>
<li>Record C</li>
</ul>
<div class="note"><span class="notetitle">Note:</span> Records with duplicate key values are arranged first in the sequence
in which the physical files are specified. Then, if duplicates still exist
within a record format, the duplicate records are arranged in the order specified
by the FIFO, LIFO, or FCFO keyword. For example, if the logical file specified
the DDS keyword FIFO, then duplicate records within the format would be presented
in first-in-first-out sequence.</div>
</div>
<p>For logical files with more than
one record format, you can use the *NONE DDS function for key fields to separate
records of one record format from records of other record formats in the same
access path. Generally, records from all record formats are merged based on
key values. However, if *NONE is specified in DDS for a key field, only the
records with key fields that appear in all record formats before the *NONE
are merged. When such records are retrieved by key from more than one record
format, only key fields that appear in all record formats before the *NONE
are used. To increase the number of key fields that are used, limit the number
of record formats considered.</p>
<p>The logical file in the following example contains three record formats,
each associated with a different physical file:</p>
<table cellpadding="4" cellspacing="0" border="1" class="tableborder"><tr><td>
<table cellpadding="4" cellspacing="0" summary="" width="100%" border="0"><thead align="left"><tr><th valign="top" width="20.833333333333336%" id="d0e191">Record format</th>
<th valign="top" width="25%" id="d0e193">Physical file</th>
<th valign="top" width="54.166666666666664%" id="d0e195">Key fields</th>
</tr>
</thead>
<tbody><tr><td valign="top" width="20.833333333333336%" headers="d0e191 ">EMPMSTR</td>
<td valign="top" width="25%" headers="d0e193 ">EMPMSTR</td>
<td valign="top" width="54.166666666666664%" headers="d0e195 ">Empnbr (employee number) <strong>1</strong></td>
</tr>
<tr><td valign="top" width="20.833333333333336%" headers="d0e191 ">EMPHIST</td>
<td valign="top" width="25%" headers="d0e193 ">EMPHIST</td>
<td valign="top" width="54.166666666666664%" headers="d0e195 ">Empnbr, Empdat (employed date) <strong>2</strong></td>
</tr>
<tr><td valign="top" width="20.833333333333336%" headers="d0e191 ">EMPEDUC</td>
<td valign="top" width="25%" headers="d0e193 ">EMPEDUC</td>
<td valign="top" width="54.166666666666664%" headers="d0e195 ">Empnbr, Clsnbr (class number) <strong>3</strong></td>
</tr>
</tbody>
</table>
</td></tr></table>
<div class="note"><span class="notetitle">Note:</span> All record formats have one key field in common, the <em>Empnbr</em> field.</div>
<p>The DDS for this example is:</p>
<pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A
A K EMPNBR <strong>1</strong>
A
A K EMPNBR <strong>2</strong>
A K EMPDAT
A
A K EMPNBR <strong>3</strong>
A K *NONE
A K CLSNBR
A</pre>
<p>*NONE is assumed for the second and third key fields for EMPMSTR and the
third key field for EMPHIST because no key fields follow these key field positions.</p>
<p>The following table shows the arrangement of the records:</p>
<table cellpadding="4" cellspacing="0" border="1" class="tableborder"><tr><td>
<table cellpadding="4" cellspacing="0" summary="" width="100%" border="0"><thead align="left"><tr><th valign="top" width="23.52941176470588%" id="d0e255">Empnbr</th>
<th valign="top" width="23.52941176470588%" id="d0e257">Empdat</th>
<th valign="top" width="23.52941176470588%" id="d0e259">Clsnbr</th>
<th valign="top" width="29.411764705882355%" id="d0e261">Record format name</th>
</tr>
</thead>
<tbody><tr><td valign="top" width="23.52941176470588%" headers="d0e255 ">426</td>
<td valign="top" width="23.52941176470588%" headers="d0e257 ">&nbsp;</td>
<td valign="top" width="23.52941176470588%" headers="d0e259 ">&nbsp;</td>
<td valign="top" width="29.411764705882355%" headers="d0e261 ">EMPMSTR</td>
</tr>
<tr><td valign="top" width="23.52941176470588%" headers="d0e255 ">426</td>
<td valign="top" width="23.52941176470588%" headers="d0e257 ">6/15/74</td>
<td valign="top" width="23.52941176470588%" headers="d0e259 ">&nbsp;</td>
<td valign="top" width="29.411764705882355%" headers="d0e261 ">EMPHIST</td>
</tr>
<tr><td valign="top" width="23.52941176470588%" headers="d0e255 ">426</td>
<td valign="top" width="23.52941176470588%" headers="d0e257 ">&nbsp;</td>
<td valign="top" width="23.52941176470588%" headers="d0e259 ">412</td>
<td valign="top" width="29.411764705882355%" headers="d0e261 ">EMPEDUC</td>
</tr>
<tr><td valign="top" width="23.52941176470588%" headers="d0e255 ">426</td>
<td valign="top" width="23.52941176470588%" headers="d0e257 ">&nbsp;</td>
<td valign="top" width="23.52941176470588%" headers="d0e259 ">520</td>
<td valign="top" width="29.411764705882355%" headers="d0e261 ">EMPEDUC</td>
</tr>
<tr><td valign="top" width="23.52941176470588%" headers="d0e255 ">427</td>
<td valign="top" width="23.52941176470588%" headers="d0e257 ">&nbsp;</td>
<td valign="top" width="23.52941176470588%" headers="d0e259 ">&nbsp;</td>
<td valign="top" width="29.411764705882355%" headers="d0e261 ">EMPMSTR</td>
</tr>
<tr><td valign="top" width="23.52941176470588%" headers="d0e255 ">427</td>
<td valign="top" width="23.52941176470588%" headers="d0e257 ">9/30/75</td>
<td valign="top" width="23.52941176470588%" headers="d0e259 ">&nbsp;</td>
<td valign="top" width="29.411764705882355%" headers="d0e261 ">EMPHIST</td>
</tr>
<tr><td valign="top" width="23.52941176470588%" headers="d0e255 ">427</td>
<td valign="top" width="23.52941176470588%" headers="d0e257 ">&nbsp;</td>
<td valign="top" width="23.52941176470588%" headers="d0e259 ">412</td>
<td valign="top" width="29.411764705882355%" headers="d0e261 ">EMPEDUC</td>
</tr>
</tbody>
</table>
</td></tr></table>
<div class="p">*NONE serves as a separator for the record formats EMPHIST and EMPEDUC.
All the records for EMPHIST with the same <em>Empnbr</em> field are grouped
together and sorted by the <em>Empdat</em> field. All the records for EMPEDUC
with the same <em>Empnbr</em> field are grouped together and sorted by the <em>Clsnbr</em> field. <div class="note"><span class="notetitle">Note:</span> Because
additional key field values are placed in the key sequence access path to
guarantee the above sequencing, duplicate key values are not predictable.</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafocrlff.htm" title="A multiple format logical file lets you use related records from two or more physical files by referring to only one logical file. Each record format is always associated with one or more physical files. You can use the same physical file in more than one record format.">Create a logical file with more than one record format</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="../dds/kickoff.htm">DDS concepts</a></div>
</div>
</div>
</body>
</html>