Introduction to the OpenVMS Operating Environment |
Directories |
In the OpenVMS environment, files are organized into directories. A directory contains a list of all the files that are organized within that directory. When you log in, OpenVMS attaches your session to a directory on a default disk that is associated with your user ID. This directory is called your home directory. For each user ID, there is only one home directory. Often the home directory name is the same as the user ID.
The home directory can contain both files and other directories called subdirectories. Subdirectories can also contain files and subdirectories. The terms directory and subdirectory refer to the same type of file unit. The term subdirectory conveys the relationship of one directory to another in the hierarchical structure that begins with the home directory.
This method of structuring files enables you to group sets of related files within directories. You can organize your files however you like. The following figure illustrates the directory file structure.
The directory that you are working in at any given time is called your default directory. For example, when you log in, your home directory is usually your default directory.
To create a directory, use the DCL CREATE/DIRECTORY command.
To move from one directory to another directory in the file structure, use the DCL SET DEFAULT command. Each time you use the DCL SET DEFAULT command, your default directory changes to the directory that you specify. Be sure to specify a pathname to the target directory. (A full pathname follows an unbroken path from the first-level directory down to the target subdirectory. However, a partial pathname, such as [.SUBDIR], can also be specified.) Using Directory File Structure as an example, the following command specifies the full pathname to the subdirectory SUBDIRC:
$ SET DEFAULT [HOMEDIR.SUBDIR2.SUBDIRC]
When this command executes, SUBDIRC becomes the default directory.
If you have any doubt about your current location in the file structure, use the DCL SHOW DEFAULT command to show your default directory. Keeping track of your default directory helps you keep track of files. For example, some programs write output files to the default directory.
Files |
Files contain various types of data, programming statements, or program output. Under OpenVMS, you can create files with several editors, including the EVE and EDT editors, the Text Processing Utility (TPU) editor, and the SAS text editor. Regardless of which editor you use, each file must have a unique name within that directory.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.