|SAS Companion for the OpenVMS Operating Environment|
You can create a file in the OpenVMS operating environment with a variety of editors. When you create a file, you must give it a unique name. A fully qualified name indicates how a file fits into the file structure (a system of directories and subdirectories) that contains all the files stored under the OpenVMS system. The following sections describe this file structure and discuss the components of a fully qualified name.
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. Directory File Structure illustrates the directory file structure.
Directory File Structure
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
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 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.
The following type of file specification is called a fully qualified name because it completely indicates how the file fits into the file structure:
A file specification cannot exceed 255 characters. The directory and file-specification can each consist of up to 39 characters. The file-type can consist of up to 38 characters, although most of the default file types have only 3 characters. Permissible characters are the letters A through Z, the numbers 0 through 9, an underscore (_), a hyphen (-), or a dollar sign ($). However, do not use a hyphen as the first character of file-specification nor as the last character of file-type. OpenVMS filenames and file types are not case-sensitive. For more information about file specifications, refer to OpenVMS User's Manual.
In many cases you can uniquely identify a file even without specifying all of the fields in a fully qualified name. The following definitions give default values for fields that can be omitted from a file specification:
The default value for directory is the default directory. Include directory in the fully qualified name only when you need to access a file that is not in your default directory. (For more information about the default directory, see Directories.)
Note: You can substitute angle brackets
>) for square brackets ([ ]) in
The default value for file-type depends on how the file is created or used. For example, some DCL commands assume default file types. You can assign a file type when you create a file.
Your system manager sets the maximum number of versions of a file that are saved at any given time. For example, if you have edited a file named [DIR1] PROG.DAT 1,000 times and your system is set to keep four backup versions, then the directory [DIR1] contains the following versions:
PROG.DAT;1000 PROG.DAT;999 PROG.DAT;998 PROG.DAT;997
When you edit PROG.DAT the next time (version 1001), PROG.DAT;1001 is created and PROG.DAT;997 is deleted.
OpenVMS supports two general-purpose wildcard characters: the asterisk (*) and the percent sign (%). In DCL commands, you can use these wildcard characters in file specifications to operate on a group of files instead of on a specific file.
The asterisk (*) replaces zero or more characters in one or more of the directory, file-specification, file-type, and version fields in a file specification. It causes the DCL command to act on all files whose names match the fields that you include in the specification. For example, all of the following file specifications match CAT.SAS:
The asterisk (*) often references sets of files in DCL commands such as PRINT, TYPE, and COPY. For example, the following command prints all versions of all files in directory [DIR1] that have the file type .SAS:
$ PRINT [DIR1]*.SAS;*
The percent sign (%) replaces a single character in directory, file-specification, and file-type fields in the file specification. For example, the following command prints all versions of every file whose name has five characters beginning with the letters PROG and whose file type is .SAS:
$ PRINT PROG%.SAS;*
In other words, you can use the previous example to print files PROG1.SAS through PROG9.SAS, but not file PROG10.SAS. To print all versions of every file whose name begins with the letters PROG and whose file type is .SAS, enter the following command:
$ PRINT PROG*.SAS;*
Note: Using wildcard characters
in file specifications can degrade the performance of your operating environment.
For additional rules for using wildcard specifications in operations across nodes in a network, refer to OpenVMS Networking Manual.
For information about using wildcards in file and directory specifications, see Using Wildcard Characters in External File Specifications.
|OpenVMS File Types|
The file-type portion of a filename often indicates the contents of the file. Both OpenVMS and the SAS System use default file types for output files. DCL commands that create files often assign default file types if you omit file-type in the file specification. When you assign file types to files you create, keep in mind that either OpenVMS or SAS may require a certain file type, depending on how a file is used. The following is a list of commonly used OpenVMS file types:
|.COM||is usually a DCL command file that can be executed with the DCL @ command or submitted for batch execution with the SUBMIT command. (For information about submitting a SAS job in batch mode, see Using SAS in Batch Mode.)|
|.DIR||is usually a directory. The DCL CREATE/DIRECTORY command assigns the file type .DIR by default.|
|.LIS||is usually a file called a listing, which may contain output of a SAS session.|
|.LOG||is usually a file called the OpenVMS log, which contains batch job output, or it is the log of a SAS session.|
|.MAI||is usually a file containing messages that were entered with the OpenVMS Personal Mail Utility (MAIL).|
For a complete list of OpenVMS file types, refer to OpenVMS User's Manual.
|OpenVMS File Types Used by the SAS System|
The SAS System uses unique file types to distinguish between SAS files and OpenVMS external files in a directory.
Most of the file types that the SAS System uses are assigned to files that are described as either temporary or permanent SAS files. A SAS file is stored in a SAS data library and is referred to as a member of a library. Each member has a member type. The SAS System equates some OpenVMS file types with a general set of SAS member types that it uses under all operating environments.
In Version 7 and 8 of the SAS System, the names of these file types have the following form:
For information about SAS engines, see Using SAS Engines.
In addition, for Version 7 and Version 8, two types
of SAS temporary files exist, with OpenVMS file
types of .SAS7BUTL and .SAS7BPUT.
These files appear only in the SASWORK data library.
External files can be processed by other programs and by the FILENAME function and the %INCLUDE, FILE, and INFILE statements in the SAS DATA step. (For more information about external files, see Using External Files and Devices.) The SAS System uses the following OpenVMS file types for external files:
Top of Page
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.