Multiple Paths

An environment variable used for filename mapping can specify multiple pathnames. This causes the system to search for subsequent files if a "file not found" condition is returned for the first path specified by the environment variable.

Consider the following example contents of an environment variable named dd_dir.

dd_dir=/a/b;/c/d;
This causes the system to search /c/d for the assigned file if a "file not found" condition is returned on /a/b.
Note:
  • If an existing file is being opened, using OPEN INPUT, OPEN I-O, OPEN EXTEND or the CBL_OPEN_FILE byte stream routine, the environment variable is expanded to the first path on which the file is found.
  • If a new file is being created, using OPEN OUTPUT, OPEN I-O, OPEN EXTEND, or the CBL_CREATE_FILE byte stream routine, the environment variable is expanded to the first path named. For files which are opened with OPEN OUTPUT, you can override this behavior by setting the SEARCHONCREATE File Handler configuration option to ON.
  • The length of each path in a path list in an environment variable must be less than or equal to the permitted maximum number of characters for a path.