194 lines
9.5 KiB
HTML
194 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="Join three or more physical files (example 7)" />
|
|||
|
<meta name="abstract" content="You can use a join logical file to join as many as 32 physical files. These files must be specified on the JFILE keyword. The first file specified on the JFILE keyword is the primary file; the other files are all secondary files." />
|
|||
|
<meta name="description" content="You can use a join logical file to join as many as 32 physical files. These files must be specified on the JFILE keyword. The first file specified on the JFILE keyword is the primary file; the other files are all secondary files." />
|
|||
|
<meta name="DC.subject" content="joining, three or more physical files, example, physical file, three or more, example, example, three or more physical files" />
|
|||
|
<meta name="keywords" content="joining, three or more physical files, example, physical file, three or more, example, example, three or more physical 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="rbafoj3mpf" />
|
|||
|
<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>Join three or more physical files (example 7)</title>
|
|||
|
</head>
|
|||
|
<body id="rbafoj3mpf"><a name="rbafoj3mpf"><!-- --></a>
|
|||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|||
|
<h1 class="topictitle1">Join three or more physical files (example 7)</h1>
|
|||
|
<div><p>You can use a join logical file to join as many as 32 physical
|
|||
|
files. These files must be specified on the JFILE keyword. The first file
|
|||
|
specified on the JFILE keyword is the primary file; the other files are all
|
|||
|
secondary files.</p>
|
|||
|
<div class="section"><p>The physical files must be joined in pairs, with each pair described
|
|||
|
by a join specification. Each join specification must have one or more join
|
|||
|
fields identified.</p>
|
|||
|
</div>
|
|||
|
<div class="section"><p>The following chart shows the fields in the files and one field
|
|||
|
common to all the physical files in the logical file:</p>
|
|||
|
</div>
|
|||
|
<div class="section"><br /><img src="rbafo529.gif" alt="Examples of records" /><br /></div>
|
|||
|
<div class="section"><p>The join logical file (JLF2) contains <em>Name</em>, <em>Address</em>, <em>Telephone</em>,
|
|||
|
and <em>Salary</em>. Physical file 1 (PF1) has <em>Name</em> and <em>Address</em>,
|
|||
|
physical file 2 (PF2) has <em>Name</em> and <em>Telephone</em>, and physical file
|
|||
|
3 (PF3) has <em>Name</em> and <em>Salary.</em> In this example, the <em>Name</em> field
|
|||
|
is common to all the physical files (PF1, PF2, and PF3), and serves as the
|
|||
|
join field.</p>
|
|||
|
</div>
|
|||
|
<div class="section"><p>The following example shows the data description specifications
|
|||
|
(DDS) for the physical and logical files:</p>
|
|||
|
</div>
|
|||
|
<div class="example"> <pre><strong>JLF</strong>
|
|||
|
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
|||
|
A R JOINREC JFILE(PF1 PF2 P3)
|
|||
|
A J JOIN(PF1 PF2)
|
|||
|
A JFLD(NAME NAME)
|
|||
|
A J JOIN(PF2 PF3)
|
|||
|
A JFLD(NAME NAME)
|
|||
|
A NAME JREF(PF1)
|
|||
|
A ADDR
|
|||
|
A TELEPHONE
|
|||
|
A SALARY
|
|||
|
A K NAME
|
|||
|
A
|
|||
|
|
|||
|
<strong>PF1</strong>
|
|||
|
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
|||
|
A R REC1
|
|||
|
A NAME 10
|
|||
|
A ADDR 20
|
|||
|
A K NAME
|
|||
|
A
|
|||
|
|
|||
|
<strong>PF2</strong>
|
|||
|
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
|||
|
A R REC2
|
|||
|
A NAME 10
|
|||
|
A TELEPHONE 7
|
|||
|
A K NAME
|
|||
|
A
|
|||
|
|
|||
|
<strong>PF3</strong>
|
|||
|
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
|||
|
A R REC3
|
|||
|
A NAME 10
|
|||
|
A SALARY 9 2
|
|||
|
A K NAME
|
|||
|
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="d0e105">Name</th>
|
|||
|
<th valign="bottom" id="d0e107">Address</th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody><tr><td valign="top" headers="d0e105 ">Anne</td>
|
|||
|
<td valign="top" headers="d0e107 ">120 1st St.</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" headers="d0e105 ">Doug</td>
|
|||
|
<td valign="top" headers="d0e107 ">40 Pillsbury</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" headers="d0e105 ">Mark</td>
|
|||
|
<td valign="top" headers="d0e107 ">2 Lakeside Dr.</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" headers="d0e105 ">Tom</td>
|
|||
|
<td valign="top" headers="d0e107 ">335 Elm St.</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="d0e138">Name</th>
|
|||
|
<th valign="bottom" id="d0e140">Telephone</th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody><tr><td valign="top" headers="d0e138 ">Anne</td>
|
|||
|
<td valign="top" headers="d0e140 ">555–1111</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" headers="d0e138 ">Doug</td>
|
|||
|
<td valign="top" headers="d0e140 ">555–5555</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" headers="d0e138 ">Mark</td>
|
|||
|
<td valign="top" headers="d0e140 ">555–0000</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" headers="d0e138 ">Sue</td>
|
|||
|
<td valign="top" headers="d0e140 ">555–3210 </td>
|
|||
|
</tr>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="border" border="1" rules="all"><caption>Table 3. Physical file 3 (PF3)</caption><thead align="left"><tr valign="bottom"><th valign="bottom" id="d0e171">Name</th>
|
|||
|
<th valign="bottom" id="d0e173">Salary</th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody><tr><td valign="top" headers="d0e171 ">Anne</td>
|
|||
|
<td valign="top" headers="d0e173 ">1700.00</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" headers="d0e171 ">Doug</td>
|
|||
|
<td valign="top" headers="d0e173 ">950.00</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" headers="d0e171 ">Mark</td>
|
|||
|
<td valign="top" headers="d0e173 ">2100.00 </td>
|
|||
|
</tr>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="section"><p>The program reads the following logical file records.</p>
|
|||
|
|
|||
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="border" border="1" rules="all"><caption>Table 4. Join logical file (JLF)</caption><thead align="left"><tr valign="bottom"><th valign="bottom" width="25%" id="d0e204">Name</th>
|
|||
|
<th valign="bottom" width="25%" id="d0e206">Address</th>
|
|||
|
<th valign="bottom" width="25%" id="d0e208">Telephone</th>
|
|||
|
<th valign="bottom" width="25%" id="d0e210">Salary</th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody><tr><td valign="top" width="25%" headers="d0e204 ">Anne</td>
|
|||
|
<td valign="top" width="25%" headers="d0e206 ">120 1st St.</td>
|
|||
|
<td valign="top" width="25%" headers="d0e208 ">555–1111</td>
|
|||
|
<td valign="top" width="25%" headers="d0e210 ">1700.00</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" width="25%" headers="d0e204 ">Doug</td>
|
|||
|
<td valign="top" width="25%" headers="d0e206 ">40 Pillsbury</td>
|
|||
|
<td valign="top" width="25%" headers="d0e208 ">555–5555</td>
|
|||
|
<td valign="top" width="25%" headers="d0e210 ">950.00</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" width="25%" headers="d0e204 ">Mark</td>
|
|||
|
<td valign="top" width="25%" headers="d0e206 ">2 Lakeside Dr..</td>
|
|||
|
<td valign="top" width="25%" headers="d0e208 ">555–0000</td>
|
|||
|
<td valign="top" width="25%" headers="d0e210 ">2100.00</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" width="25%" headers="d0e204 ">Doug</td>
|
|||
|
<td valign="top" width="25%" headers="d0e206 ">40 Pillsbury</td>
|
|||
|
<td valign="top" width="25%" headers="d0e208 ">555–5555</td>
|
|||
|
<td valign="top" width="25%" headers="d0e210 "> </td>
|
|||
|
</tr>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
<p>No record is returned for Tom because a record is not found for
|
|||
|
him in PF2 and PF3 and the JDFTVAL keyword is not specified. No record is
|
|||
|
returned for Sue because the primary file has no record for Sue.</p>
|
|||
|
</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>
|