CMPS 340 (File Processing)   U of Scranton
DEC Command Language (DCL)
Some Basic Commands

As is typical of machines running the VMS operating system, the command language (or "shell", in UNIX terminology) by which a user communicates with the CS Dept.'s VAX (, is DCL ("Digital Command Language"). Note that VMS is case-insensitive, which means that it does not distinguish between the lower and upper case versions of any letter. In this document, we will show all DCL commands and file names in upper case.

To access the CS Dept.'s Vax, you probably will want to use some version of TELNET. On the PC's in the department's Plonsky lab (St. Thomas 488), this can be accomplished by using Putty. (Students taking the File Processing course will be issued a username and password.)

Herein are described a small number of the most useful commands in DCL. The reader is assumed to be familiar with the idea of organizing files as a hierarchy using directories. File names under VMS have three parts: a name, followed by a period, then a (possibly empty) suffix (or extension, if you prefer), followed by a semicolon, and finally, a version number. For example, in


GPA_PROG is the name, COB is the suffix, and 17 is the version number. Certain suffixes have special significance. For example, directories are files with the suffix DIR. Files containing DCL "scripts" are given the suffix COM. By convention, files containing COBOL programs are suffixed by COB. To refer to a file that is not in the default (i.e., current) directory, you would use a "path". For example,


refers to the (latest version of the) file named GPA_PROG.COB that resides within the CMPS340 subdirectory within the MCCLOSKE subdirectory within the HOME subdirectory on the device USERS.

Logging Off

To terminate an interactive terminal session (i.e., log off), use the command


or its abbreviation, LOG. (Note that the dollar sign is the prompt to which the user replies.)

Changing Your Password

Use the command


You will be prompted to enter your current password and your new one, twice.


Use the HELP command (analogous to Unix's man) to view documentation on how to use the commands in DCL. That is, enter

   $ HELP

To get help on a specific command, COPY for example, enter




In DCL, the term is "default" directory, rather than Unix's "working" (or what most of us refer to as "current") directory.

The path of your default directory is displayed on the first line in response to the DIRECTORY command (see below). (There may be a better way to ascertain it, but we haven't found it.)

To go from the current directory to a subdirectory within it (called SAM, say) you would enter the command


As DEFAULT may be abbreviated as DEF, we will do so hereafter.

To go from the current directory to its parent, you would enter the command

   $ SET DEF [-]

As in UNIX, you can move through several levels using a single command, as in


which has the effect of moving from the current directory up to its parent, then down to its subdirectory MARY and then to MARY's subdirectory HELEN. Strangely, if you "move" to a non-existent subdirectory, no error message is displayed until after you issue the next command involving the default directory, such as DIRECTORY (see below). If you find yourself in such a "netherworld", you can get back to your home directory by entering

   $ SET DEF [HOME.your user name]

Listing File Names:

To get a listing of all (names of) files in the default (i.e., current) directory, enter the command


As DIRECTORY may be abbreviated as DIR, we will do so hereafter.

Using the "wildcard" character, *, the listing can be restricted to names containing specified substrings. For example, if you want to see only the names of files containing COBOL programs (i.e., ones with the suffix COB), you would enter

   $ DIR *.COB

If you want to see only the names of subdirectories, you would enter

   $ DIR *.DIR

To list the names of all files containing JUNK somewhere in the main part of the name, you would enter

   $ DIR *JUNK*.*

Let's say you want a listing of all files containing COBOL programs in the subdirectory CMPS340 of the default directory. You would enter

   $ DIR [.CMPS340]*.COB

If you want more information about each listed file (such as size, creation time, time of most recent modification, etc.), use the FULL qualifier, as in


As it is likely that you are interested in seeing this information about only one file, you would most likely enter something like


which would give you complete information regarding (the latest version of) the file named PROG1.COB.


To create a subdirectory called FRANK within the current directory, enter



Deleting Files:

Depending upon the settings chosen by the system administrator, VMS may save the last few versions of each file (rather than only the latest one). Different versions of the "same" file are distinguished by their version numbers. Among two files with the same name, except for their version numbers, the one with the higher version number is the one more recently created.

To delete all but the most recent version of each file in the default directory, enter the command

   $ PURGE

To restrict purging to only those files whose names are of a certain form, enter, for example,

   $ PURGE *.COB

which would purge only among files containing COBOL programs.

To delete a particular file, you would enter, for example,


Notice that the version number is required here! To delete all versions of the file, you would enter


To delete all files containing COBOL programs (for example), enter

   $ DELETE *.COB;*

Creating Files:

Occasionally, it may be convenient to create a new (and "empty") file. An example of doing that is


At this point, you will be in edit mode (see EDIT command below). To escape from it, hit CNTRL-Z.

Copying Files:

To copy the contents of, say, the file JUNK.TXT into a new file JUNK_OLD.TXT, enter


As a special case of file copying, you can concatenate the contents of two or more files, placing the result into another one, as follows (for example):


which has the effect of creating JUNK.TXT and making its contents be the concatenation of JUNK1.TXT, JUNK2.TXT, and JUNK3.TXT.

If you want to append to an existing file the contents of one or more other files, use APPEND, as in


which has the effect of appending the contents of the first three files mentioned onto the end of the fourth file mentioned. (In other words, the last file mentioned is the "destination".) It is recommended that the destination file not be among the "source" files, as you could get unexpected results.


To rename a file from, say, JUNK.TXT to GARBAGE.TXT, you would enter the command


Displaying Contents of Files:

To display the contents of a text file, enter something such as


If you attempt to TYPE a non-text file, you will get garbage. (More precisely, the system will interpret the file's contents as though it were text.)

To "dump" the (uninterpreted) contents of a file, enter something such as


This displays the contents of the file in hexadecimal form and as text, side by side.

Editing Files:

At the moment, at least two text editors are available on, one of which is edit, which is invoked as in the following:


This editor allows you to move around the screen with the arrow keys and insert characters simply by typing. To exit and save the file, hit CNTRL-Z. To quit without saving, hit CNTRL-Y.

However, we recommend that you use vim, which is a clone of vi, a popular editor on Unix systems. An example of invocation is


Sending E-mail

To send a file as e-mail, enter the command

   $ MAIL/SUBJECT="<subject line>" <file name> <recipient username>

For example,

   $ MAIL/SUBJECT="program #1" prog1.cob mccloske

Note that supports only intra-system e-mail.