199 lines
10 KiB
HTML
199 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="Use default data for missing records from secondary files (example 9)" />
|
||
<meta name="abstract" content="If you are joining more than two files and you specify the JDFTVAL keyword, the default value supplied by the system for a join field missing from a secondary file is used to join to other secondary files." />
|
||
<meta name="description" content="If you are joining more than two files and you specify the JDFTVAL keyword, the default value supplied by the system for a join field missing from a secondary file is used to join to other secondary files." />
|
||
<meta name="DC.subject" content="data, using, default for missing records from secondary files, example, default data for missing records from secondary files, secondary file, using default data for missing records" />
|
||
<meta name="keywords" content="data, using, default for missing records from secondary files, example, default data for missing records from secondary files, secondary file, using default data for missing records" />
|
||
<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="rbafojdftv" />
|
||
<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 default data for missing records from secondary files (example
|
||
9)</title>
|
||
</head>
|
||
<body id="rbafojdftv"><a name="rbafojdftv"><!-- --></a>
|
||
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
<h1 class="topictitle1">Use default data for missing records from secondary files (example
|
||
9)</h1>
|
||
<div><p>If you are joining more than two files and you specify the JDFTVAL
|
||
keyword, the default value supplied by the system for a join field missing
|
||
from a secondary file is used to join to other secondary files. </p>
|
||
<div class="section"><p>If the DFT keyword is specified in the secondary file, the value
|
||
specified for the DFT keyword is used in the logical file.</p>
|
||
</div>
|
||
<div class="section"><p>The data description specifications (DDS) for the files are shown
|
||
as follows:</p>
|
||
</div>
|
||
<div class="example"> <pre><strong>JLF</strong>
|
||
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
||
A JDFTVAL
|
||
A R JRCD JFILE(PF1 PF2 PF3)
|
||
A J JOIN(PF1 PF2)
|
||
A JFLD(NAME NAME)
|
||
A J JOIN(PF2 PF3)
|
||
A JFLD(TELEPHONE TELEPHONE)
|
||
A NAME JREF(PF1)
|
||
A ADDR
|
||
A TELEPHONE JREF(PF2)
|
||
A LOC
|
||
A
|
||
|
||
<strong>PF1</strong>
|
||
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
||
A R RCD1
|
||
A NAME 20
|
||
A ADDR 40
|
||
A COUNTRY 40
|
||
A
|
||
|
||
<strong>PF2</strong>
|
||
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
||
A R RCD2
|
||
A NAME 20
|
||
A TELEPHONE 8 DFT('999-9999')
|
||
A
|
||
|
||
<strong>PF3</strong>
|
||
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
|
||
A R RCD3
|
||
A TELEPHONE 8
|
||
A LOC 30 DFT('No location assigned')
|
||
A</pre>
|
||
</div>
|
||
<div class="section"><p>Assume that PF1, PF2, and PF3 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" width="33.33333333333333%" id="d0e64">Name</th>
|
||
<th valign="bottom" width="33.33333333333333%" id="d0e66">Address</th>
|
||
<th valign="bottom" width="33.33333333333333%" id="d0e68">Country</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr><td valign="top" width="33.33333333333333%" headers="d0e64 ">Anne</td>
|
||
<td valign="top" width="33.33333333333333%" headers="d0e66 ">120 1st St.</td>
|
||
<td valign="top" width="33.33333333333333%" headers="d0e68 ">USA</td>
|
||
</tr>
|
||
<tr><td valign="top" width="33.33333333333333%" headers="d0e64 ">Doug</td>
|
||
<td valign="top" width="33.33333333333333%" headers="d0e66 ">40 Pillsbury</td>
|
||
<td valign="top" width="33.33333333333333%" headers="d0e68 ">Canada</td>
|
||
</tr>
|
||
<tr><td valign="top" width="33.33333333333333%" headers="d0e64 ">Mark</td>
|
||
<td valign="top" width="33.33333333333333%" headers="d0e66 ">2 Lakeside Dr.</td>
|
||
<td valign="top" width="33.33333333333333%" headers="d0e68 ">Canada</td>
|
||
</tr>
|
||
<tr><td valign="top" width="33.33333333333333%" headers="d0e64 ">Sue</td>
|
||
<td valign="top" width="33.33333333333333%" headers="d0e66 ">120 Broadway</td>
|
||
<td valign="top" width="33.33333333333333%" headers="d0e68 ">USA</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="d0e107">Name</th>
|
||
<th valign="bottom" id="d0e109">Telephone</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr><td valign="top" headers="d0e107 ">Anne</td>
|
||
<td valign="top" headers="d0e109 ">555–1234</td>
|
||
</tr>
|
||
<tr><td valign="top" headers="d0e107 ">Doug</td>
|
||
<td valign="top" headers="d0e109 ">555–2222</td>
|
||
</tr>
|
||
<tr><td valign="top" headers="d0e107 ">Sue</td>
|
||
<td valign="top" headers="d0e109 ">555–1144</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="d0e135">Telephone</th>
|
||
<th valign="bottom" id="d0e137">Location</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr><td valign="top" headers="d0e135 ">555–1234</td>
|
||
<td valign="top" headers="d0e137 ">Room 312</td>
|
||
</tr>
|
||
<tr><td valign="top" headers="d0e135 ">555–2222</td>
|
||
<td valign="top" headers="d0e137 ">Main lobby</td>
|
||
</tr>
|
||
<tr><td valign="top" headers="d0e135 ">999–9999</td>
|
||
<td valign="top" headers="d0e137 ">No telephone number</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
<div class="section"><p>With JDFTVAL specified in the join logical file, 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="d0e168">Name</th>
|
||
<th valign="bottom" width="25%" id="d0e170">Address</th>
|
||
<th valign="bottom" width="25%" id="d0e172">Telephone</th>
|
||
<th valign="bottom" width="25%" id="d0e174">Location</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr><td valign="top" width="25%" headers="d0e168 ">Anne</td>
|
||
<td valign="top" width="25%" headers="d0e170 ">120 1st St.</td>
|
||
<td valign="top" width="25%" headers="d0e172 ">555–1234</td>
|
||
<td valign="top" width="25%" headers="d0e174 ">Room 312</td>
|
||
</tr>
|
||
<tr><td valign="top" width="25%" headers="d0e168 ">Doug</td>
|
||
<td valign="top" width="25%" headers="d0e170 ">40 Pillsbury</td>
|
||
<td valign="top" width="25%" headers="d0e172 ">555–2222</td>
|
||
<td valign="top" width="25%" headers="d0e174 ">Main lobby</td>
|
||
</tr>
|
||
<tr><td valign="top" width="25%" headers="d0e168 ">Mark</td>
|
||
<td valign="top" width="25%" headers="d0e170 ">2 Lakeside Dr.</td>
|
||
<td valign="top" width="25%" headers="d0e172 ">999–9999</td>
|
||
<td valign="top" width="25%" headers="d0e174 ">No telephone number</td>
|
||
</tr>
|
||
<tr><td valign="top" width="25%" headers="d0e168 ">Sue</td>
|
||
<td valign="top" width="25%" headers="d0e170 ">120 Broadway</td>
|
||
<td valign="top" width="25%" headers="d0e172 ">555–1144</td>
|
||
<td valign="top" width="25%" headers="d0e174 ">No location assigned</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
<div class="section"><div class="p">In this example, complete data is found for Anne and Doug. However,
|
||
part of the data is missing for Mark and Sue. <ul><li>PF2 is missing a record for Mark because he has no telephone number. The
|
||
default value for the <em>Telephone</em> field in PF2 is defined as 999-9999
|
||
using the DFT keyword. In this example, therefore, 999-9999 is the telephone
|
||
number returned when no telephone number is assigned. The JDFTVAL keyword
|
||
specified in the join logical file causes the default value for the <em>Telephone</em> field
|
||
(which is 999-9999) in PF2 to be used to match with a record in PF3. (In PF3,
|
||
a record is included to show a description for telephone number 999-9999.)
|
||
Without the JDFTVAL keyword, no record would be returned for Mark.</li>
|
||
<li>Sue's telephone number is not yet assigned a location; therefore, a record
|
||
for 555-1144 is missing in PF3. Without JDFTVAL specified, no record would
|
||
be returned for Sue. With JDFTVAL specified, the system supplies the default
|
||
value specified on the DFT keyword in PF3 the <em>Loc</em> field (which is <samp class="codeph">No
|
||
location assigned</samp>).</li>
|
||
</ul>
|
||
</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> |