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

112 lines
9.0 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 records by record keys (FROMKEY and TOKEY Parameters)" />
<meta name="abstract" content="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." />
<meta name="description" content="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." />
<meta name="DC.Relation" scheme="URI" content="rbal3selrecords.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3keystring.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3buildkey.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3fromkey.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3copyfield.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3copydtt.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3copynull.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3copydiff.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3copydbcs.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3copysele.htm" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rbal3copyrrk" />
<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 records by record keys (FROMKEY and TOKEY Parameters)</title>
</head>
<body id="rbal3copyrrk"><a name="rbal3copyrrk"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Select records by record keys (FROMKEY and TOKEY Parameters)</h1>
<div><p>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.</p>
<div class="p">You can copy records: <ul><li>From a specified key value (FROMKEY parameter) to a specified key value
(TOKEY parameter) OR</li>
<li>Until a specified number of records (NBRRCDS parameter) is reached </li>
</ul>
If the command reaches the end of the file before it reaches the specified
ending key value or number of records, the copy completes normally.</div>
<p>If no record in the from-file member has a key that is a match with the
FROMKEY value, but there is at least one record with a key greater than the
specified value, the first record copied is the first record with a key greater
than the FROMKEY value. If the specified key value is greater than any record
in the member, the command sends an error message and does not copy the member.</p>
<p>You can specify *BLDKEY on the FROMKEY and TOKEY parameters to use a list
of character and numeric values in their natural display form for the fields
in a key. The command converts each element to the corresponding key field
data type. The command then provides the <dfn class="term">composite key</dfn> value
(a key that is comprised of more than one field) to the database.</p>
<p>If you specify fewer values than the complete database key contains, the
command builds a partial key and passes it to the database. If you specify
more values than the database key contains, an ending error occurs. The command
always applies values to the consecutive fields that are in the extreme left
of the key so that it is impossible to skip key fields.</p>
<p>The command pads character fields on the right with blanks. The command
adjusts numeric fields to the implied decimal point in the key field with
the correct zero padding.</p>
<p>All regular rules for specifying numeric fields in an external character
format apply. The command does not allow a floating-point value of *NAN (Not
a Number).</p>
<p>It is also important to understand <a href="rbal3keystring.htm#rbal3keystring">Key string comparisons made by the copy operation</a> in
order to interpret various warning messages.</p>
<div class="note"><span class="notetitle">Note:</span> If you use record keys to select records, you cannot use relative record
numbers (FROMRCD/TORCD parameters) to select records on the same CPYF command.</div>
<p>You should not specify COMPRESS(*NO) when selecting records by record key
from a keyed physical file. Because the keyed access path of a file does
not contain deleted records, the copy command never copies them, so the compression
is automatic.</p>
<p>Because deleted records are canceled in a copy by this method, it is also
possible that the relative record numbers have changed in the new file, even
if you have specified MBROPT(*REPLACE).</p>
<p>The user has to input operand equal to the length of the fix field when
specifying *BLDKEY on the FROMKEY and TOKEY parameters for fix length binary
character keyfields.</p>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rbal3keystring.htm">Key string comparisons made by the copy operation</a></strong><br />
When the TOKEY value is specified, the check made by the copy operation is a logical character comparison between the key string for each record retrieved. The key strings can be specified explicitly using the first TOKEY parameter format or built implicitly by the copy operation that uses the list of values that are given.</li>
<li class="ulchildlink"><strong><a href="rbal3buildkey.htm">Example: build-key function</a></strong><br />
The example in this topic shows the usages of various parameters of the build-key function.</li>
<li class="ulchildlink"><strong><a href="rbal3fromkey.htm">Example: using FROMKEY and TOKEY</a></strong><br />
In this example, the copy command copies records in the file EMP1 to the file EMP1T. EMP1T is a file in a test library. Because you only need a subset of the records, you specify a from-key value and a to-key value. Both are full key values.</li>
<li class="ulchildlink"><strong><a href="rbal3copyfield.htm">Variable-length fields used by record keys (FROMKEY and TOKEY)</a></strong><br />
When the number of key fields and a value are used to specify the FROMKEY or TOKEY parameter, the string should include the 2-byte length field for each variable-length key field.</li>
<li class="ulchildlink"><strong><a href="rbal3copydtt.htm">Date, time, and timestamp fields used by record keys (FROMKEY and TOKEY)</a></strong><br />
When the number of key fields and a value are used to specify the FROMKEY or TOKEY parameter, no conversion of data occurs if the corresponding key field in the from-file is a date, time, or timestamp field.</li>
<li class="ulchildlink"><strong><a href="rbal3copynull.htm">Null-capable fields used by record keys (FROMKEY and TOKEY)</a></strong><br />
When you use the number of key fields and a value to specify the FROMKEY or TOKEY parameter, the copy command ignores the null values. The command uses only the buffer default values for values that are actually null for the comparison.</li>
<li class="ulchildlink"><strong><a href="rbal3copydiff.htm">Different CCSIDs used by record keys (FROMKEY and TOKEY)</a></strong><br />
When you use the number of key fields and a value to specify the FROMKEY or TOKEY parameter, the copy command does not make any CCSID conversions to the input string.</li>
<li class="ulchildlink"><strong><a href="rbal3copydbcs.htm">DBCS-graphic fields used by record keys (FROMKEY and TOKEY)</a></strong><br />
When the number of key fields and a value are used to specify the FROMKEY or TOKEY parameter, no conversions are done on the input string. The input string is used as is.</li>
</ul>
<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="rbal3copysele.htm" title="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.">Select a specified number of records (NBRRCDS parameter)</a></div>
</div>
</div>
</body>
</html>