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

87 lines
6.3 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 based on character content (INCCHAR parameter)" />
<meta name="abstract" content="You can select records on the basis of the content of characters that start in a specific position in the record or field." />
<meta name="description" content="You can select records on the basis of the content of characters that start in a specific position in the record or field." />
<meta name="DC.Relation" scheme="URI" content="rbal3selrecords.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3copyvar.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3copyinc.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3cpyin.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal3copygrap.htm" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rbal3copyrec" />
<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 based on character content (INCCHAR parameter)</title>
</head>
<body id="rbal3copyrec"><a name="rbal3copyrec"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Select records based on character content (INCCHAR parameter)</h1>
<div><p>You can select records on the basis of the content of characters
that start in a specific position in the record or field. </p>
<div class="note"><span class="notetitle">Note:</span> You can use this parameter on the CPYF command only.</div>
<p>You can use the INCCHAR parameter with the FROMKEY or FROMRCD parameter.
You can select records first by their key value or relative record number,
and then by characters in some position in the record or field.</p>
<p>You can test for any character string of 1 through 256 bytes. If the character
string contains any special characters or blanks, you must enclose the entire
string in apostrophes.</p>
<p>You can also specify *CT (contains) as the operator for the INCCHAR parameter.
This specifies that the copy command should scan each record in the from-file
for the selection character string. You can specify any valid starting position
in the field or record for the start of the scan. The data will then be scanned
from that position to the byte to the extreme right of the field or record.</p>
<p>If you specify both the INCCHAR and INCREL parameters, the copy command
copies a record only if it satisfies both the INCCHAR and INCREL conditions.</p>
<div class="p">This example shows how you can test for all records in the file DBIN that
have an XXX starting in position 80. It then shows how you can copy these
records to the file DKTOUT. Because this example includes testing for positions
relative to the length of the whole record, you must specify *RCD on the INCCHAR
parameter. <pre>CPYF FROMFILE(DBIN) TOFILE(DKTOUT) +
INCCHAR(*RCD 80 *EQ XXX)</pre>
</div>
<div class="p">If you were testing for an XXX in a position in a particular field in the
record, you would specify the field name instead of *RCD, and the starting
position of the character relative to the start of the field. <pre>CPYF FROMFILE(DBIN) TOFILE(DKTOUT) +
INCCHAR(FLDA 6 *EQ XXX)</pre>
</div>
<p>A field name cannot be specified if RCDFMT(*ALL) is specified when copying
from a multiple-format logical file, or if the from-file is a device file
or inline data file.</p>
<p>For binary character fields, the INCCHAR parameter will use the binary
character comparison rules. Comparisons will be performed by CPYF and no padding
or truncation will be performed.</p>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rbal3copyvar.htm">Variable-length fields used by the INCCHAR parameter</a></strong><br />
When you specify *RCD for the INCCHAR parameter, the starting position represents the position in the buffer. The 2-byte length field of variable-length fields must be considered when determining the position.</li>
<li class="ulchildlink"><strong><a href="rbal3copyinc.htm">Null-capable fields used by the INCCHAR parameter</a></strong><br />
The INCCHAR parameter allows null-capable character-field and null-capable DBCS-field names to be specified. However, any logical comparison with a null-field value tests as false, and the record is not copied.</li>
<li class="ulchildlink"><strong><a href="rbal3cpyin.htm">Different CCSIDs used by the INCCHAR parameter</a></strong><br />
When you specify *RCD for the INCCHAR parameter, the copy command does not perform any conversions on the input string. The command compares the byte string that you entered at the specified position in the record buffer of the from-file.</li>
<li class="ulchildlink"><strong><a href="rbal3copygrap.htm">DBCS-graphic fields used by the INCCHAR parameter</a></strong><br />
When you specify a graphic field for the INCCHAR parameter, you should enclose the DBCS data in shift-out and shift-in characters. The command assumes that the data is in the associated DBCS CCSID of the job CCSID.</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>
</body>
</html>