127 lines
6.7 KiB
HTML
127 lines
6.7 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="Secondary file has more than one match for a record in the primary file (case 3)" />
|
||
|
<meta name="DC.subject" content="example, secondary file has multiple matches for record in primary file, secondary file" />
|
||
|
<meta name="keywords" content="example, secondary file has multiple matches for record in primary file, secondary file" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafox2phyf.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafoduprc.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="rbafocas3s" />
|
||
|
<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>Secondary file has more than one match for a record in the primary
|
||
|
file (case 3)</title>
|
||
|
</head>
|
||
|
<body id="rbafocas3s"><a name="rbafocas3s"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Secondary file has more than one match for a record in the primary
|
||
|
file (case 3)</h1>
|
||
|
<div><div class="section"><p>Assume that a join logical file is specified as in <a href="rbafox2phyf.htm#rbafox2phyf">Basic concepts of joining two physical files (example 1)</a>,
|
||
|
and there are four records in PF1 and five records in PF2, as shown in the
|
||
|
following two tables.</p>
|
||
|
|
||
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="border" border="1" rules="all"><caption>Table 1. Physical file 1 (PF1)</caption><thead align="left"><tr valign="bottom"><th valign="bottom" id="d0e36">Employee number</th>
|
||
|
<th valign="bottom" id="d0e38">Name</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td valign="top" headers="d0e36 ">235</td>
|
||
|
<td valign="top" headers="d0e38 ">Anne</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e36 ">440</td>
|
||
|
<td valign="top" headers="d0e38 ">Doug</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e36 ">500</td>
|
||
|
<td valign="top" headers="d0e38 ">Mark</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e36 ">729</td>
|
||
|
<td valign="top" headers="d0e38 ">Sue</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
|
||
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="border" border="1" rules="all"><caption>Table 2. Physical file 2 (PF2)</caption><thead align="left"><tr valign="bottom"><th valign="bottom" id="d0e69">Employee number</th>
|
||
|
<th valign="bottom" id="d0e71">Salary</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td valign="top" headers="d0e69 ">235</td>
|
||
|
<td valign="top" headers="d0e71 ">1700.00</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e69 ">235</td>
|
||
|
<td valign="top" headers="d0e71 ">1500.00</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e69 ">440</td>
|
||
|
<td valign="top" headers="d0e71 ">950.50</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e69 ">500</td>
|
||
|
<td valign="top" headers="d0e71 ">2100.00</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e69 ">729</td>
|
||
|
<td valign="top" headers="d0e71 ">1400.90</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
<p>In PF2, the record for 235 is duplicated.</p>
|
||
|
</div>
|
||
|
<div class="section"><p>The program gets five records.</p>
|
||
|
|
||
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="border" border="1" rules="all"><caption>Table 3. Join
|
||
|
logical file (JLF)</caption><thead align="left"><tr valign="bottom"><th valign="bottom" width="33.33333333333333%" id="d0e113">Employee number</th>
|
||
|
<th valign="bottom" width="33.33333333333333%" id="d0e115">Name</th>
|
||
|
<th valign="bottom" width="33.33333333333333%" id="d0e117">Salary</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td valign="top" width="33.33333333333333%" headers="d0e113 ">235</td>
|
||
|
<td valign="top" width="33.33333333333333%" headers="d0e115 ">Anne</td>
|
||
|
<td valign="top" width="33.33333333333333%" headers="d0e117 ">1700.00</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="33.33333333333333%" headers="d0e113 ">235</td>
|
||
|
<td valign="top" width="33.33333333333333%" headers="d0e115 ">Anne</td>
|
||
|
<td valign="top" width="33.33333333333333%" headers="d0e117 ">1500.00</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="33.33333333333333%" headers="d0e113 ">440</td>
|
||
|
<td valign="top" width="33.33333333333333%" headers="d0e115 ">Doug</td>
|
||
|
<td valign="top" width="33.33333333333333%" headers="d0e117 ">950.50</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="33.33333333333333%" headers="d0e113 ">500</td>
|
||
|
<td valign="top" width="33.33333333333333%" headers="d0e115 ">Mark</td>
|
||
|
<td valign="top" width="33.33333333333333%" headers="d0e117 ">0000.00</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="33.33333333333333%" headers="d0e113 ">729</td>
|
||
|
<td valign="top" width="33.33333333333333%" headers="d0e115 ">Sue</td>
|
||
|
<td valign="top" width="33.33333333333333%" headers="d0e117 ">1400.90</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
<p>In the join records, the record for 235 is duplicated. The order
|
||
|
of the records received for the duplicated record is unpredictable unless
|
||
|
the JDUPSEQ keyword is used. </p>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafox2phyf.htm" title="A join logical file is a logical file that combines (in one record format) fields from two or more physical files because in the record format not all the fields need to exist in all the physical files.">Basic concepts of joining two physical files (example 1)</a></div>
|
||
|
</div>
|
||
|
<div class="relref"><strong>Related reference</strong><br />
|
||
|
<div><a href="rbafoduprc.htm" title="Sometimes a join operation to a secondary file produces more than one record from the secondary file. When this occurs, specifying the JDUPSEQ keyword in the join specification for that secondary file tells the system to base the order of the duplicate records on the specified field in the secondary file.">Read duplicate records in secondary files (example 3)</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|