Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Change Current Directory (CHDIR) 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.
This command is an alias for the Change Current Directory (CHGCURDIR) command and can also be issued using the following alternative command names:
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.
Restrictions:
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.
Top |
Specifies the path name of the directory that replaces the current working directory of the job.
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.
This is a required parameter.
Top |
The alternative command name for CHDIR is CHGCURDIR. The following examples use the alternative command name, but CHDIR can be replaced directly for CHGCURDIR in all of them.
Example 1: Changing a Current Directory
CHGCURDIR DIR(/DIRECTORY2)
This command changes the current directory to the directory named DIRECTORY2.
Example 2: Changing a Current Directory to the Parent of the Current Directory
CHGCURDIR DIR('..')
This command changes the current directory to the parent directory of the directory that contains the current directory before this command is run.
Top |
*ESCAPE Messages
Top |