Technical data
Using Files and Directories
10.5 Protecting Files
10.5.5 Protecting Magnetic Tape Files
Because tapes are single-user devices, tape protection is only at the volume level.
The protection codes for magnetic tape volumes are usually assigned with the
INITIALIZE command.
You cannot use DCL commands to change protection characteristics on magnetic
tape volumes. See Section 9.5.1 for more information.
10.6 Accessing Disk Files
This section describes how to use DCL commands to access files at the file
level, not at the record level. This applies to reading files on disks, which is
explained in this section, as well as to copying tape files, which is explained in
Section 10.8.1.
Although DCL does allow you to manipulate files at the record level, for reasons
of performance, you probably want to use a conventional programming language
instead. Compaq recommends that you write programs using the OpenVMS
Record Management Services (RMS) facilities, which are specifically designed to
access files at the record level. You can write these programs in any higher-level
language that the operating system supports.
To access disk files at the file level, you can use DCL commands. You cannot,
however, use DCL commands to read or write files that are not in the standard
formats supported by the operating system. If the file formats are not standard,
you must mount the volumes on which they reside with the /FOREIGN qualifier
to have read and write access.
Although the examples used in this section show how to access disk files on RA90
disk packs, they also apply to other devices.
To read the contents of a disk file, use the DCL command TYPE, which displays
the contents of a file on your terminal. To find the exact location of the disk file
you want to read, use the DCL command DIRECTORY.
How to Perform This Task
If, for example, you want to read the contents of a file named HISFILE, which
is located somewhere in the directory [CHARLES] on a disk device whose logical
name is DISK$DOCUMENT, follow these steps:
1. Look for the exact location of HISFILE by entering the following command:
$ DIRECTORY DISK$DOCUMENT:[CHARLES...]HISFILE.*
This command instructs the operating system to search the entire
[CHARLES] directory, including all the subdirectories, for all file types and
version numbers of HISFILE.
The following information is displayed on your terminal:
Directory DISK$DOCUMENT:[CHARLES.MEMO]
HISFILE.UPD;1
Total of 1 file.
This display informs you that only one version of HISFILE exists, that its file
type is UPD, and that it resides in the [CHARLES.MEMO] directory.
2. To read the contents of this file, enter the following command:
$ TYPE [CHARLES.MEMO]HISFILE.UPD
10–22 Using Files and Directories










