202 lines
9.5 KiB
HTML
202 lines
9.5 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="Use more than one field to join files (example 2)" />
|
||
|
<meta name="abstract" content="You can specify more than one join field to join a pair of files. This example shows the fields in the logical file and the two physical files." />
|
||
|
<meta name="description" content="You can specify more than one join field to join a pair of files. This example shows the fields in the logical file and the two physical files." />
|
||
|
<meta name="DC.subject" content="example, using, more than one field to join files" />
|
||
|
<meta name="keywords" content="example, using, more than one field to join files" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafojnlof.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="rbafoljoin" />
|
||
|
<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>Use more than one field to join files (example 2)</title>
|
||
|
</head>
|
||
|
<body id="rbafoljoin"><a name="rbafoljoin"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Use more than one field to join files (example 2)</h1>
|
||
|
<div><p>You can specify more than one join field to join a pair of files.
|
||
|
This example shows the fields in the logical file and the two physical files.</p>
|
||
|
<div class="section"><br /><img src="rbafo521.gif" alt="Logical file and two physical files" /><br /></div>
|
||
|
<div class="section"><p>The join logical file (JLF) has fields <em>Part number</em>, <em>Color</em>, <em>Price</em>,
|
||
|
and <em>Quantity on hand</em>. Physical file 1 (PF1) has <em>Part number</em>, <em>Color</em>, <em>Price</em>,
|
||
|
and <em>Vendor</em>, while physical file 2 (PF2) has <em>Part number</em>, <em>Color</em>, <em>Quantity
|
||
|
on hand</em>, and <em>Warehouse</em>. The data description specifications (DDS)
|
||
|
for these files are shown as follows:</p>
|
||
|
</div>
|
||
|
<div class="example"> <pre><strong>JLF</strong>
|
||
|
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
||
|
A R JOINREC JFILE(PF1 PF2)
|
||
|
A J JOIN(PF1 PF2)
|
||
|
A JFLD(PTNBR PTNBR)
|
||
|
A JFLD(COLOR COLOR)
|
||
|
A PTNBR JREF(PF1)
|
||
|
A COLOR JREF(PF1)
|
||
|
A PRICE
|
||
|
A QUANTOH
|
||
|
A
|
||
|
|
||
|
<strong>PF1</strong>
|
||
|
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
||
|
A R REC1
|
||
|
A PTNBR 4
|
||
|
A COLOR 20
|
||
|
A PRICE 7 2
|
||
|
A VENDOR 40
|
||
|
A
|
||
|
|
||
|
<strong>PF2</strong>
|
||
|
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
||
|
A R REC2
|
||
|
A PTNBR 4
|
||
|
A COLOR 20
|
||
|
A QUANTOH 5 0
|
||
|
A WAREHSE 30
|
||
|
A</pre>
|
||
|
</div>
|
||
|
<div class="section"><p>Assume that the physical files have the following records.</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="d0e85">Part number</th>
|
||
|
<th valign="bottom" id="d0e87">Color</th>
|
||
|
<th valign="bottom" id="d0e89">Price</th>
|
||
|
<th valign="bottom" id="d0e91">Vendor</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td valign="top" headers="d0e85 ">100</td>
|
||
|
<td valign="top" headers="d0e87 ">Black</td>
|
||
|
<td valign="top" headers="d0e89 ">22.50</td>
|
||
|
<td valign="top" headers="d0e91 ">ABC Corp.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e85 ">100</td>
|
||
|
<td valign="top" headers="d0e87 ">White</td>
|
||
|
<td valign="top" headers="d0e89 ">20.00</td>
|
||
|
<td valign="top" headers="d0e91 ">Ajax Inc.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e85 ">120</td>
|
||
|
<td valign="top" headers="d0e87 ">Yellow</td>
|
||
|
<td valign="top" headers="d0e89 ">3.75</td>
|
||
|
<td valign="top" headers="d0e91 ">ABC Corp.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e85 ">187</td>
|
||
|
<td valign="top" headers="d0e87 ">Green</td>
|
||
|
<td valign="top" headers="d0e89 "><strong>110.95</strong></td>
|
||
|
<td valign="top" headers="d0e91 ">ABC Corp.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e85 ">187</td>
|
||
|
<td valign="top" headers="d0e87 ">Red</td>
|
||
|
<td valign="top" headers="d0e89 "><strong>110.50</strong></td>
|
||
|
<td valign="top" headers="d0e91 ">ABC Corp.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e85 ">190</td>
|
||
|
<td valign="top" headers="d0e87 ">Blue</td>
|
||
|
<td valign="top" headers="d0e89 ">40.00</td>
|
||
|
<td valign="top" headers="d0e91 ">Ajax Inc. </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="d0e160">Part number</th>
|
||
|
<th valign="bottom" id="d0e162">Color</th>
|
||
|
<th valign="bottom" id="d0e164">Quantity on hand</th>
|
||
|
<th valign="bottom" id="d0e166">Warehouse</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td valign="top" headers="d0e160 ">100</td>
|
||
|
<td valign="top" headers="d0e162 ">Black</td>
|
||
|
<td valign="top" headers="d0e164 ">23</td>
|
||
|
<td valign="top" headers="d0e166 ">ABC Corp.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e160 ">100</td>
|
||
|
<td valign="top" headers="d0e162 ">White</td>
|
||
|
<td valign="top" headers="d0e164 ">15</td>
|
||
|
<td valign="top" headers="d0e166 ">Ajax Inc.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e160 ">120</td>
|
||
|
<td valign="top" headers="d0e162 ">Yellow</td>
|
||
|
<td valign="top" headers="d0e164 ">102</td>
|
||
|
<td valign="top" headers="d0e166 ">ABC Corp.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e160 ">187</td>
|
||
|
<td valign="top" headers="d0e162 ">Green</td>
|
||
|
<td valign="top" headers="d0e164 "><strong>0</strong></td>
|
||
|
<td valign="top" headers="d0e166 ">ABC Corp.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e160 ">187</td>
|
||
|
<td valign="top" headers="d0e162 ">Red</td>
|
||
|
<td valign="top" headers="d0e164 "><strong>2</strong></td>
|
||
|
<td valign="top" headers="d0e166 ">ABC Corp.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e160 ">190</td>
|
||
|
<td valign="top" headers="d0e162 ">Blue</td>
|
||
|
<td valign="top" headers="d0e164 "><strong>2</strong></td>
|
||
|
<td valign="top" headers="d0e166 ">Ajax Inc. </td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="section"><p>If the file is processed sequentially, the program receives the
|
||
|
following 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" id="d0e239">Part number</th>
|
||
|
<th valign="bottom" id="d0e241">Color</th>
|
||
|
<th valign="bottom" id="d0e243">Price</th>
|
||
|
<th valign="bottom" id="d0e245">Quantity on hand</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td valign="top" headers="d0e239 ">100</td>
|
||
|
<td valign="top" headers="d0e241 ">Black</td>
|
||
|
<td valign="top" headers="d0e243 ">22.50</td>
|
||
|
<td valign="top" headers="d0e245 ">23</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e239 ">100</td>
|
||
|
<td valign="top" headers="d0e241 ">White</td>
|
||
|
<td valign="top" headers="d0e243 ">20.00</td>
|
||
|
<td valign="top" headers="d0e245 ">15</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e239 ">120</td>
|
||
|
<td valign="top" headers="d0e241 ">Yellow</td>
|
||
|
<td valign="top" headers="d0e243 ">3.75</td>
|
||
|
<td valign="top" headers="d0e245 ">102</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e239 ">187</td>
|
||
|
<td valign="top" headers="d0e241 ">Green</td>
|
||
|
<td valign="top" headers="d0e243 "><strong>110.95</strong></td>
|
||
|
<td valign="top" headers="d0e245 "><strong>0</strong></td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e239 ">187</td>
|
||
|
<td valign="top" headers="d0e241 ">Red</td>
|
||
|
<td valign="top" headers="d0e243 "><strong>110.50</strong></td>
|
||
|
<td valign="top" headers="d0e245 "><strong>2</strong></td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="note"><span class="notetitle">Note:</span> No record for part number 190, color blue, is available to the
|
||
|
program, because a match was not found on both fields in the secondary file.
|
||
|
Because JDFTVAL was not specified, no record is returned.</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafojnlof.htm" title="These topics provide examples to illustrate how to set up a join logical file. Performance, integrity, and a summary of rules for join logical files are also included.">Set up a join logical file</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|