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

153 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="A complex join logical file (example 10)" />
<meta name="abstract" content="This example shows a more complex join logical file." />
<meta name="description" content="This example shows a more complex join logical file." />
<meta name="DC.subject" content="join logical file, example, complex, example, complex join logical file" />
<meta name="keywords" content="join logical file, example, complex, example, complex join logical file" />
<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="rbafoacjlf" />
<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>A complex join logical file (example 10)</title>
</head>
<body id="rbafoacjlf"><a name="rbafoacjlf"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">A complex join logical file (example 10)</h1>
<div><p>This example shows a more complex join logical file.</p>
<div class="section"><p>Assume that the data is in the following three physical files:</p>
</div>
<div class="example"> <pre><strong>Vendor Master File (PF1)</strong>
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A R RCD1 TEXT('VENDOR INFORMATION')
A VDRNBR 5 TEXT('VENDOR NUMBER')
A VDRNAM 25 TEXT('VENDOR NAME')
A STREET 15 TEXT('STREET ADDRESS')
A CITY 15 TEXT('CITY')
A STATE 2 TEXT('STATE')
A ZIPCODE 5 TEXT('ZIP CODE')
A DFT('00000')
A PAY 1 TEXT('PAY TERMS')
A
<strong>Order File (PF2)</strong>
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A R RCD2 TEXT('VENDORS ORDER')
A VDRNUM 5S 0 TEXT('VENDOR NUMBER')
A JOBNBR 6 TEXT('JOB NUMBER')
A PRTNBR 5S 0 TEXT('PART NUMBER')
A DFT(99999)
A QORDER 3S 0 TEXT('QUANTITY ORDERED')
A UNTPRC 6S 2 TEXT('PRICE')
A
<strong>Part File (PF3)</strong>
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A R RCD3 TEXT('DESCRIPTION OF PARTS')
A PRTNBR 5S 0 TEXT('PART NUMBER')
A DFT(99999)
A DESCR 25 TEXT('DESCRIPTION')
A UNITPRICE 6S 2 TEXT('UNIT PRICE')
A WHSNBR 3 TEXT('WAREHOUSE NUMBER')
A PRTLOC 4 TEXT('LOCATION OF PART')
A QOHAND 5 TEXT('QUANTITY ON HAND')
A</pre>
</div>
<div class="section"><div class="p">The join logical file record format should contain the following
fields: <ul><li><em>Vdrnam</em> (vendor name)</li>
<li><em>Street, City, State</em>, and <em>Zipcode</em> (vendor address)</li>
<li><em>Jobnbr</em> (job number)</li>
<li><em>Prtnbr</em> (part number)</li>
<li><em>Descr</em> (description of part)</li>
<li><em>Qorder</em> (quantity ordered)</li>
<li><em>Untprc</em> (unit price)</li>
<li><em>Whsnbr</em> (warehouse number)</li>
<li><em>Prtloc</em> (location of part)</li>
</ul>
</div>
</div>
<div class="section"><p>The data description specifications (DDS) for this join logical
file are shown as follows:</p>
</div>
<div class="example"> <pre><strong>Join Logical File (JLF)</strong>
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A <strong>1</strong> DYNSLT
A <strong>2</strong> JDFTVAL
A R RECORD1 JFILE(PF1 PF2 PF3)
A <strong>3</strong> J JOIN(1 2)
A JFLD(VDRNBR VDRNUM)
A <strong>4</strong> JDUPSEQ(JOBNBR)
A <strong>5</strong> J JOIN(2 3)
A <strong>6</strong> JFLD(PRTNBR PRTNBR)
A JFLD(UNTPRC UNITPRICE)
A <strong>7</strong> VDRNUM 5A N TEXT('CHANGED ZONED TO CHAR')
A VDRNAM
A ADDRESS <strong>8</strong> CONCAT(STREET CITY STATE +
A ZIPCODE)
A JOBNBR
A PRTNBR <strong>9</strong> JREF(2)
A DESCR
A QORDER
A UNTPRC
A WHSNBR
A PRTLOC
A <strong>10</strong> S VDRNAM COMP(EQ 'SEWING COMPANY')
A S QORDER COMP(GT 5)
A</pre>
</div>
<div class="section"> <dl><dt class="dlterm">1</dt>
<dd>The DYNSLT keyword is required because the JDFTVAL keyword and select
fields are specified.</dd>
<dt class="dlterm">2</dt>
<dd>The JDFTVAL keyword is specified to pick up default values in physical
files.</dd>
<dt class="dlterm">3</dt>
<dd>First join specification.</dd>
<dt class="dlterm"><span class="uicontrol">4</span></dt>
<dd>The JDUPSEQ keyword is specified because duplicate vendor numbers occur
in PF2.</dd>
<dt class="dlterm">5</dt>
<dd>Second join specification.</dd>
<dt class="dlterm">6</dt>
<dd>Two JFLD keywords are specified to ensure that the correct records are
joined from the PF2 and PF3 files.</dd>
<dt class="dlterm">7</dt>
<dd>The <em>Vdrnum</em> field is redefined from zoned decimal to character (because
it is used as a join field and it does not have the same attributes in PF1
and PF2).</dd>
<dt class="dlterm">8</dt>
<dd>The CONCAT keyword concatenates four fields from the same physical file
into one field.</dd>
<dt class="dlterm">9</dt>
<dd>The JREF keyword must be specified because the <em>Prtnbr</em> field exists
in two physical files and you want to use the one in PF2.</dd>
<dt class="dlterm">10</dt>
<dd>The select/omit fields are <em>Vdrnam</em> and <em>Qorder</em>. <div class="note"><span class="notetitle">Note:</span> They come
from two different physical files.)</div>
</dd>
</dl>
</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>