Overview (CD command)

CD changes the working directory location, making it possible to use relative paths for subsequent file specifications in command syntax, including data files specified on commands such as GET and SAVE, command syntax files specified on commands such as INSERT and INCLUDE, and output files specified on commands such as OMS and WRITE.

Basic Specification

The only specification is the command name followed by a quoted directory specification.

  • The directory specification can contain a drive specification.
  • The directory specification can be a previously defined file handle (see the FILE HANDLE command for more information).
  • The directory specification can include paths defined in operating system environment variables.

Operations

The change in the working directory remains in effect until some other condition occurs that changes the working directory during the session, such as explicitly changing the working directory on another CD command or an INSERT command with a CD keyword that specifies a different directory.

  • If the directory path is a relative path, it is relative to the current working directory.
  • If the directory specification contains a filename, the filename portion is ignored.
  • If the last (most-nested) subdirectory in the directory specification does not exist, then it is assumed to be a filename and is ignored.
  • If any directory specification prior to the last directory (or file) is invalid, the command will fail, and an error message is issued.

Limitations

The CD command has no effect on the relative directory location for SET TLOOK file specifications. File specifications for the TLOOK subcommand of the SET command should include complete path information.