ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzakb_5.4.0.1/logfileviewex4.htm

130 lines
6.8 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="Specify the key field (example 4)" />
<meta name="abstract" content="In this example, assume that an employee has repeated a class. To sequence two records with the same values for EMPNBR and CLSDTE, a third key field, DATE, is specified in record format CLSHST." />
<meta name="description" content="In this example, assume that an employee has repeated a class. To sequence two records with the same values for EMPNBR and CLSDTE, a third key field, DATE, is specified in record format CLSHST." />
<meta name="DC.Relation" scheme="URI" content="lkeynm.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2001, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2001, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="logfileviewex4" />
<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>Specify the key field (example 4)</title>
</head>
<body id="logfileviewex4"><a name="logfileviewex4"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Specify the key field (example 4)</h1>
<div><p>In this example, assume that an employee has repeated a class.
To sequence two records with the same values for EMPNBR and CLSDTE, a third
key field, DATE, is specified in record format CLSHST.</p>
<div class="example"><p>However, DATE cannot be specified in the next available key position
(position 3) because JOBDTE and ACTDTE appear in that position for other formats.
If DATE is specified in this position, the attributes of DATE are compared
with the attributes of CLSHST and JOBHST, and the key definitions are rejected.</p>
<p>To
obtain the sequencing necessary, specify *NONE before DATE, displacing DATE
to key position 4.</p>
<p>The DATE field can be shown in position 4 as in <a href="#logfileviewex4__cfig9">Figure 1</a>.</p>
<div class="fignone" id="logfileviewex4__cfig9"><a name="logfileviewex4__cfig9"><!-- --></a><span class="figcap">Figure 1. Specify the
key field (example 4)</span><pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A R EMPMST PFILE(EMPMSTP)
00020A K EMPNBR
00030A*
00040A R CLSREG PFILE(CLSREGP)
00050A K EMPNBR
00060A K CLSDTE
00070A*
00080A R CLSHST PFILE(CLSHSTP)
00090A K EMPNBR
00100A K CLSDTE
00110A K *NONE <span><span>1</span></span>
00120A K DATE <span><span>1</span></span>
00130A*
00140A R JOBHST PFILE(JOBHSTP)
00150A K EMPNBR
00160A K *NONE
00170A K JOBDTE
00180A*
00190A R ACTHST PFILE(ACTHSTP)
00200A K EMPNBR
00210A K *NONE
00220A K ACTDTE
A</pre>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="void" border="0" rules="none"><thead align="left"><tr><th valign="top" width="20%" id="d0e44">Record format</th>
<th valign="top" width="20%" id="d0e46">Key positions</th>
<th valign="top" width="20%" id="d0e48">&nbsp;</th>
<th valign="top" width="20%" id="d0e49">&nbsp;</th>
<th valign="top" width="20%" id="d0e50">&nbsp;</th>
</tr>
</thead>
<tbody><tr><td valign="top" width="20%" headers="d0e44 ">&nbsp;</td>
<td valign="top" width="20%" headers="d0e46 "><span>1</span></td>
<td valign="top" width="20%" headers="d0e48 "><span>2</span></td>
<td valign="top" width="20%" headers="d0e49 "><span>3</span></td>
<td valign="top" width="20%" headers="d0e50 "><span>4</span></td>
</tr>
<tr><td valign="top" width="20%" headers="d0e44 ">EMPMST</td>
<td valign="top" width="20%" headers="d0e46 ">EMPNBR</td>
<td valign="top" width="20%" headers="d0e48 ">*NONE</td>
<td valign="top" width="20%" headers="d0e49 ">*NONE</td>
<td valign="top" width="20%" headers="d0e50 ">*NONE</td>
</tr>
<tr><td valign="top" width="20%" headers="d0e44 ">CLSREG</td>
<td valign="top" width="20%" headers="d0e46 ">EMPNBR</td>
<td valign="top" width="20%" headers="d0e48 ">CLSDTE</td>
<td valign="top" width="20%" headers="d0e49 ">*NONE</td>
<td valign="top" width="20%" headers="d0e50 ">*NONE</td>
</tr>
<tr><td valign="top" width="20%" headers="d0e44 ">CLSHST</td>
<td valign="top" width="20%" headers="d0e46 ">EMPNBR</td>
<td valign="top" width="20%" headers="d0e48 ">CLSDTE</td>
<td valign="top" width="20%" headers="d0e49 ">*NONE</td>
<td valign="top" width="20%" headers="d0e50 ">DATE</td>
</tr>
<tr><td valign="top" width="20%" headers="d0e44 ">JOBHST</td>
<td valign="top" width="20%" headers="d0e46 ">EMPNBR</td>
<td valign="top" width="20%" headers="d0e48 ">*NONE</td>
<td valign="top" width="20%" headers="d0e49 ">JOBDTE</td>
<td valign="top" width="20%" headers="d0e50 ">*NONE</td>
</tr>
<tr><td valign="top" width="20%" headers="d0e44 ">ACTHST</td>
<td valign="top" width="20%" headers="d0e46 ">EMPNBR</td>
<td valign="top" width="20%" headers="d0e48 ">*NONE</td>
<td valign="top" width="20%" headers="d0e49 ">ACTDTE</td>
<td valign="top" width="20%" headers="d0e50 ">*NONE</td>
</tr>
</tbody>
</table>
</div>
<p>Specifying DATE in key position 4 enables records from physical
file CLSHSTP with identical values for EMPNBR and CLSDTE to be merged and
sequenced according to the value for DATE.</p>
<div class="note"><span class="notetitle">Note:</span> Because values
are actually placed in the keys to ensure the sequencing in the previous examples,
duplicate key values are not always predictable when *NONE is needed for logical
files with more than one record format.</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="lkeynm.htm" title="When you specify K in position 17, the name specified in positions 19 through 28 is a key field name.">Key field name</a></div>
</div>
</div>
</body>
</html>