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

75 lines
5.1 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="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="Select a specified number of records (NBRRCDS parameter)" />
<meta name="abstract" content="When you specify a FROMKEY or FROMRCD parameter, you can specify the number of records (NBRRCDS parameter) to be copied instead of the TOKEY or TORCD parameter." />
<meta name="description" content="When you specify a FROMKEY or FROMRCD parameter, you can specify the number of records (NBRRCDS parameter) to be copied instead of the TOKEY or TORCD parameter." />
<meta name="DC.Relation" scheme="URI" content="rbal3selrecords.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3copysel.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3copyrrk.htm" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rbal3copysele" />
<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>Select a specified number of records (NBRRCDS parameter)</title>
</head>
<body id="rbal3copysele"><a name="rbal3copysele"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Select a specified number of records (NBRRCDS parameter)</h1>
<div><p>When you specify a FROMKEY or FROMRCD parameter, you can specify
the number of records (NBRRCDS parameter) to be copied instead of the TOKEY
or TORCD parameter.</p>
<p> You cannot specify both the NBRRCDS and the TORCD or TOKEY
parameters. The specified number of records is copied starting with the specified
from-key value or from-record number.</p>
<div class="note"><span class="notetitle">Note:</span> You can use this parameter on the following commands: CPYF,
CPYFRMDKT, CPYFRMQRYF, CPYFRMTAP, CPYTODKT, and CPYTOTAP.</div>
<div class="p">You can specify the NBRRCDS parameter without specifying the FROMKEY or
FROMRCD parameter. The copy command copies records by starting with the first
record in the file. Note that the number of records specified is the number
of records actually copied to the to-file, which includes:<img src="./delta.gif" alt="Start of change" /><ul><li>Deleted records in the from-file if COMPRESS(*NO) is specified, but DOES
NOT INCLUDE</li>
<li>Records excluded by the INCCHAR and INCREL parameters</li>
</ul><img src="./deltaend.gif" alt="End of change" />
</div>
<div class="p">This example shows how you can use the copy command to copy 1000 records
in the file EMP1 to the file EMP1T. The command copies records from the first
member in EMP1 and replace the records in the first member in EMP1T. <pre>CPYF FROMFILE(PERSONNEL/EMP1) +
TOFILE(TESTLIB1/EMP1T) MBROPT(*REPLACE) +
NBRRCDS(1000)</pre>
You can also use the NBRRCDS parameter to examine
a subset of records on a list: <pre>CPYF FROMFILE(PERSONNEL/EMP1) TOFILE(*PRINT) +
FROMRCD(250) NBRRCDS(10) OUTFMT(*HEX)</pre>
</div>
<p>When you successfully copy an open query file, the file position is unpredictable.
If you want to run a different program with the same files or run another
CPYFRMQRYF, you must position the file or close the file and open it with
the same OPNQRYF command. You can position the file with the Position Database
File (POSDBF) command. In some cases, you can use a high-level language program
statement.</p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbal3selrecords.htm" title="You can use parameters on the copy commands to select only the specific records that you want to copy.">Select the records to copy</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="rbal3copysel.htm" title="You can use the RCDFMT parameter to select records of a certain record format to copy. Note that you can use this parameter on the CPYF command only.">Selecting records using a specified record format name (RCDFMT parameter)</a></div>
<div><a href="rbal3copyrrk.htm" title="You can specify record keys to copy only from a keyed database file. Note that you can use this parameter on the CPYF command only.">Select records by record keys (FROMKEY and TOKEY Parameters)</a></div>
</div>
</div>
</body>
</html>