269 lines
12 KiB
HTML
269 lines
12 KiB
HTML
|
|
||
|
<!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 Library (CPYLIB)</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="CPYLIB.Top_Of_Page"></a>
|
||
|
<h2>Copy Library (CPYLIB)</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="#CPYLIB.PARAMETERS.TABLE">Parameters</a><br>
|
||
|
<a href="#CPYLIB.COMMAND.EXAMPLES">Examples</a><br>
|
||
|
<a href="#CPYLIB.ERROR.MESSAGES">Error messages</a></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<div> <a name="CPYLIB"></a>
|
||
|
<p>The Copy Library (CPYLIB) command copies the contents of a library to a new library. If the new library does not exist, the command optionally creates it before the copy.
|
||
|
</p>
|
||
|
<p>All copied objects are created in the same auxiliary storage pool (ASP) as the new library. Any objects that already exist in the new library remain in the new library after the new objects are copied.
|
||
|
</p>
|
||
|
<p><b>Note:</b> If the new library is created by this command:
|
||
|
</p>
|
||
|
<ul>
|
||
|
<li>The new library is created in the same ASP as the existing library.
|
||
|
</li>
|
||
|
<li>The public authority of the new library is the same as the create authority for the QSYS library. The create authority for the QSYS library can be displayed by using the Display Library Description (DSPLIBD) command. If the create authority for the QSYS library is changed with the Change Library (CHGLIB) command after the new library is created, the new authority will not affect the public authority for the new library.
|
||
|
</li>
|
||
|
<li>The private authorities for the existing library are not copied to the new library.
|
||
|
</li>
|
||
|
<li>The owner of the new library is either the user profile of the user who issues the command or the group profile if the user profile of the user who issues the command is a member user profile that has specified that the group should be the owner.
|
||
|
</li>
|
||
|
<li>The new library is not secured by an authorization list even if the existing library was secured by an authorization list.
|
||
|
</li>
|
||
|
<li>You can use the Grant Object Authority (GRTOBJAUT) command specifying the existing library for the <b>Reference object (REFOBJ)</b> parameter to copy authorities from the existing library to the new library.
|
||
|
</li>
|
||
|
</ul>
|
||
|
<p><b>Restrictions:</b>
|
||
|
</p>
|
||
|
<ul>
|
||
|
<li>Only object types supported by the Create Duplicate Object (CRTDUPOBJ) command can be copied. The restrictions for the CRTDUPOBJ command also apply to this command.
|
||
|
</li>
|
||
|
<li>If this command is interrupted prior to completion, the results are unpredictable.
|
||
|
</li>
|
||
|
<li>If another job is processing any of the objects in the library specified for the <b>Existing library (FROMLIB)</b> parameter, the results may be unpredictable. For example:
|
||
|
<ul>
|
||
|
<li>Objects created in the existing library after the copy starts are not copied.
|
||
|
</li>
|
||
|
<li>If objects are deleted from the existing library after the copy starts, a user of this command gets an error message.
|
||
|
</li>
|
||
|
<li>If objects in the existing library are in use or are locked by another job, the copy may not be successful.
|
||
|
</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>Other jobs should not attempt to use objects in the library specified for the <b>New library (TOLIB)</b> parameter until the copy is complete.
|
||
|
</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CPYLIB.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<hr size="2" width="100%">
|
||
|
|
||
|
<div>
|
||
|
<h3><a name="CPYLIB.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="#CPYLIB.FROMLIB"><b>FROMLIB</b></a></td>
|
||
|
<td valign="top">Existing library</td>
|
||
|
<td valign="top"><i>Name</i></td>
|
||
|
<td valign="top">Required, Positional 1</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td valign="top"><a href="#CPYLIB.TOLIB"><b>TOLIB</b></a></td>
|
||
|
<td valign="top">New library</td>
|
||
|
<td valign="top"><i>Name</i></td>
|
||
|
<td valign="top">Required, Positional 2</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td valign="top"><a href="#CPYLIB.CRTLIB"><b>CRTLIB</b></a></td>
|
||
|
<td valign="top">Create library</td>
|
||
|
<td valign="top"><b><u>*YES</u></b>, *NO</td>
|
||
|
<td valign="top">Optional</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td valign="top"><a href="#CPYLIB.DATA"><b>DATA</b></a></td>
|
||
|
<td valign="top">Duplicate data</td>
|
||
|
<td valign="top"><b><u>*YES</u></b>, *NO</td>
|
||
|
<td valign="top">Optional</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td valign="top"><a href="#CPYLIB.CST"><b>CST</b></a></td>
|
||
|
<td valign="top">Duplicate constraints</td>
|
||
|
<td valign="top"><b><u>*YES</u></b>, *NO</td>
|
||
|
<td valign="top">Optional</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td valign="top"><a href="#CPYLIB.TRG"><b>TRG</b></a></td>
|
||
|
<td valign="top">Duplicate triggers</td>
|
||
|
<td valign="top"><b><u>*YES</u></b>, *NO</td>
|
||
|
<td valign="top">Optional</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CPYLIB.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div> <a name="CPYLIB.FROMLIB"></a>
|
||
|
<h3>Existing library (FROMLIB)</h3>
|
||
|
<p>Specifies the existing library to be copied.
|
||
|
</p>
|
||
|
<p>This is a required parameter.
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b><i>name</i></b></dt>
|
||
|
<dd>Specify the name of the existing library to be copied.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CPYLIB.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<div> <a name="CPYLIB.TOLIB"></a>
|
||
|
<h3>New library (TOLIB)</h3>
|
||
|
<p>Specifies the new library to which objects will be copied from the existing library.
|
||
|
</p>
|
||
|
<p>This is a required parameter.
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b><i>name</i></b></dt>
|
||
|
<dd>Specify the name of the library to which objects will be copied.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CPYLIB.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<div> <a name="CPYLIB.CRTLIB"></a>
|
||
|
<h3>Create library (CRTLIB)</h3>
|
||
|
<p>Specifies whether the new library should be created.
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b><u>*YES</u></b></dt>
|
||
|
<dd>The new library will be created by this command before the contents of the existing library are copied to it. If the new library already exists, an error message will be issued.
|
||
|
</dd>
|
||
|
<dt><b>*NO</b></dt>
|
||
|
<dd>The new library should not be created. If the new library does not exist, an error message will be issued.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CPYLIB.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<div> <a name="CPYLIB.DATA"></a>
|
||
|
<h3>Duplicate data (DATA)</h3>
|
||
|
<p>Specifies whether the data records in database physical files or save files in the existing library are copied to the newly-created object in the new library. Members of physical files are copied whether or not the data contained in them is copied. The specified value is not used for objects which are not database physical files or save files.
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b><u>*YES</u></b></dt>
|
||
|
<dd>The data records in the members of database physical files or save files in the existing library are copied to the new object in the new library.
|
||
|
<p>
|
||
|
<b>Note: </b>The relative record numbers in the new file are the same as those in the original file.
|
||
|
</p>
|
||
|
</dd>
|
||
|
<dt><b>*NO</b></dt>
|
||
|
<dd>The data records in the members of database physical files or save files in the existing library are not copied to the new object in the new library.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CPYLIB.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<div> <a name="CPYLIB.CST"></a>
|
||
|
<h3>Duplicate constraints (CST)</h3>
|
||
|
<p>Specifies whether any constraints associated with database physical files in the existing library are copied to the newly-created files in the new library. The specified value is not used for objects which are not database physical files.
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b><u>*YES</u></b></dt>
|
||
|
<dd>The constraints associated with a database physical file in the existing library are copied to the newly-created file in the new library.
|
||
|
</dd>
|
||
|
<dt><b>*NO</b></dt>
|
||
|
<dd>The constraints associated with a database physical file in the existing library are not copied to the newly-created file in the new library.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CPYLIB.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<div> <a name="CPYLIB.TRG"></a>
|
||
|
<h3>Duplicate triggers (TRG)</h3>
|
||
|
<p>Specifies whether any triggers associated with database physical files in the existing library are copied to the newly-created files in the new library. The specified value is not used for objects which are not database physical files.
|
||
|
</p>
|
||
|
<p>
|
||
|
<b>Note: </b>There are special considerations of which to be aware relating to the duplication of triggers. For example, the duplication will differ depending on whether or not the trigger program associated with the existing file was in the same library as the existing file. For additional information, see the Database information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b><u>*YES</u></b></dt>
|
||
|
<dd>The triggers associated with a database physical file in the existing library are copied to the newly-created file in the new library.
|
||
|
</dd>
|
||
|
<dt><b>*NO</b></dt>
|
||
|
<dd>The triggers associated with a database physical file in the existing library are not copied to the newly-created file in the new library.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CPYLIB.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<hr size="2" width="100%">
|
||
|
<div><h3><a name="CPYLIB.COMMAND.EXAMPLES">Examples</a> </h3>
|
||
|
<p><b>Example 1: Copying the Contents of a Library to a New library After Creating the New Library</b>
|
||
|
</p>
|
||
|
<p>
|
||
|
<pre>
|
||
|
CPYLIB FROMLIB(MYLIB) TOLIB(NEWLIB)
|
||
|
</pre>
|
||
|
</p>
|
||
|
<p>This command copies the contents of library MYLIB into library NEWLIB after creating library NEWLIB. The data records, constraints, and triggers associated with a database physical file in MYLIB will be copied to the database physical file in NEWLIB.
|
||
|
</p>
|
||
|
<p><b>Example 2: Copying the Contents of a Library to an Existing Library</b>
|
||
|
</p>
|
||
|
<p>
|
||
|
<pre>
|
||
|
CPYLIB FROMLIB(MYLIBA) TOLIB(MYLIBB) CRTLIB(*NO) +
|
||
|
DATA(*YES) CST(*NO) TRG(*NO)
|
||
|
MONMSG MSGID(CPF2358)
|
||
|
</pre>
|
||
|
</p>
|
||
|
<p>This command copies the contents of library MYLIBA into existing library MYLIBB. All copied objects are created in the same auxiliary storage pool (ASP) as library MYLIBB. Any objects that already exist in library MYLIBB remain in library MYLIBB after the new objects are copied. The data records in a database physical file in MYLIBA will be copied to a newly created database physical file in MYLIBB. The constraints and triggers associated with a database physical file in MYLIBA will not be copied to a newly created database physical file in MYLIBB.
|
||
|
</p>
|
||
|
<p>The MONMSG command allows you to ignore escape message CPF2358 which may be signalled if all objects in library MYLIBA cannot be copied to library MYLIBB. One reason an object cannot be copied is if the object already exists in library MYLIBB.
|
||
|
</p>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CPYLIB.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
<hr size="2" width="100%">
|
||
|
<div><h3><a name="CPYLIB.ERROR.MESSAGES">Error messages</a> </h3>
|
||
|
<p><b><u>*ESCAPE Messages</u></b>
|
||
|
</p>
|
||
|
<dl>
|
||
|
<dt><b>CPF2358</b></dt>
|
||
|
<dd>Library &1 not copied or partially copied.
|
||
|
</dd>
|
||
|
<dt><b>CPF2365</b></dt>
|
||
|
<dd>FROMLIB and TOLIB parameters cannot specify the same library.
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</div>
|
||
|
<table width="100%">
|
||
|
<tr><td align="right"><a href="#CPYLIB.Top_Of_Page">Top</a></td></tr>
|
||
|
</table>
|
||
|
</body>
|
||
|
</html>
|