ibm-information-center/dist/eclipse/plugins/i5OS.ic.cl_5.4.0.1/cpyfrmimpf.htm

1188 lines
42 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Copy From Import File (CPYFRMIMPF)</title>
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body bgcolor="white">
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<a name="CPYFRMIMPF.Top_Of_Page"></a>
<h2>Copy From Import File (CPYFRMIMPF)</h2>
<table width="100%">
<tr>
<td valign="top" align="left"><b>Where allowed to run: </b>All environments (*ALL)<br>
<b>Threadsafe: </b>No
</td>
<td valign="top" align="right">
<a href="#CPYFRMIMPF.PARAMETERS.TABLE">Parameters</a><br>
<a href="#CPYFRMIMPF.COMMAND.EXAMPLES">Examples</a><br>
<a href="#CPYFRMIMPF.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="CPYFRMIMPF"></a>
<p>The Copy From Import File (CPYFRMIMPF) command copies all or part of an import file to the TOFILE. The term <u> import file</u> is used to describe a file created for purposes of copying data between heterogeneous databases. The import file (FROMSTMF or FROMFILE parameter) is called the <u> from-file</u> for this command.
</p>
<p>An important aspect of this command is its ability to copy the data in parallel. Parallelism is activated for files with at least 50,000 records. Records are not copied in parallel when the FROMSTMF is specified. By using the Change Query Attributes (CHGQRYA) command, the number of tasks used to perform the copy is determined by the DEGREE parameter of the CHGQRYA command. For the best performance in implementing this command, the number of tasks should be set to the number of CPUs + 1.
</p>
<p>For example, if the system has two CPUs, specify CHGQRYA DEGREE(*NBRTASKS 3)
</p>
<p>To use multiple tasks, you must have the Symmetric Multiprocessing Product (SMP) feature installed on the system.
</p>
<p>When copying from a tape file, any file in library QTEMP, a distributed file, or a logical file, only one task will be used. See the CHGQRYA command for more information.
</p>
<p>Some of the specific functions that can be performed by the CPYFRMIMPF command include the following:
</p>
<ul>
<li>Copying a from-file to an externally-described physical file. The to-file must exist on the system before the copy can occur.
</li>
<li>Limiting the range of records copied based on starting and ending relative record numbers.
</li>
<li>Adding records to an existing file member or replacing the contents of a receiving file member (MBROPT parameter).
</li>
</ul>
<p><b>Error Handling:</b> The escape message CPF2817 is sent for many different error conditions that can occur during a copy operation. At least one diagnostic message that indicates the specific error condition always comes before the escape message. More information on handling errors is in the Files and file systems topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
<p><b>Overrides:</b> Overrides are processed for all files.
</p>
<p><b>Status Message:</b> During the running of the CPYFRMIMPF command, message CPI2801 is sent as a status message informing the interactive user that a copy operation is occurring. More information on preventing status messages from appearing is in the Files and file systems topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
<p><b>Performance:</b>
</p>
<p>To increase the performance of the copy:
</p>
<ol>
<li>Delete any logical keyed files based on the to-file.
</li>
<li>Disable all constraints and triggers of the to-file.
</li>
<li>Ensure the from-file records will be copied correctly by attempting to copy a few of the records, by using the FROMRCD and number of records option, before copying all the records.
</li>
<li>Use the ERRLVL(*NOMAX) parameter after knowing the data can be copied correctly.
</li>
</ol>
<p><b>Notes For Delimited Data:</b>
</p>
<ol>
<li>A delimiter can not be a blank(' ') character.
</li>
<li>A blank(' ') can not be contained within a numeric field.
</li>
<li>Fields in the from-file that are longer than the corresponding fields in the to-file will be truncated (on the right).
</li>
<li>If the data of the from-file does not represent all the fields in the to-file, the fields of the to-file will be set to null. If this happens and the to-file fields do not allow a null value, an error will occur and the record will not be copied to the to-file.
</li>
<li>A null field in the from-file can be specified by two adjacent field delimiters, two adjacent string delimiters or a field delimiter followed by a record delimiter.
</li>
<li>From-file field of all blank characters to be stored in a fixed-length field in the to-file, will preserve blank characters even though removal blanks is specified.
</li>
<li>From-file field of all blank characters to be stored in a variable-length field in the to-file, will be represented as only one significant blank character when removal blanks is specified.
</li>
</ol>
<p><b>Notes For Fixed Data:</b> The information for each field of the fixed format file must be in the following order:
</p>
<p>
<pre>
Field Starting Ending Null
Name Position Position Character Position
_________________________________________________________
Field1 1 10 11
Field2 12 15 16
*END
</pre>
</p>
<p>The information for this Field Definition File would be:
</p>
<ol>
<li>The Field Name is the name of the field in the to-file.
</li>
<li>The Starting Position indicates the byte position in the from-file to start copying data for the field.
</li>
<li>The Ending Position indicates the byte position in the from-file to end copying data for the field.
</li>
<li>The Null Character Position is the byte position in the from-file to indicate if the field is null. A value of 'Y' means the field is null. A value of 'N' means the field is not null. If this value is 0, no null character is provided.
</li>
<li>The *END is the indicator for the end of the Field Definition File.
<p>The Field Definition File for the above example would be:
</p>
<p>
<pre>
Field1 1 10 11
Field2 12 15 16
*END
</pre>
</p>
</li>
<li>An alternative for creating the Field Definition File is using the keyword *COL instead of the actual column names. *COL indicates the positions of the data in the stream file for all the columns in the target files listed in order.
<p>An example of the corresponding file above Field Definition File using *COL:
</p>
<p>
<pre>
*COL 1 10 11
*COL 12 15 16
*END
</pre>
</p>
</li>
</ol>
<p><b>Notes For LOB data fields:</b>
</p>
<p>LOB data fields require the use of secondary stream files that contain the LOB data and a Field Definition File that describes the offsets of the fields in the data file. Each record that represents a LOB in the import file contains the name of a secondary stream file, instead of the data.
</p>
<p>
<b>Note: </b>In the following example, there are 3 secondary stream files (lob1.dat, lob2.dat, and lob3.dat) inside of the directory "/lobdata", which contain the actual LOB data to import.
</p>
<p>Using the following FDF:
</p>
<p>
<pre>
Field Starting Ending Null
Name Position Position Character Position
_________________________________________________________
Field1 1 10 42
Field2 12 40 44
*END
</pre>
</p>
<p>The import file would be 44 characters (based on the above FDF) in record length, containing the following data:
</p>
<p>
<pre>
0 1 2 3 4 /Character
12345678901234567890123456789012345678901234 /Position
aaaaaaaaaa /lobdata/lob1.dat N N
bbbbbb /lobdata/lob2.dat N N
/lobdata/lob3.dat Y N
cccccccccc N Y
</pre>
</p>
<p><b>Restrictions:</b>
</p>
<ul>
<li>The from-file and to-file cannot be the same file.
</li>
<li>The to-file must exist prior to the copy.
</li>
<li>The to-file will not have the same relative record numbers as the from-file.
</li>
<li>The from-file must be a source file, or a valid file with 1 field that is not a numeric data type.
</li>
<li>If the from-file is defined with the SHARE(*YES) option for the file, unpredictable results can occur. Therefore, if the file is defined with SHARE(*YES), the user should make sure the file is not opened by any process prior to the copy.
</li>
</ul>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="CPYFRMIMPF.PARAMETERS.TABLE">Parameters</a></h3>
<table border="1" cellpadding="4" cellspacing="0">
<!-- col1="10" col2="15" col3="30" col4="10" -->
<tr>
<th bgcolor="aqua" valign="bottom" align="left">Keyword</th>
<th bgcolor="aqua" valign="bottom" align="left">Description</th>
<th bgcolor="aqua" valign="bottom" align="left">Choices</th>
<th bgcolor="aqua" valign="bottom" align="left">Notes</th>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.FROMSTMF"><b>FROMSTMF</b></a></td>
<td valign="top">From stream file</td>
<td valign="top"><i>Path name</i></td>
<td valign="top">Optional, Positional 2</td>
</tr>
<tr>
<td valign="top" rowspan="5"><a href="#CPYFRMIMPF.FROMFILE"><b>FROMFILE</b></a></td>
<td valign="top">From file</td>
<td valign="top"><i>Element list</i></td>
<td valign="top" rowspan="5">Optional, Positional 3</td>
</tr>
<tr>
<td valign="top">Element 1: File</td>
<td valign="top">
<i>Qualified object name</i></td>
</tr>
<tr>
<td valign="top" style="padding-left:10pt">Qualifier 1: File</td>
<td valign="top"><i>Name</i></td>
</tr><tr>
<td valign="top" style="padding-left:10pt">Qualifier 2: Library</td>
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
</tr><tr>
<td valign="top">Element 2: Member</td>
<td valign="top">
<i>Name</i>, <b><u>*FIRST</u></b>, *ALL</td>
</tr>
<tr>
<td valign="top" rowspan="5"><a href="#CPYFRMIMPF.TOFILE"><b>TOFILE</b></a></td>
<td valign="top">To data base file</td>
<td valign="top"><i>Element list</i></td>
<td valign="top" rowspan="5">Required, Positional 1</td>
</tr>
<tr>
<td valign="top">Element 1: File</td>
<td valign="top">
<i>Qualified object name</i></td>
</tr>
<tr>
<td valign="top" style="padding-left:10pt">Qualifier 1: File</td>
<td valign="top"><i>Name</i></td>
</tr><tr>
<td valign="top" style="padding-left:10pt">Qualifier 2: Library</td>
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
</tr><tr>
<td valign="top">Element 2: Member</td>
<td valign="top">
<i>Name</i>, <b><u>*FIRST</u></b>, *FROMMBR, *ALL</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.MBROPT"><b>MBROPT</b></a></td>
<td valign="top">Replace or add records</td>
<td valign="top"><b><u>*ADD</u></b>, *REPLACE, *UPDADD</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.STMFLEN"><b>STMFLEN</b></a></td>
<td valign="top">Stream file record length</td>
<td valign="top"><i>Integer</i>, <b><u>*TOFILE</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.FROMCCSID"><b>FROMCCSID</b></a></td>
<td valign="top">From CCSID</td>
<td valign="top">1-65533, <b><u>*FILE</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.TOCCSID"><b>TOCCSID</b></a></td>
<td valign="top">To CCSID</td>
<td valign="top">1-65533, <b><u>*FILE</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.RCDDLM"><b>RCDDLM</b></a></td>
<td valign="top">Record delimiter</td>
<td valign="top"><i>Character value</i>, *ALL, *CRLF, *LF, *CR, *LFCR, <b><u>*EOR</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.DTAFMT"><b>DTAFMT</b></a></td>
<td valign="top">Record format of import file</td>
<td valign="top"><b><u>*DLM</u></b>, *FIXED</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.STRDLM"><b>STRDLM</b></a></td>
<td valign="top">String delimiter</td>
<td valign="top"><i>Character value</i>, <b><u>*DBLQUOTE</u></b>, *NONE</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.STRESCCHR"><b>STRESCCHR</b></a></td>
<td valign="top">String escape character</td>
<td valign="top"><i>Character value</i>, <b><u>*STRDLM</u></b>, *NONE</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.RMVBLANK"><b>RMVBLANK</b></a></td>
<td valign="top">Remove blanks</td>
<td valign="top">*NONE, <b><u>*LEADING</u></b>, *TRAILING, *BOTH</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.FLDDLM"><b>FLDDLM</b></a></td>
<td valign="top">Field delimiter</td>
<td valign="top"><i>Character value</i>, <b><u>','</u></b>, *TAB</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top" rowspan="5"><a href="#CPYFRMIMPF.FLDDFNFILE"><b>FLDDFNFILE</b></a></td>
<td valign="top">Field definition file</td>
<td valign="top"><i>Element list</i></td>
<td valign="top" rowspan="5">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: File</td>
<td valign="top">
<i>Qualified object name</i></td>
</tr>
<tr>
<td valign="top" style="padding-left:10pt">Qualifier 1: File</td>
<td valign="top"><i>Name</i></td>
</tr><tr>
<td valign="top" style="padding-left:10pt">Qualifier 2: Library</td>
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
</tr><tr>
<td valign="top">Element 2: Member</td>
<td valign="top">
<i>Name</i>, <b><u>*FIRST</u></b>, *ALL</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.DECPNT"><b>DECPNT</b></a></td>
<td valign="top">Decimal point</td>
<td valign="top"><b><u>*PERIOD</u></b>, *COMMA</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.DATFMT"><b>DATFMT</b></a></td>
<td valign="top">Date format</td>
<td valign="top"><b><u>*ISO</u></b>, *USA, *EUR, *JIS, *MDY, *DMY, *YMD, *JUL, *YYMD</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.DATSEP"><b>DATSEP</b></a></td>
<td valign="top">Date separator</td>
<td valign="top"><b><u>'/'</u></b>, '-', '.', ',', *BLANK</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.TIMFMT"><b>TIMFMT</b></a></td>
<td valign="top">Time format</td>
<td valign="top"><b><u>*ISO</u></b>, *USA, *EUR, *JIS, *HMS</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.TIMSEP"><b>TIMSEP</b></a></td>
<td valign="top">Time separator</td>
<td valign="top"><b><u>':'</u></b>, '.', *BLANK</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#CPYFRMIMPF.FROMRCD"><b>FROMRCD</b></a></td>
<td valign="top">Copy from record number</td>
<td valign="top"><i>Element list</i></td>
<td valign="top" rowspan="3">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: Copy from record number</td>
<td valign="top">
<i>Unsigned integer</i>, <b><u>*FIRST</u></b></td>
</tr>
<tr>
<td valign="top">Element 2: Number of records to copy</td>
<td valign="top">
<i>Unsigned integer</i>, <b><u>*END</u></b></td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.ERRLVL"><b>ERRLVL</b></a></td>
<td valign="top">Errors allowed</td>
<td valign="top"><i>Unsigned integer</i>, <b><u>*NOMAX</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top" rowspan="5"><a href="#CPYFRMIMPF.ERRRCDFILE"><b>ERRRCDFILE</b></a></td>
<td valign="top">Error record file</td>
<td valign="top">Single values: <b><u>*NONE</u></b><br>Other values: <i>Element list</i></td>
<td valign="top" rowspan="5">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: File</td>
<td valign="top">
<i>Qualified object name</i></td>
</tr>
<tr>
<td valign="top" style="padding-left:10pt">Qualifier 1: File</td>
<td valign="top"><i>Name</i></td>
</tr><tr>
<td valign="top" style="padding-left:10pt">Qualifier 2: Library</td>
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
</tr><tr>
<td valign="top">Element 2: Member</td>
<td valign="top">
<i>Name</i>, <b><u>*FIRST</u></b>, *ALL</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.ERRRCDOPT"><b>ERRRCDOPT</b></a></td>
<td valign="top">Replace or add records</td>
<td valign="top"><b><u>*ADD</u></b>, *REPLACE</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.RPLNULLVAL"><b>RPLNULLVAL</b></a></td>
<td valign="top">Replace null values</td>
<td valign="top"><b><u>*NO</u></b>, *FLDDFT</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CPYFRMIMPF.IDCOL"><b>IDCOL</b></a></td>
<td valign="top">Identity column</td>
<td valign="top"><b><u>*GEN</u></b>, *FROMFLD</td>
<td valign="top">Optional</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="CPYFRMIMPF.FROMSTMF"></a>
<h3>From stream file (FROMSTMF)</h3>
<p>Specifies the path name of the stream file from which data is to be copied. Either this parameter or the FROMFILE parameter is required.
</p>
<dl>
<dt><b><i>path-name</i></b></dt>
<dd>Specify the path name of the input stream file.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.FROMFILE"></a>
<h3>From file (FROMFILE)</h3>
<p>Specifies the from-file and file member that contains the records to be copied. Either this parameter or the FROMSTMF parameter is required.
</p>
<p>The from-file can be any of the following file types:
</p>
<ul>
<li>source physical file
</li>
<li>DDM file
</li>
<li>distributed physical file
</li>
<li>program-described physical file
</li>
<li>single-format logical file
</li>
<li>physical file with one (non-numeric) field
</li>
<li>tape file.
</li>
</ul>
<p><b>Element 1: File</b>
</p>
<dl>
<dt><b></b></dt>
<dd>
<p><b>Qualifier 1: File</b>
</p>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the file that contains the records to be copied.
</dd>
</dl>
</dd>
<dt><b></b></dt>
<dd>
<p><b>Qualifier 2: Library</b>
</p>
<dl>
<dt><b><u>*LIBL</u></b></dt>
<dd>All libraries in the library list for the current thread are searched until the first match is found.
</dd>
</dl>
<dl>
<dt><b>*CURLIB</b></dt>
<dd>The current library for the thread is searched. If no library is specified as the current library for the thread, the QGPL library is searched.
</dd>
</dl>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the library to be searched.
</dd>
</dl>
</dd>
</dl>
<p><b>Element 2: Member</b>
</p>
<dl>
<dt><b><u>*FIRST</u></b></dt>
<dd>The first member (in order of creation date) of the from-file is used. Specifying *FIRST is not allowed if the from-file has no members, unless a member name was specified on an OVRDBF (Override with Database File) command for the from-file.
</dd>
<dt><b>*ALL</b></dt>
<dd>All members of the specified from-file are to be copied. *ALL is not valid for a tape file.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the file member to be used.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.TOFILE"></a>
<h3>To data base file (TOFILE)</h3>
<p>Specifies the output database file and member to receive the copied records. The output file is also referred to as the <u> to-file</u> .
</p>
<p>The to-file can be any of the following file types:
</p>
<ul>
<li>source physical file
</li>
<li>DDM file
</li>
<li>distributed physical file
</li>
<li>program-described physical file
</li>
<li>externally-described physical file.
</li>
</ul>
<p>This is a required parameter.
</p>
<p><b>Element 1: File</b>
</p>
<dl>
<dt><b></b></dt>
<dd>
<p><b>Qualifier 1: File</b>
</p>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the file to receive the copied records.
</dd>
</dl>
</dd>
<dt><b></b></dt>
<dd>
<p><b>Qualifier 2: Library</b>
</p>
<dl>
<dt><b><u>*LIBL</u></b></dt>
<dd>All libraries in the library list for the current thread are searched until the first match is found.
</dd>
</dl>
<dl>
<dt><b>*CURLIB</b></dt>
<dd>The current library for the thread is searched. If no library is specified as the current library for the thread, the QGPL library is searched.
</dd>
</dl>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the library to be searched.
</dd>
</dl>
</dd>
</dl>
<p><b>Element 2: Member</b>
</p>
<dl>
<dt><b><u>*FIRST</u></b></dt>
<dd>The first member (in order of creation date) of the output file is used. Specifying *FIRST is not allowed if the to-file has no members, unless a member name was specified on an OVRDBF (Override with Database File) command for the to-file.
</dd>
<dt><b>*ALL</b></dt>
<dd>The data is copied to the correct to-member of the partitioned table. *ALL is only valid for partitioned tables.
</dd>
<dt><b>*FROMMBR</b></dt>
<dd>Corresponding from-file and to-file member names are used.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the file member to receive the copied records. If a member with the specified name does not already exist in the file, the member will be created.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.MBROPT"></a>
<h3>Replace or add records (MBROPT)</h3>
<p>Specifies whether the copy operation replaces, adds, or updates the records in a database file member if a member with the specified name already exists. If the member does not exist, it is created and added to the database file.
</p>
<p>
<b>Note: </b>If *ADD or *UPDADD is specified and the to-file contains no records, the copy operation completes normally. If *REPLACE is specified and the to-file contains no records, the copy operation ends abnormally.
</p>
<dl>
<dt><b>*ADD</b></dt>
<dd>The copied records are added to the end of the existing member records.
</dd>
<dt><b>*REPLACE</b></dt>
<dd>The copied records replace the existing member records.
</dd>
<dt><b>*UPDADD</b></dt>
<dd>The system updates the duplicate key records and adds the new records to the end of the existing records. Additional information is available in the Files and file systems topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.STMFLEN"></a>
<h3>Stream file record length (STMFLEN)</h3>
<p>The maximum record length of any record of the stream file when *DLM is specified for the <b>Record format of import file (DTAFMT)</b> parameter, or the actual record length of all the records of the stream file when *FIXED is specified for the DTAFMT parameter.
</p>
<dl>
<dt><b><u>*TOFILE</u></b></dt>
<dd>The record length of the to-file record is used.
</dd>
<dt><b><i>record-length</i></b></dt>
<dd>Specify the length to be used for each record of the stream file.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.FROMCCSID"></a>
<h3>From CCSID (FROMCCSID)</h3>
<p>Specifies the coded character set identifier (CCSID) of the from-file.
</p>
<dl>
<dt><b><u>*FILE</u></b></dt>
<dd>The from-file CCSID is used. If the from-file is a tape file, the job's default CCSID is used.
</dd>
<dt><b><i>1-65533</i></b></dt>
<dd>Specify the CCSID to be used when the CCSID of the from-file is 65535, or if the from-file is a tape file. If the from-file CCSID is not 65535, or the from-file is not a tape file, an error message will be sent.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.TOCCSID"></a>
<h3>To CCSID (TOCCSID)</h3>
<p>Specifies the coded character set identifier (CCSID) to use for the to-file fields.
</p>
<dl>
<dt><b><u>*FILE</u></b></dt>
<dd>The data is converted to the to-file field CCSID. If the CCSID of the to-file field is 65535, the field is not converted and it is treated as binary data.
</dd>
<dt><b><i>1-65533</i></b></dt>
<dd>Specify the CCSID to be used when the CCSID of the to-file field is 65535. If the CCSID of the to-file field is not 65535, this parameter is ignored.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.RCDDLM"></a>
<h3>Record delimiter (RCDDLM)</h3>
<p>Specifies the record delimiter to be used.
</p>
<p>If the FROMFILE parameter is specified, valid values are *EOR or a character value. If the FROMSTMF parameter is specified, valid values are *CR, *CRLF, *LF, *LFCR or *ALL.
</p>
<dl>
<dt><b><u>*EOR</u></b></dt>
<dd>End of record.
</dd>
<dt><b>*ALL</b></dt>
<dd>First occurrence of any single or double character combination of carriage-return and line-feed.
</dd>
<dt><b>*CRLF</b></dt>
<dd>Carriage-return followed by line-feed.
</dd>
<dt><b>*LF</b></dt>
<dd>Line-feed.
</dd>
<dt><b>*CR</b></dt>
<dd>Carriage-return.
</dd>
<dt><b>*LFCR</b></dt>
<dd>Line-feed followed by carriage-return.
</dd>
<dt><b><i>character-value</i></b></dt>
<dd>Specify the single character which indicates the end of a single record.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.DTAFMT"></a>
<h3>Record format of import file (DTAFMT)</h3>
<p>Specifies the format of the data in the from-file.
</p>
<dl>
<dt><b><u>*DLM</u></b></dt>
<dd>The data contains delimiter characters. Refer to parameter descriptions for STRDLM, FLDDLM, and RCDDLM for information on string, field, and record delimiter characters.
</dd>
<dt><b>*FIXED</b></dt>
<dd>The data format is fixed. The data is in fixed columns in each record. The description of the format of the data is contained in the file member identified by the FLDDFNFILE parameter. Refer to the parameter description for RCDDLM for information on the record delimiter character.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.STRDLM"></a>
<h3>String delimiter (STRDLM)</h3>
<p>Specifies the string delimiter for the data of the fields being copied from. This character indicates the start and end of character, date, time, and timestamp strings in the from-file. Depending on the utility used to create the from-file, some types of strings may appear in the from-file without string delimiter characters.
</p>
<p>The specified delimiter character will be converted from the coded character set identifier (CCSID) of the job to the CCSID of the from-file.
</p>
<dl>
<dt><b><u>*DBLQUOTE</u></b></dt>
<dd>The double quote character is used as the string delimiter.
</dd>
<dt><b>*NONE</b></dt>
<dd>No delimiter is expected as the string delimiter. The blank character ( ) represents the *NONE value.
</dd>
<dt><b><i>character-value</i></b></dt>
<dd>Specify the character value for the string delimiter.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.STRESCCHR"></a>
<h3>String escape character (STRESCCHR)</h3>
<p>Specifies the character to be looked for within string fields in the from-file. Character fields in the from-file may contain characters that have a special meaning to CPYFRMIMPF. These characters include the string delimiter and the string escape character itself. As a result, CPYFRMIMPF could misinterpret the data and produce unexpected results.
</p>
<p>The string escape character precedes such characters in the data and revokes their special meaning. CPYFRMIMPF can then determine if the character is data or a string delimiter. The escape characters are not imported into the to-file.
</p>
<p>This parameter describes the method that the export utility used for character fields that contained the string escape character or string delimiter.
</p>
<p>The specified string escape character will be converted from the coded character set identifier (CCSID) of the job to the CCSID of the from-file. If the from-file CCSID is 1200, 1208, or 13488 the string escape character is converted to the job CCSID, or the job's default CCSID when the job CCSID is 65535.
</p>
<dl>
<dt><b><u>*STRDLM</u></b></dt>
<dd>The string delimiter is used as the escape character. If a character data field contains two adjacent string delimiter characters, they are interpreted as a single data character.
</dd>
<dt><b>*NONE</b></dt>
<dd>No string escape character is present in the data. If any string delimiter characters are present in the data, they will be treated as string delimiters.
</dd>
<dt><b><i>character-value</i></b></dt>
<dd>Specify the character to be used as the escape character.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.RMVBLANK"></a>
<h3>Remove blanks (RMVBLANK)</h3>
<p>Specifies whether blanks are removed or retained.
</p>
<dl>
<dt><b><u>*LEADING</u></b></dt>
<dd>Leading blanks are removed.
</dd>
<dt><b>*TRAILING</b></dt>
<dd>Trailing blanks are removed.
</dd>
<dt><b>*BOTH</b></dt>
<dd>Leading and trailing blanks are removed.
</dd>
<dt><b>*NONE</b></dt>
<dd>All leading and trailing blanks are retained.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.FLDDLM"></a>
<h3>Field delimiter (FLDDLM)</h3>
<p>Specifies the field delimiter for the record being copied from. This value is used to determine where one field ends and the next field begins.
</p>
<dl>
<dt><b><u>','</u></b></dt>
<dd>The comma character is the default name of the field delimiter.
</dd>
<dt><b><i>*TAB</i></b></dt>
<dd>The horizontal tab character is used as field delimiter.
</dd>
<dt><b><i>character-value</i></b></dt>
<dd>Specify the character value for the field delimiter.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.FLDDFNFILE"></a>
<h3>Field definition file (FLDDFNFILE)</h3>
<p>Specifies the field definition file which defines the format of the data when *FIXED is specified for the <b>Record format of import file (DTAFMT)</b> parameter. If DTAFMT(*FIXED) is specified, this parameter is required.
</p>
<p>The field definition file can be any of the following file types:
</p>
<ul>
<li>source physical file
</li>
<li>DDM file
</li>
<li>distributed physical file
</li>
<li>program-described physical file
</li>
<li>externally-described physical file with one field.
</li>
</ul>
<p><b>Element 1: File</b>
</p>
<dl>
<dt><b></b></dt>
<dd>
<p><b>Qualifier 1: File</b>
</p>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the file that contains the fixed field definition.
</dd>
</dl>
</dd>
<dt><b></b></dt>
<dd>
<p><b>Qualifier 2: Library</b>
</p>
<dl>
<dt><b><u>*LIBL</u></b></dt>
<dd>All libraries in the library list for the current thread are searched until the first match is found.
</dd>
</dl>
<dl>
<dt><b>*CURLIB</b></dt>
<dd>The current library for the thread is searched. If no library is specified as the current library for the thread, the QGPL library is searched.
</dd>
</dl>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the library to be searched.
</dd>
</dl>
</dd>
</dl>
<p><b>Element 2: Member</b>
</p>
<dl>
<dt><b><u>*FIRST</u></b></dt>
<dd>The first member (in order of creation date) in the field definition file is used.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the field definition file member to use.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.DECPNT"></a>
<h3>Decimal point (DECPNT)</h3>
<p>Specifies the decimal point character to be used when copying numeric data from the from-file.
</p>
<dl>
<dt><b><u>*PERIOD</u></b></dt>
<dd>A period (.) is used for the decimal point character.
</dd>
<dt><b>*COMMA</b></dt>
<dd>A comma (,) is used for the decimal point character.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.DATFMT"></a>
<h3>Date format (DATFMT)</h3>
<p>Specifies the date format to be used when copying date fields from the from-file.
</p>
<dl>
<dt><b><u>*ISO</u></b></dt>
<dd>The International Organization for Standardization (ISO) date format <b>yyyy-mm-dd</b> is used.
</dd>
<dt><b>*USA</b></dt>
<dd>The United States date format <b>mm/dd/yyyy</b> is used.
</dd>
<dt><b>*EUR</b></dt>
<dd>The European date format <b>dd.mm.yyyy</b> is used.
</dd>
<dt><b>*JIS</b></dt>
<dd>The Japanese Industrial Standard date format <b>yyyy-mm-dd</b> is used.
</dd>
<dt><b>*MDY</b></dt>
<dd>The date format <b>mm/dd/yy</b> is used.
</dd>
<dt><b>*DMY</b></dt>
<dd>The date format <b>dd/mm/yy</b> is used.
</dd>
<dt><b>*YMD</b></dt>
<dd>The date format <b>yy/mm/dd</b> is used.
</dd>
<dt><b>*JUL</b></dt>
<dd>The Julian date format <b>yy/ddd</b> is used.
</dd>
<dt><b>*YYMD</b></dt>
<dd>The date format <b>yyyymmdd</b> is used.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.DATSEP"></a>
<h3>Date separator (DATSEP)</h3>
<p>Specifies the date separator for the date format. The separator is ignored for DATFMT of *ISO, *USA, *EUR, and *JIS because these formats have a fixed date separator.
</p>
<dl>
<dt><b><u>'/'</u></b></dt>
<dd>A forward slash is used as the date separator character.
</dd>
<dt><b>'-'</b></dt>
<dd>A hyphen is used as the date separator character.
</dd>
<dt><b>'.'</b></dt>
<dd>A period is used as the date separator character.
</dd>
<dt><b>','</b></dt>
<dd>A comma is used as the date separator character.
</dd>
<dt><b>*BLANK</b></dt>
<dd>A blank is used as the date separator character.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.TIMFMT"></a>
<h3>Time format (TIMFMT)</h3>
<p>Specifies the time format to be used when copying time fields from the from-file.
</p>
<dl>
<dt><b><u>*ISO</u></b></dt>
<dd>The International Organization for Standardization (ISO) time format <b>hh.mm.ss</b> is used.
</dd>
<dt><b>*USA</b></dt>
<dd>The United States time format <b>hh:mmxx</b> is used, where <b>xx</b> is AM or PM.
</dd>
<dt><b>*EUR</b></dt>
<dd>The European time format <b>hh.mm.ss</b> is used.
</dd>
<dt><b>*JIS</b></dt>
<dd>The Japanese Industrial Standard time format <b>hh:mm:ss</b> is used.
</dd>
<dt><b>*HMS</b></dt>
<dd>The <b>hh:mm:ss</b> format is used.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.TIMSEP"></a>
<h3>Time separator (TIMSEP)</h3>
<p>Specifies the time separator for the time format. This parameter is ignored if *ISO, *USA, *EUR, or *JIS is specified for the <b>Time format (TIMFMT)</b> parameter because those time formats define the required time separator character.
</p>
<dl>
<dt><b><u>':'</u></b></dt>
<dd>A colon is used as the time separator character.
</dd>
<dt><b>'.'</b></dt>
<dd>A period is used as the time separator character.
</dd>
<dt><b>*BLANK</b></dt>
<dd>A blank is used as the time separator character.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.FROMRCD"></a>
<h3>Copy from record number (FROMRCD)</h3>
<p>Specifies which records are copied from the from-file.
</p>
<p><b>Element 1: Copy from record number</b>
</p>
<dl>
<dt><b><u>*FIRST</u></b></dt>
<dd>The copy operation begins with the first record in the from-file.
</dd>
<dt><b><i>1-4294967288</i></b></dt>
<dd>Specify the record number of the first record to be copied from the from-file.
</dd>
</dl>
<p><b>Element 2: Number of records to copy</b>
</p>
<dl>
<dt><b><u>*END</u></b></dt>
<dd>Records are copied until the end-of-file condition is indicated.
</dd>
<dt><b><i>1-4294967288</i></b></dt>
<dd>Specify the number of records to be copied from the from-file. If an end-of-file condition is reached before this number of records has been copied, no error message is issued and the copy operation ends normally.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.ERRLVL"></a>
<h3>Errors allowed (ERRLVL)</h3>
<p>Specifies the maximum number of recoverable read or write errors for the to-file that are tolerated during the copy operation.
</p>
<dl>
<dt><b><u>*NOMAX</u></b></dt>
<dd>No maximum number of errors is specified, and all recoverable errors are tolerated. The copy operation continues regardless of the number of recoverable errors found.
</dd>
<dt><b><i>number-of-errors</i></b></dt>
<dd>Specify the maximum number of recoverable errors allowed. If one more recoverable error occurs than the value specified here, the copy operation ends.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.ERRRCDFILE"></a>
<h3>Error record file (ERRRCDFILE)</h3>
<p>Specifies the database file where the records that are in error should be written.
</p>
<p>The error record file can be any of the following file types:
</p>
<ul>
<li>source physical file
</li>
<li>DDM file
</li>
<li>distributed physical file
</li>
<li>program-described physical file
</li>
<li>externally-described physical file.
</li>
</ul>
<p><b>Single values</b>
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No error record file is provided.
</dd>
</dl>
<p><b>Element 1: File</b>
</p>
<dl>
<dt><b></b></dt>
<dd>
<p><b>Qualifier 1: File</b>
</p>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the error record file.
</dd>
</dl>
</dd>
<dt><b></b></dt>
<dd>
<p><b>Qualifier 2: Library</b>
</p>
<dl>
<dt><b><u>*LIBL</u></b></dt>
<dd>All libraries in the library list for the current thread are searched until the first match is found.
</dd>
</dl>
<dl>
<dt><b>*CURLIB</b></dt>
<dd>The current library for the thread is searched. If no library is specified as the current library for the thread, the QGPL library is searched.
</dd>
</dl>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the library to be searched.
</dd>
</dl>
</dd>
</dl>
<p><b>Element 2: Member</b>
</p>
<dl>
<dt><b><u>*FIRST</u></b></dt>
<dd>The first member (in order of creation date) in the error file is used.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the error file member to be used to contain the from-file records which contained errors.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.ERRRCDOPT"></a>
<h3>Replace or add records (ERRRCDOPT)</h3>
<p>Specifies how error records are added to the error record file.
</p>
<dl>
<dt><b><u>*ADD</u></b></dt>
<dd>The system adds the new records to the end of the existing records.
</dd>
<dt><b>*REPLACE</b></dt>
<dd>The system deletes any existing records and adds the new records.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.RPLNULLVAL"></a>
<h3>Replace null values (RPLNULLVAL)</h3>
<p>Specifies whether null field values will be replaced when copying import file records.
</p>
<dl>
<dt><b><u>*NO</u></b></dt>
<dd>If a field in the to-file is null capable a null value will be used. Otherwise an error will be sent.
</dd>
<dt><b>*FLDDFT</b></dt>
<dd>If a null value is detected when parsing an import file record, the corresponding field in the database file record is assigned a default value based on the field type or DDS default value.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CPYFRMIMPF.IDCOL"></a>
<h3>Identity column (IDCOL)</h3>
<p>Specifies, if the to-file is an SQL table which contains a column with the IDENTITY attribute or a column with the ROWID data type, whether the value for the column will be generated by the system or the default value is used.
</p>
<dl>
<dt><b><u>*GEN</u></b></dt>
<dd>A system-generated value will be inserted into the Identity Column or ROWID column.
</dd>
<dt><b>*FROMFLD</b></dt>
<dd>If a value exists in the Identity Column or ROWID column of the fromfile field, this value will be inserted into the Identity Column of the to-file.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="CPYFRMIMPF.COMMAND.EXAMPLES">Examples</a> </h3>
<p><b>Example 1: Copying Physical File Import File</b>
</p>
<p>
<pre>
CHGQRYA DEGREE(*NBRTASKS 3)
:
CPYFRMIMPF FROMFILE(IMPFILE) TOFILE(DB2FILE)
FLDDLM(';') RCDDLM(X'07')
DATFMT(*JIS) TIMFMT(*JIS)
</pre>
</p>
<p>The Change Query Attribute (CHGQRYA) is run prior to CPYFRMIMPF to allow the copy processing to be done by three tasks running in parallel.
</p>
<p>All records of file IMPFILE will be copied to the externally-described physical file DB2FILE. Fields in the from-file are delimited by semi-colon (;) characters. Each record in the from file is delimited by a hexadecimal '07' character. Input date fields are are in <b>yyyy-mm-dd</b> format. Input time fields are in <b>hh:mm:ss</b> format.
</p>
<p><b>Example 2: Copying Tape File Import File</b>
</p>
<p>
<pre>
OVRTAPF FILE(QTAPE) DEV(TAP02) SEQNBR(3)
:
CPYFRMIMPF FROMFILE(QTAPE) TOFILE(DB2WHS) ERRFILE(IMPERR)
</pre>
</p>
<p>The Override Tape File (OVRTAPF) parameter is run prior to CPYFRMIMPF to indicate that tape device TAP02 should be used for doing the copy. The from-file must be the third file on the tape mounted on TAP02.
</p>
<p>All records of the from-file will be copied to the externally described physical file DB2WHS. Fields in the from-file are delimited by comma (,) characters. Input date fields are are in <b>yyyy-mm-dd</b> (ISO) format. Input time fields are in <b>hh.mm.ss</b> (ISO) format. From-file records that are found to contain errors and cannot be added to file DB2WHS are added to error file IMPERR.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="CPYFRMIMPF.ERROR.MESSAGES">Error messages</a> </h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>CPF2817</b></dt>
<dd>Copy command ended because of error.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CPYFRMIMPF.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>