ibm-information-center/dist/eclipse/plugins/i5OS.ic.dm_5.4.0.1/rbal3add.htm

74 lines
5.6 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="copyright" content="(C) Copyright IBM Corporation 2005" />
<meta name="DC.rights.owner" content="(C) Copyright IBM Corporation 2005" />
<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="concept" />
<meta name="DC.Title" content="Specify *ADD when copying files" />
<meta name="abstract" content="When you specify *ADD, each record copied is added to the end of the existing records in the member." />
<meta name="description" content="When you specify *ADD, each record copied is added to the end of the existing records in the member." />
<meta name="DC.Relation" scheme="URI" content="rbal3records.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3copydelrec.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3sequence.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3copyrrn.htm" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rbal3add" />
<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 *ADD when copying files</title>
</head>
<body id="rbal3add"><a name="rbal3add"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Specify *ADD when copying files</h1>
<div><p>When you specify *ADD, each record copied is added to the end of
the existing records in the member. </p>
<p>It is important to note that this is always true, even for keyed files.
However, with keyed files, the added records appear to be merged in key sequence
when accessed through a keyed access path. When copying from query files,
the relative record numbers of the resulting file might not correspond to
those in the original file.</p>
<p>When *ADD is specified, the copy completes normally even if the from-file
contains no records.</p>
<p><img src="./delta.gif" alt="Start of change" />When three files are copied with MBROPT(*ADD) to a database
file that is not keyed, the resulting to-file looks like the following figure: <br /><img src="rv2h078.gif" alt="Graphic showing the result of copies&#xA;with MBROPT(*ADD) specified" /><br /><img src="./deltaend.gif" alt="End of change" /></p>
<div class="p">If MBROPT(*ADD) is specified, records are always physically added at the
end of the file, even if it is a keyed sequence file. In the following figure,
FILEDB1 is a keyed physical from-file, and FILEDB2 is a keyed physical to-file.
The files are shown as they physically appear in storage. FILEDB2 already
has three records in it. <div class="fignone"><br /><img src="rv2h079.gif" alt="Graphic of files as they&#xA;physically appear in storage" /><br /></div>
</div>
<p>If you specify MBROPT(*ADD), FROMKEY(1 2), and TOKEY(1 5), four records
are added in key field order to the end of FILEDB2.</p>
<div class="fignone"><br /><img src="rv2h080.gif" alt="Graphic of records added&#xA;to file" /><br /></div>
<p>The added records, however, appear to be merged in the new file when viewed
through a keyed sequence access path.</p>
<div class="fignone"><br /><img src="rv2h081.gif" alt="Graphic of records when viewed&#xA;through a keyed sequence access path" /><br /></div>
<p>There are several ways to select records for copying . One
method is selection by relative record number. Using the preceding example,
if you selected records to copy to a third file from FILEDB2 by relative record
number, from number 3 through 5, you would copy the records with a key value
of 24, 2, and 3, not 4, 5, and 9.</p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbal3records.htm" title="Many iSeries copy commands allows you to add or replace existing data in the to-file specifying different attributes on the MBROPT paramete.">Add, replace, and update records (MBROPT parameter)</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="rbal3copydelrec.htm" title="You might want to copy deleted records to preserve the relative record numbers of records that are copied from the from-file. You can copy both deleted and undeleted records from one physical file member to another by specifying the COMPRESS(*NO) parameter on a copy command.">Copy deleted records (COMPRESS parameter)</a></div>
<div><a href="rbal3sequence.htm" title="You can perform additions or changes to sequence number fields and date fields sequence number and date fields when you are copying files.">Add or changing source file sequence number and date fields (SRCOPT and SRCSEQ Parameters)</a></div>
<div><a href="rbal3copyrrn.htm" title="You can use the FROMRCD and TORCD parameters to copy files with specifying their record numbers. Note that you can use these parameters on the CPYF command only.">Select records by relative record numbers (FROMRCD and TORCD parameters)</a></div>
</div>
</div>
</body>
</html>