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

88 lines
5.1 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="RENAME (Rename) keyword—logical files only" />
<meta name="abstract" content="Use this field-level keyword when you want a field name in the logical record format that you are defining to be different from its corresponding physical file field name." />
<meta name="description" content="Use this field-level keyword when you want a field name in the logical record format that you are defining to be different from its corresponding physical file field name." />
<meta name="DC.subject" content="RENAME (Rename) keyword" />
<meta name="keywords" content="RENAME (Rename) keyword" />
<meta name="DC.Relation" scheme="URI" content="rzakbmstlfkeyw.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="tdrenam" />
<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>Physical and Logical Files, RENAME</title>
</head>
<body id="tdrenam"><a name="tdrenam"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">RENAME (Rename) keyword—logical files only</h1>
<div><p>Use this field-level keyword when you want a field name in the
logical record format that you are defining to be different from
its corresponding physical file field name.</p>
<div class="section"><div class="p">The format of the keyword is: <pre>RENAME(physical-file-field-name)</pre>
</div>
<p>The
name as it appears in the physical file record format is the parameter value
for this keyword. One field in the physical file record format can be renamed
to more than one field in the record format being described.</p>
<div class="p">You
can rename fields in situations similar to the following ones: <ul><li>You want to use programs that were written using a different name for
the same field.</li>
<li>You want to map one field in a physical file record format to two or more
fields in a logical file record format.</li>
<li>You are using a high-level language (such as RPG III) that does not permit
two fields having different names to have only one data storage area. By specifying
the RENAME keyword, you allow both fields to access the same data storage
area.</li>
</ul>
</div>
<p>If you specify the same physical field more than once in a record
format in the logical file (that is, by using either RENAME or CONCAT), the
sequence in which the fields are specified in the logical file is the sequence
in which the data is moved to the physical file on an update or insert operation.
Thus, the value in the last occurrence of the physical field is the value
that is put in the physical record and is the value that is used for all keys
built over that physical field. All previous values of the same field are
written over and have no effect.</p>
</div>
<div class="example"><h4 class="sectiontitle">Examples</h4><p>The following examples show how to specify
the RENAME keyword.</p>
<p>In the following example, the QTYDUE field in the
physical file (PF1) is renamed QTY in the logical file.</p>
<pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00050A R RCD1 PFILE(PF1)
00060A QTY RENAME(QTYDUE)
A</pre>
</div>
<div class="example"><p>In the following example, the renamed field in the logical file
(QTY) is used as a key field.</p>
<pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00050A R RCD2 PFILE(PF2)
00060A :
A :
00130A QTY RENAME(QTYDUE)
00140A K QTY
A</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzakbmstlfkeyw.htm" title="This topic lists valid keyword entries for describing physical and logical files. They are typed in positions 45 through 80 (functions).">Keyword entries for physical and logical files (positions 45 through 80)</a></div>
</div>
</div>
</body>
</html>