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

80 lines
4.8 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="Null-capable fields using FMTOPT(*MAP) or FMTOPT(*NOCHK)" />
<meta name="DC.Relation" scheme="URI" content="rbal3specdata.htm" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rbal3nullcap" />
<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>Null-capable fields using FMTOPT(*MAP) or FMTOPT(*NOCHK)</title>
</head>
<body id="rbal3nullcap"><a name="rbal3nullcap"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Null-capable fields using FMTOPT(*MAP) or FMTOPT(*NOCHK)</h1>
<div><div class="p">FMTOPT(*MAP) or FMTOPT(*NOCHK) must be specified on the <a href="../cl/cpyf.htm">CPYF</a> command if: <ul><li>The from-file is a database data file.</li>
<li>The to-file is a physical data file.</li>
<li>The record formats are not identical.</li>
</ul>
</div>
<p>For the record formats to be identical, corresponding fields in the from-file
and to-file must both be null-capable or not null-capable. For the <a href="../cl/cpyfrmqryf.htm">CPYFRMQRYF</a> command, the same
is true except that the open query file record format is used (rather than
a from-file format).</p>
<div class="p">When you use FMTOPT(*MAP): <ul><li>Null values are copied from null-capable from-file fields to null-capable
to-file fields that are named alike. This copying can only happen if the field
attributes and lengths are compatible.</li>
<li>Fields that are not null-capable can also be copied from and to null-capable
fields, provided the field attributes and lengths are compatible. The results
to expect in the to-file field are: <ul><li>Copying a null-capable field to a null-capable field <p>Null values in
the from-file field are copied to the to-file field. Values that are not null
in the from-file field are also copied to the to-file field. For values that
are not null in the from-file field that cause conversion errors during the
copy, the default value of the to-file field is placed into the to-file field.</p>
</li>
<li>Copying a field that is not null capable to a null-capable field <p>Values
that are not null in the from-file field are copied to the to-file field.
For values in the from-file field that cause conversion errors during the
copy operation, the default value of the to-file field is placed into the
to-file field.</p>
</li>
<li>Copying a null-capable field to a field that is not null capable <p>Values
that are not null in the from-file field are copied to the to-file field.
If a conversion error occurs when copying values that are not null or the
from-file field value is null, the to-file field default value is placed into
the to-file.</p>
</li>
</ul>
</li>
</ul>
</div>
<p>When you use FMTOPT(*NONE), the null values in the from-file are copied
to the to-file when copying a database file to a physical data file with identical
record formats.</p>
<p>When you use FMTOPT(*DROP), the null values are copied.</p>
<p>When you use FMTOPT(*NOCHK) or FMTOPT(*CVTSRC), the record data is copied
directly from left to right into the to-file without any regard to field types. Null values are <u>not</u> copied if *NOCHK or *CVTSRC is specified, because
the record formats need not be identical. Either a user-specified or default
value is copied to the to-file rather than a null value.</p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbal3specdata.htm" title="You can use FMTOPT(*MAP) to map data between fixed-length and variable-length fields and between variable-length fields with different maximum lengths.">Specify data for different field types and attributes</a></div>
</div>
</div>
</body>
</html>