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

159 lines
5.6 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>Change Current Directory (CD)</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="CD.Top_Of_Page"></a>
<h2>Change Current Directory (CD)</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="#CD.PARAMETERS.TABLE">Parameters</a><br>
<a href="#CD.COMMAND.EXAMPLES">Examples</a><br>
<a href="#CD.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="CD"></a>
<p>The Change Current Directory (CD) command changes a specified directory to the current working directory. The current directory can be a directory, library, folder, or database file. The current directory is used to locate objects used by the commands.
</p>
<p>This command is an alias for the Change Current Directory (CHGCURDIR) command and can also be issued using the following alternative command names:
</p>
<ul>
<li>CHDIR
</li>
<li>CHGCURDIR
</li>
</ul>
<p>For more information about integrated file system commands, see the Integrated file system information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
<p><b>Restrictions:</b>
</p>
<ol>
<li>This command works on only one object. If a pattern is specified on the <b>Directory (DIR)</b> parameter and more than one object matches the pattern, the user can select the object from a list in an interactive job. If this is a batch job, the command fails with error message CPFA08E, "More than one name matches pattern.".
</li>
<li>The current directory and current library are separate and distinct entities. The current library and current directory can be set to the same library, but a change to either the current library or current directory does not affect the other.
<p>The current directory, set with this command, affects the integrated file system commands and APIs. The current library, set with the Change Current Library (CHGCURLIB) command, affects commands such as the Create Display File (CRTDSPF) command, that uses the value *CURLIB as a library qualifier.
</p>
</li>
<li>The user must have read (*R) authority to the directory.
</li>
<li>The user must have execute (*X) authority to each directory in the path.
</li>
</ol>
</div>
<table width="100%">
<tr><td align="right"><a href="#CD.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="CD.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="#CD.DIR"><b>DIR</b></a></td>
<td valign="top">Directory</td>
<td valign="top"><i>Path name</i></td>
<td valign="top">Required, Positional 1</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#CD.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="CD.DIR"></a>
<h3>Directory (DIR)</h3>
<p>Specifies the path name of the directory that replaces the current working directory of the job.
</p>
<p>For more information on specifying path names, refer to "Object naming rules" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
<p>This is a required parameter.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#CD.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="CD.COMMAND.EXAMPLES">Examples</a> </h3>
<p>The alternative command name for CD is CHGCURDIR. The following examples use the alternative command name, but CD can be replaced directly for CHGCURDIR in all of them.
</p>
<p><b>Example 1: Changing a Current Directory</b>
</p>
<p>
<pre>
CHGCURDIR DIR(/DIRECTORY2)
</pre>
</p>
<p>This command changes the current directory to the directory named DIRECTORY2.
</p>
<p><b>Example 2: Changing a Current Directory to the Parent of the Current Directory</b>
</p>
<p>
<pre>
CHGCURDIR DIR('..')
</pre>
</p>
<p>This command changes the current directory to the parent directory of the directory that contains the current directory before this command is run.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#CD.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="CD.ERROR.MESSAGES">Error messages</a> </h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>CPFA085</b></dt>
<dd>Home directory not found for user &amp;1.
</dd>
<dt><b>CPFA08E</b></dt>
<dd>More than one name matches pattern.
</dd>
<dt><b>CPFA093</b></dt>
<dd>Name matching pattern not found.
</dd>
<dt><b>CPFA09C</b></dt>
<dd>Not authorized to object. Object is &amp;1.
</dd>
<dt><b>CPFA09D</b></dt>
<dd>Error occurred in program &amp;1.
</dd>
<dt><b>CPFA0A1</b></dt>
<dd>An input or output error occurred.
</dd>
<dt><b>CPFA0A3</b></dt>
<dd>Path name resolution causes looping.
</dd>
<dt><b>CPFA0A7</b></dt>
<dd>Path name too long.
</dd>
<dt><b>CPFA0A9</b></dt>
<dd>Object not found. Object is &amp;1.
</dd>
<dt><b>CPFA0AB</b></dt>
<dd>Operation failed for object. Object is &amp;1.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CD.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>