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

140 lines
7.9 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="Join a physical file to itself (example 8)" />
<meta name="abstract" content="You can join a physical file to itself to read records that are formed by combining two or more records from the physical file itself." />
<meta name="description" content="You can join a physical file to itself to read records that are formed by combining two or more records from the physical file itself." />
<meta name="DC.subject" content="joining, physical file to itself, example, physical file, to itself, example, example, physical file to itself" />
<meta name="keywords" content="joining, physical file to itself, example, physical file, to itself, example, example, physical file to itself" />
<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="rbafojpfit" />
<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 a physical file to itself (example 8)</title>
</head>
<body id="rbafojpfit"><a name="rbafojpfit"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Join a physical file to itself (example 8)</h1>
<div><p>You can join a physical file to itself to read records that are
formed by combining two or more records from the physical file itself. </p>
<div class="section"><p>The following chart shows how you can join a physical file to
itself:</p>
</div>
<div class="section"><br /><img src="rbafo532.gif" alt="Examples of records" /><br /></div>
<div class="section"><p>The join logical file (JLF) contains <em>Employee number</em>, <em>Name</em>,
and <em>Manager's name</em>. The physical file (PF1) contains <em>Employee number</em>, <em>Name</em>,
and <em>Manager's employee number</em>. The following example shows the data
description specifications (DDS) for these files:</p>
</div>
<div class="example"> <pre><strong>JLF</strong>
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A JDFTVAL
A R JOINREC JFILE(PF1 PF1)
A J JOIN(1 2)
A JFLD(MGRNBR NBR)
A NBR JREF(1)
A NAME JREF(1)
A MGRNAME RENAME(NAME)
A JREF(2)
A
<strong>PF1</strong>
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A R RCD1
A NBR 3
A NAME 10 DFT('none')
A MGRNBR 3
A</pre>
</div>
<div class="section"> <div class="note"><span class="notetitle">Notes:</span> <ol><li>Relative file numbers must be specified on the JOIN keyword because the
same file name is specified twice on the JFILE keyword. Relative file number
1 refers to the first physical file specified on the JFILE keyword, 2 refers
to the second, and so forth.</li>
<li>With the same physical files specified on the JFILE keyword, the JREF
keyword is required for each field specified at the field level.</li>
</ol>
</div>
</div>
<div class="section"><p>Assume that the following records are contained in PF1.</p>
</div>
<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" width="33.33333333333333%" id="d0e85">Employee number</th>
<th valign="bottom" width="33.33333333333333%" id="d0e87">Name</th>
<th valign="bottom" width="33.33333333333333%" id="d0e89">Manager's employee number</th>
</tr>
</thead>
<tbody><tr><td valign="top" width="33.33333333333333%" headers="d0e85 ">235</td>
<td valign="top" width="33.33333333333333%" headers="d0e87 ">Anne</td>
<td valign="top" width="33.33333333333333%" headers="d0e89 ">440</td>
</tr>
<tr><td valign="top" width="33.33333333333333%" headers="d0e85 ">440</td>
<td valign="top" width="33.33333333333333%" headers="d0e87 ">Doug</td>
<td valign="top" width="33.33333333333333%" headers="d0e89 ">729</td>
</tr>
<tr><td valign="top" width="33.33333333333333%" headers="d0e85 ">500</td>
<td valign="top" width="33.33333333333333%" headers="d0e87 ">Mark</td>
<td valign="top" width="33.33333333333333%" headers="d0e89 ">440</td>
</tr>
<tr><td valign="top" width="33.33333333333333%" headers="d0e85 ">729</td>
<td valign="top" width="33.33333333333333%" headers="d0e87 ">Sue</td>
<td valign="top" width="33.33333333333333%" headers="d0e89 ">888</td>
</tr>
</tbody>
</table>
</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 2. Join logical file (JLF)</caption><thead align="left"><tr valign="bottom"><th valign="bottom" width="33.33333333333333%" id="d0e132">Employee number</th>
<th valign="bottom" width="33.33333333333333%" id="d0e134">Name</th>
<th valign="bottom" width="33.33333333333333%" id="d0e136">Manager's name</th>
</tr>
</thead>
<tbody><tr><td valign="top" width="33.33333333333333%" headers="d0e132 ">235</td>
<td valign="top" width="33.33333333333333%" headers="d0e134 ">Anne</td>
<td valign="top" width="33.33333333333333%" headers="d0e136 ">Doug</td>
</tr>
<tr><td valign="top" width="33.33333333333333%" headers="d0e132 ">440</td>
<td valign="top" width="33.33333333333333%" headers="d0e134 ">Doug</td>
<td valign="top" width="33.33333333333333%" headers="d0e136 ">Sue</td>
</tr>
<tr><td valign="top" width="33.33333333333333%" headers="d0e132 ">500</td>
<td valign="top" width="33.33333333333333%" headers="d0e134 ">Mark</td>
<td valign="top" width="33.33333333333333%" headers="d0e136 ">Doug</td>
</tr>
<tr><td valign="top" width="33.33333333333333%" headers="d0e132 ">729</td>
<td valign="top" width="33.33333333333333%" headers="d0e134 ">Sue</td>
<td valign="top" width="33.33333333333333%" headers="d0e136 ">none</td>
</tr>
</tbody>
</table>
</div>
<div class="note"><span class="notetitle">Notes:</span> <ol><li>A record is returned for the manager name of Sue because the JDFTVAL keyword
was specified.</li>
<li>The value <samp class="codeph">none</samp> is returned because the DFT keyword was
used on the <em>Name</em> field in the PF1 physical file.</li>
</ol>
</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>