192 lines
10 KiB
HTML
192 lines
10 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="Read duplicate records in secondary files (example 3)" />
|
|||
|
<meta name="abstract" content="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." />
|
|||
|
<meta name="description" content="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." />
|
|||
|
<meta name="DC.subject" content="reading, duplicate records in secondary files, example, duplicate records in a secondary file, example, reading duplicate records in secondary files" />
|
|||
|
<meta name="keywords" content="reading, duplicate records in secondary files, example, duplicate records in a secondary file, example, reading duplicate records in secondary files" />
|
|||
|
<meta name="DC.Relation" scheme="URI" content="rbafojnlof.htm" />
|
|||
|
<meta name="DC.Relation" scheme="URI" content="rbafoacjlf.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="rbafoduprc" />
|
|||
|
<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> Read duplicate records in secondary files (example 3)</title>
|
|||
|
</head>
|
|||
|
<body id="rbafoduprc"><a name="rbafoduprc"><!-- --></a>
|
|||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|||
|
<h1 class="topictitle1"> Read duplicate records in secondary files (example 3)</h1>
|
|||
|
<div><p>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.</p>
|
|||
|
<div class="section"><p>The data description specifications (DDS) for the physical files
|
|||
|
and for the join logical file are shown as follows:</p>
|
|||
|
</div>
|
|||
|
<div class="example"> <pre><strong>JLF</strong>
|
|||
|
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
|||
|
A R JREC JFILE(PF1 PF2)
|
|||
|
A J JOIN(PF1 PF2)
|
|||
|
A JFLD(NAME1 NAME2)
|
|||
|
A JDUPSEQ(TELEPHONE)
|
|||
|
A NAME1
|
|||
|
A ADDR
|
|||
|
A TELEPHONE
|
|||
|
A
|
|||
|
|
|||
|
<strong>PF1</strong>
|
|||
|
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
|||
|
A R REC1
|
|||
|
A NAME1 10
|
|||
|
A ADDR 20
|
|||
|
A
|
|||
|
|
|||
|
<strong>PF2</strong>
|
|||
|
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
|||
|
A R REC2
|
|||
|
A NAME2 10
|
|||
|
A TELEPHONE 8
|
|||
|
A</pre>
|
|||
|
</div>
|
|||
|
<div class="section"><p>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="d0e57">Name</th>
|
|||
|
<th valign="bottom" id="d0e59">Address</th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody><tr><td valign="top" headers="d0e57 ">Anne</td>
|
|||
|
<td valign="top" headers="d0e59 ">120 1st St.</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" headers="d0e57 ">Doug</td>
|
|||
|
<td valign="top" headers="d0e59 ">40 Pillsbury</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" headers="d0e57 ">Mark</td>
|
|||
|
<td valign="top" headers="d0e59 ">2 Lakeside Dr.</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="d0e85">Name</th>
|
|||
|
<th valign="bottom" id="d0e87">Telephone</th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody><tr><td valign="top" headers="d0e85 ">Anne</td>
|
|||
|
<td valign="top" headers="d0e87 ">555–1111</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" headers="d0e85 ">Anne</td>
|
|||
|
<td valign="top" headers="d0e87 ">555–6666</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" headers="d0e85 ">Anne</td>
|
|||
|
<td valign="top" headers="d0e87 ">555–2222</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" headers="d0e85 ">Doug</td>
|
|||
|
<td valign="top" headers="d0e87 ">555–5555</td>
|
|||
|
</tr>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="section"><p>The join logical file returns 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" width="33.33333333333333%" id="d0e122">Name</th>
|
|||
|
<th valign="bottom" width="33.33333333333333%" id="d0e124">Address</th>
|
|||
|
<th valign="bottom" width="33.33333333333333%" id="d0e126">Telephone</th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody><tr><td valign="top" width="33.33333333333333%" headers="d0e122 ">Anne</td>
|
|||
|
<td valign="top" width="33.33333333333333%" headers="d0e124 ">120 1st St.</td>
|
|||
|
<td valign="top" width="33.33333333333333%" headers="d0e126 ">555–1111</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" width="33.33333333333333%" headers="d0e122 ">Anne</td>
|
|||
|
<td valign="top" width="33.33333333333333%" headers="d0e124 ">120 1st St.</td>
|
|||
|
<td valign="top" width="33.33333333333333%" headers="d0e126 ">555–2222</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" width="33.33333333333333%" headers="d0e122 ">Anne</td>
|
|||
|
<td valign="top" width="33.33333333333333%" headers="d0e124 ">120 1st St.</td>
|
|||
|
<td valign="top" width="33.33333333333333%" headers="d0e126 ">555–6666</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" width="33.33333333333333%" headers="d0e122 ">Doug</td>
|
|||
|
<td valign="top" width="33.33333333333333%" headers="d0e124 ">40 Pillsbury</td>
|
|||
|
<td valign="top" width="33.33333333333333%" headers="d0e126 ">555–5555</td>
|
|||
|
</tr>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="section"><p>The program reads all the records available for Anne, then Doug,
|
|||
|
then Mark. Anne has one address, but three telephone numbers. Therefore, there
|
|||
|
are three records returned for Anne.</p>
|
|||
|
<p>The records for Anne sort in ascending
|
|||
|
sequence by telephone number because the JDUPSEQ keyword sorts in ascending
|
|||
|
sequence unless you specify *DESCEND as the keyword parameter. The following
|
|||
|
example shows the use of *DESCEND in DDS:</p>
|
|||
|
</div>
|
|||
|
<div class="example"> <pre><strong>JLF</strong>
|
|||
|
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
|||
|
A R JREC JFILE(PF1 PF2)
|
|||
|
A J JOIN(PF1 PF2)
|
|||
|
A JFLD(NAME1 NAME2)
|
|||
|
A JDUPSEQ(TELEPHONE *DESCEND)
|
|||
|
A NAME1
|
|||
|
A ADDR
|
|||
|
A TELEPHONE
|
|||
|
A</pre>
|
|||
|
</div>
|
|||
|
<div class="section"><p>When you specify JDUPSEQ with *DESCEND, the records are returned
|
|||
|
as follows.</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="33.33333333333333%" id="d0e180">Name</th>
|
|||
|
<th valign="bottom" width="33.33333333333333%" id="d0e182">Address</th>
|
|||
|
<th valign="bottom" width="33.33333333333333%" id="d0e184">Telephone</th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody><tr><td valign="top" width="33.33333333333333%" headers="d0e180 ">Anne</td>
|
|||
|
<td valign="top" width="33.33333333333333%" headers="d0e182 ">120 1st St.</td>
|
|||
|
<td valign="top" width="33.33333333333333%" headers="d0e184 ">555–6666</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" width="33.33333333333333%" headers="d0e180 ">Anne</td>
|
|||
|
<td valign="top" width="33.33333333333333%" headers="d0e182 ">120 1st St.</td>
|
|||
|
<td valign="top" width="33.33333333333333%" headers="d0e184 ">555–2222</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" width="33.33333333333333%" headers="d0e180 ">Anne</td>
|
|||
|
<td valign="top" width="33.33333333333333%" headers="d0e182 ">120 1st St.</td>
|
|||
|
<td valign="top" width="33.33333333333333%" headers="d0e184 ">555–1111</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" width="33.33333333333333%" headers="d0e180 ">Doug</td>
|
|||
|
<td valign="top" width="33.33333333333333%" headers="d0e182 ">40 Pillsbury</td>
|
|||
|
<td valign="top" width="33.33333333333333%" headers="d0e184 ">555–5555</td>
|
|||
|
</tr>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
<div class="note"><span class="notetitle">Note:</span> The JDUPSEQ keyword applies only to the join specification in
|
|||
|
which it is specified.</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 class="relref"><strong>Related reference</strong><br />
|
|||
|
<div><a href="rbafoacjlf.htm" title="This example shows a more complex join logical file.">A complex join logical file (example 10)</a></div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</body>
|
|||
|
</html>
|